6800e84ec5134ac269a38b87b81dccc3bbb2c0f1
[mono.git] / mcs / class / corlib / System / Environment.cs
1 //------------------------------------------------------------------------------\r
2 // \r
3 // System.Environment.cs \r
4 //\r
5 // Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved\r
6 // \r
7 // Author:         Jim Richardson, develop@wtfo-guru.com\r
8 // Created:        Saturday, August 11, 2001 \r
9 //\r
10 //------------------------------------------------------------------------------\r
11 \r
12 using System;\r
13 using System.Collections;\r
14 \r
15 namespace System\r
16 {\r
17         public sealed class Environment\r
18         {\r
19                 public enum SpecialFolder\r
20                 {       // TODO: Determin if these windoze style folder identifiers \r
21                         //       linux counterparts\r
22                         ApplicationData,\r
23                         CommonApplicationData,\r
24                         CommonProgramFiles,\r
25                         Cookies,\r
26                         DesktopDirectory,\r
27                         Favorites,\r
28                         History,\r
29                         InternetCache,\r
30                         LocalApplicationData,\r
31                         Personal,\r
32                         ProgramFiles,\r
33                         Programs,\r
34                         Recent,\r
35                         SendTo,\r
36                         StartMenu,\r
37                         Startup,\r
38                         System,\r
39                         Templates\r
40                 }\r
41 \r
42                 /// <summary>\r
43                 /// Gets the command line for this process\r
44                 /// </summary>\r
45                 public static string CommandLine\r
46                 {\r
47                         get\r
48                         {\r
49                                 return null;\r
50                         }\r
51                 }\r
52 \r
53                 /// <summary>\r
54                 /// Gets or sets the current directory\r
55                 /// </summary>\r
56                 public static string CurrentDirectory\r
57                 {\r
58                         get\r
59                         {\r
60                                 // TODO: needs more research/work/thought\r
61                                 return GetEnvironmentVariable("PWD");\r
62                         }\r
63                         set\r
64                         {\r
65                         }\r
66                 }\r
67 \r
68                 /// <summary>\r
69                 /// Gets or sets the exit code of this process\r
70                 /// </summary>\r
71                 public static int ExitCode\r
72                 {\r
73                         get\r
74                         {\r
75                                 return 0;\r
76                         }\r
77                         set\r
78                         {\r
79                         }\r
80                 }\r
81 \r
82                 /// <summary>\r
83                 /// Gets the name of the local computer\r
84                 /// </summary>\r
85                 public static string MachineName\r
86                 {\r
87                         get\r
88                         {\r
89                                 // TODO: needs more research/work/thought\r
90                                 return GetEnvironmentVariable("HOSTNAME");\r
91                         }\r
92                 }\r
93 \r
94                 /// <summary>\r
95                 /// Gets the standard new line value\r
96                 /// </summary>\r
97                 public static string NewLine\r
98                 {\r
99                         get\r
100                         {\r
101                                 return "\n";\r
102                         }\r
103                 }\r
104 \r
105                 /// <summary>\r
106                 /// Gets the current OS version information\r
107                 /// </summary>\r
108                 public static OperatingSystem OSVersion\r
109                 {\r
110                         get\r
111                         {\r
112                                 return null;\r
113                         }\r
114                 }\r
115 \r
116                 /// <summary>\r
117                 /// Get a string containing a trace of the stack\r
118                 /// </summary>\r
119                 public static string StackTrace\r
120                 {\r
121                         get\r
122                         {\r
123                                 return null;\r
124                         }\r
125                 }\r
126 \r
127                 /// <summary>\r
128                 /// Get a fully qualified path to the system directory\r
129                 /// </summary>\r
130                 public static string SystemDirectory\r
131                 {\r
132                         get\r
133                         {\r
134                                 return null;\r
135                         }\r
136                 }\r
137 \r
138                 /// <summary>\r
139                 /// Get the number of milliseconds that have elapsed since the system was booted\r
140                 /// </summary>\r
141                 public static int TickCount\r
142                 {\r
143                         get\r
144                         {\r
145                                 return 0;\r
146                         }\r
147                 }\r
148 \r
149                 /// <summary>\r
150                 /// Get UserDomainName\r
151                 /// </summary>\r
152                 public static string UserDomainName\r
153                 {\r
154                         get\r
155                         {\r
156                                 return null;\r
157                         }\r
158                 }\r
159 \r
160                 /// <summary>\r
161                 /// Gets a flag indicating whether the process is in interactive mode\r
162                 /// </summary>\r
163                 public static bool UserInteractive\r
164                 {\r
165                         get\r
166                         {\r
167                                 return false;\r
168                         }\r
169                 }\r
170 \r
171                 /// <summary>\r
172                 /// Get the user name of current process is running under\r
173                 /// </summary>\r
174                 public static string UserName\r
175                 {\r
176                         get\r
177                         {\r
178                                 // TODO: needs more research/work/thought\r
179                                 string result = GetEnvironmentVariable("USERNAME");\r
180                                 if(result == null || result.Equals(string.Empty))\r
181                                 {\r
182                                         result = GetEnvironmentVariable("USER");\r
183                                 }\r
184                                 return result;\r
185                         }\r
186                 }\r
187 \r
188                 /// <summary>\r
189                 /// Get the version of an assembly\r
190                 /// </summary>\r
191                 public static Version Version\r
192                 {\r
193                         get\r
194                         {\r
195                                 return null;\r
196                         }\r
197                 }\r
198 \r
199                 /// <summary>\r
200                 /// Get the amount of physical memory mapped to process\r
201                 /// </summary>\r
202                 public static long WorkingSet\r
203                 {\r
204                         get\r
205                         {\r
206                                 return 0;\r
207                         }\r
208                 }\r
209 \r
210                 public static void Exit(int exitCode)\r
211                 { \r
212                 }\r
213 \r
214                 /// <summary>\r
215                 /// Substitute environment variables in the argument "name"\r
216                 /// </summary>\r
217                 public static string ExpandEnvironmentVariables(string name)\r
218                 {\r
219                         return name;\r
220                 }\r
221 \r
222                 /// <summary>\r
223                 /// Return an array of the command line arguments of the current process\r
224                 /// </summary>\r
225                 public static string[] GetCommandLineArgs()\r
226                 {\r
227                         return null;\r
228                 }\r
229 \r
230                 /// <summary>\r
231                 /// Return a string containing the value of the environment variable identifed by parameter "variable"\r
232                 /// </summary>\r
233                 public static string GetEnvironmentVariable(string variable)\r
234                 {\r
235                         return null;\r
236                 }\r
237 \r
238                 /// <summary>\r
239                 /// Return a set of all environment variables and their values\r
240                 /// </summary>\r
241                 public static IDictionary GetEnvironmentVariables()\r
242                 {\r
243                         return null;\r
244                 }\r
245 \r
246                 /// <summary>\r
247                 /// Returns the fully qualified path of the folder specified by the "folder" parameter\r
248                 /// </summary>\r
249                 public static string GetFolderPath(SpecialFolder folder)\r
250                 {\r
251                         return null;\r
252                 }\r
253 \r
254                 /// <summary>\r
255                 /// Returns an array of the logical drives\r
256                 /// </summary>\r
257                 public static string[] GetLogicalDrives()\r
258                 {\r
259                         return null;\r
260                 }\r
261         }\r
262 }\r