dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/runtime/System AppDomain.cs, 1.25, 1.26


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/runtime/System AppDomain.cs, 1.25, 1.26
Date: Sun, 23 Nov 2003 22:40:42 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv13923/runtime/System

Modified Files:
        AppDomain.cs 
Log Message:


Populate the "SetupInformation" property for the current domain.


Index: AppDomain.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/AppDomain.cs,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** AppDomain.cs        12 Sep 2003 01:01:05 -0000      1.25
--- AppDomain.cs        23 Nov 2003 22:40:40 -0000      1.26
***************
*** 161,164 ****
--- 161,199 ----
        public event UnhandledExceptionEventHandler UnhandledException;
  
+ #if !ECMA_COMPAT
+ 
+       // Create the setup information block for the current domain.
+       private static AppDomainSetup CreateCurrentSetup()
+                       {
+                               AppDomainSetup setup = new AppDomainSetup();
+ 
+                               // Get the location information for the assembly
+                               // that contains the program entry point.
+                       #if CONFIG_RUNTIME_INFRA
+                               Assembly entry = Assembly.GetEntryAssembly();
+                               String location = entry.Location;
+                               if(location != null && location != String.Empty)
+                               {
+                                       // "ApplicationBase" is the directory 
containing
+                                       // the application, ending with a 
directory separator.
+                                       String dir = 
Path.GetDirectoryName(location);
+                                       if(dir != null && dir.Length > 0 &&
+                                          !Path.IsSeparator(dir[dir.Length - 
1]))
+                                       {
+                                               dir += 
Path.DirectorySeparatorChar;
+                                       }
+                                       setup.ApplicationBase = dir;
+ 
+                                       // The configuration file is the name 
of the entry
+                                       // assembly with ".config" added to the 
end.
+                                       setup.ConfigurationFile = location + 
".config";
+                               }
+                       #endif
+ 
+                               return setup;
+                       }
+ 
+ #endif
+ 
        // Get the current domain.
  #if ECMA_COMPAT
***************
*** 175,179 ****
--- 210,219 ----
                                                if(currentDomain == null)
                                                {
+                                               #if !ECMA_COMPAT
+                                                       currentDomain = new 
AppDomain
+                                                               ("current", 
null, CreateCurrentSetup());
+                                               #else
                                                        currentDomain = new 
AppDomain("current");
+                                               #endif
                                                }
                                                return currentDomain;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]