2002-07-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / corlib / System / Environment.cs
index dc92fda727c3c26b535a8082f3098bf542649ce8..ccb608bff74357d7ea3e1c61067f3f3c2f9f2fcb 100644 (file)
@@ -22,30 +22,30 @@ namespace System
 {\r
        public sealed class Environment\r
        {\r
-               private Environment () {}
-
+               private Environment () {}\r
+\r
                [MonoTODO]\r
                public enum SpecialFolder\r
                {       // TODO: Determine if these windoze style folder identifiers \r
                        //       have unix/linux counterparts\r
-                       ApplicationData,\r
-                       CommonApplicationData,\r
-                       CommonProgramFiles,\r
-                       Cookies,\r
-                       DesktopDirectory,\r
-                       Favorites,\r
-                       History,\r
-                       InternetCache,\r
-                       LocalApplicationData,\r
-                       Personal,\r
-                       ProgramFiles,\r
-                       Programs,\r
-                       Recent,\r
-                       SendTo,\r
-                       StartMenu,\r
-                       Startup,\r
-                       System,\r
-                       Templates\r
+                       Programs = 0x02,\r
+                       Personal = 0x05,\r
+                       Favorites = 0x06,\r
+                       Startup = 0x07,\r
+                       Recent = 0x08,\r
+                       SendTo = 0x09,\r
+                       StartMenu = 0x0b,\r
+                       DesktopDirectory = 0x10,\r
+                       Templates = 0x15,\r
+                       ApplicationData = 0x1a,\r
+                       LocalApplicationData = 0x1c,\r
+                       InternetCache = 0x20,\r
+                       Cookies = 0x21,\r
+                       History = 0x22,\r
+                       CommonApplicationData   = 0x23,\r
+                       System = 0x25,\r
+                       ProgramFiles = 0x26,\r
+                       CommonProgramFiles = 0x2b,\r
                }\r
 \r
                // TODO: Make sure the security attributes do what I expect\r
@@ -60,7 +60,7 @@ namespace System
                        {\r
                                // FIXME: we may need to quote, but any sane person\r
                                // should use GetCommandLineArgs () instead.\r
-                               return String.Join ("", GetCommandLineArgs ());\r
+                               return String.Join (" ", GetCommandLineArgs ());\r
                        }\r
                }\r
 \r
@@ -134,12 +134,13 @@ namespace System
                /// <summary>\r
                /// Get StackTrace\r
                /// </summary>\r
-               [MonoTODO]\r
-               public static string StackTrace\r
-               {\r
-                       get\r
-                       {\r
-                               return null;\r
+               public static string StackTrace {\r
+                       get {\r
+                               try {\r
+                                       throw new Exception ();\r
+                               } catch (Exception e) {\r
+                                       return e.StackTrace;\r
+                               }\r
                        }\r
                }\r
 \r
@@ -157,25 +158,18 @@ namespace System
                /// <summary>\r
                /// Get the number of milliseconds that have elapsed since the system was booted\r
                /// </summary>\r
-               [MonoTODO]\r
-               public static int TickCount\r
-               {\r
-                       get\r
-                       {\r
-                               return 0;\r
-                               //return getTickCount();\r
-                       }\r
+               public extern static int TickCount {\r
+                       [MethodImplAttribute (MethodImplOptions.InternalCall)]\r
+                       get;\r
                }\r
 \r
                /// <summary>\r
                /// Get UserDomainName\r
                /// </summary>\r
                [MonoTODO]\r
-               public static string UserDomainName\r
-               {\r
-                       get\r
-                       {\r
-                               return null;\r
+               public static string UserDomainName {\r
+                       get {\r
+                               return MachineName;\r
                        }\r
                }\r
 \r
@@ -210,14 +204,12 @@ namespace System
                }\r
 \r
                /// <summary>\r
-               /// Get the version of an assembly\r
+               /// Get the version of the common language runtime \r
                /// </summary>\r
                [MonoTODO]\r
-               public static Version Version\r
-               {\r
-                       get\r
-                       {\r
-                               return null;\r
+               public static Version Version {\r
+                       get {\r
+                               return new Version();\r
                        }\r
                }\r
 \r