ProjectData.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // ProjectData.cs
  3. //
  4. // Authors:
  5. // Martin Adoue ([email protected])
  6. // Chris J Breisch ([email protected])
  7. // Francesco Delfino ([email protected])
  8. //
  9. // (C) 2002 Ximian Inc.
  10. // 2002 Tipic, Inc. (http://www.tipic.com)
  11. //
  12. //
  13. // Copyright (c) 2002-2003 Mainsoft Corporation.
  14. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  15. //
  16. // Permission is hereby granted, free of charge, to any person obtaining
  17. // a copy of this software and associated documentation files (the
  18. // "Software"), to deal in the Software without restriction, including
  19. // without limitation the rights to use, copy, modify, merge, publish,
  20. // distribute, sublicense, and/or sell copies of the Software, and to
  21. // permit persons to whom the Software is furnished to do so, subject to
  22. // the following conditions:
  23. //
  24. // The above copyright notice and this permission notice shall be
  25. // included in all copies or substantial portions of the Software.
  26. //
  27. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  28. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  29. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  30. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  31. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  32. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  33. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  34. //
  35. using System;
  36. using System.ComponentModel;
  37. using System.Runtime.InteropServices;
  38. namespace Microsoft.VisualBasic.CompilerServices
  39. {
  40. [MonoTODO]
  41. [EditorBrowsable(EditorBrowsableState.Never)]
  42. [StructLayout(LayoutKind.Auto)]
  43. public sealed class ProjectData {
  44. private ProjectData () {}
  45. internal static int erl;
  46. internal static Microsoft.VisualBasic.ErrObject pErr = new ErrObject();
  47. internal static System.Exception projectError;
  48. public static void ClearProjectError ()
  49. {
  50. pErr.Clear();
  51. }
  52. internal static Microsoft.VisualBasic.ErrObject Err
  53. {
  54. get {
  55. return pErr;
  56. }
  57. }
  58. public static Exception CreateProjectError(int hr)
  59. {
  60. pErr.Clear();
  61. return pErr.CreateException(hr, VBUtils.GetResourceString(pErr.MapErrorNumber(hr)));
  62. }
  63. public static void SetProjectError(Exception ex)
  64. {
  65. pErr.CaptureException(ex);
  66. }
  67. public static void SetProjectError(Exception ex, int lErl)
  68. {
  69. pErr.CaptureException(ex, lErl);
  70. }
  71. public static void EndApp()
  72. {
  73. //FileSystem.CloseAllFiles(Assembly.GetCallingAssembly());
  74. Environment.Exit(0);
  75. }
  76. [MonoTODO]
  77. protected static void Finalize()
  78. {
  79. throw new NotImplementedException();
  80. }
  81. }
  82. }