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