當前位置: 首頁>>代碼示例>>C#>>正文


C# AppDomainSetup.SetupDefaultApplicationBase方法代碼示例

本文整理匯總了C#中System.AppDomainSetup.SetupDefaultApplicationBase方法的典型用法代碼示例。如果您正苦於以下問題:C# AppDomainSetup.SetupDefaultApplicationBase方法的具體用法?C# AppDomainSetup.SetupDefaultApplicationBase怎麽用?C# AppDomainSetup.SetupDefaultApplicationBase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.AppDomainSetup的用法示例。


在下文中一共展示了AppDomainSetup.SetupDefaultApplicationBase方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetupFusionStore

 private void SetupFusionStore(AppDomainSetup info)
 {
     if ((info.Value[0] == null) || (info.Value[1] == null))
     {
         AppDomain defaultDomain = GetDefaultDomain();
         if (this == defaultDomain)
         {
             info.SetupDefaultApplicationBase(RuntimeEnvironment.GetModuleFileName());
         }
         else
         {
             if (info.Value[1] == null)
             {
                 info.ConfigurationFile = defaultDomain.FusionStore.Value[1];
             }
             if (info.Value[0] == null)
             {
                 info.ApplicationBase = defaultDomain.FusionStore.Value[0];
             }
             if (info.Value[4] == null)
             {
                 info.ApplicationName = defaultDomain.FusionStore.Value[4];
             }
         }
     }
     if (info.Value[5] == null)
     {
         info.PrivateBinPath = Environment.nativeGetEnvironmentVariable(AppDomainSetup.PrivateBinPathEnvironmentVariable);
     }
     if (info.DeveloperPath == null)
     {
         info.DeveloperPath = RuntimeEnvironment.GetDeveloperPath();
     }
     IntPtr fusionContext = this.GetFusionContext();
     info.SetupFusionContext(fusionContext);
     if (info.LoaderOptimization != LoaderOptimization.NotSpecified)
     {
         this.UpdateLoaderOptimization((int) info.LoaderOptimization);
     }
     this._FusionStore = info;
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:41,代碼來源:AppDomain.cs

示例2: SetupFusionStore

        private void SetupFusionStore(AppDomainSetup info)
        {
            // Create the application base and configuration file from the imagelocation
            // passed in or use the Win32 Image name.
            if(info.Value[(int) AppDomainSetup.LoaderInformation.ApplicationBaseValue] == null ||
               info.Value[(int) AppDomainSetup.LoaderInformation.ConfigurationFileValue] == null ) {
                AppDomain defaultDomain = GetDefaultDomain();
                if (this == defaultDomain) {
                    // The default domain gets its defaults from the main process.
                    info.SetupDefaultApplicationBase(RuntimeEnvironment.GetModuleFileName());
                }
                else {
                    // Other domains get their defaults from the default domain. This way, a host process
                    // can use AppDomainManager to set up the defaults for every domain created in the process.
                    if (info.Value[(int) AppDomainSetup.LoaderInformation.ConfigurationFileValue] == null)
                        info.ConfigurationFile = defaultDomain.FusionStore.Value[(int) AppDomainSetup.LoaderInformation.ConfigurationFileValue];
                    if (info.Value[(int) AppDomainSetup.LoaderInformation.ApplicationBaseValue] == null)
                        info.ApplicationBase = defaultDomain.FusionStore.Value[(int) AppDomainSetup.LoaderInformation.ApplicationBaseValue];
                    if (info.Value[(int) AppDomainSetup.LoaderInformation.ApplicationNameValue] == null)
                        info.ApplicationName = defaultDomain.FusionStore.Value[(int) AppDomainSetup.LoaderInformation.ApplicationNameValue];
                }
            }

            // If there is no relative path then check the
            // environment
            if(info.Value[(int) AppDomainSetup.LoaderInformation.PrivateBinPathValue] == null)
                info.PrivateBinPath = Environment.nativeGetEnvironmentVariable(AppDomainSetup.PrivateBinPathEnvironmentVariable);

            // Add the developer path if it exists on this
            // machine.
            if(info.DeveloperPath == null)
                info.DeveloperPath = RuntimeEnvironment.GetDeveloperPath();

            // Set up the fusion context
            IntPtr fusionContext = GetFusionContext();
            info.SetupFusionContext(fusionContext);

            // Set loader optimization policy
            if (info.LoaderOptimization != LoaderOptimization.NotSpecified)
                UpdateLoaderOptimization((int) info.LoaderOptimization);

            // This must be the last action taken
            _FusionStore = info;
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:44,代碼來源:appdomain.cs


注:本文中的System.AppDomainSetup.SetupDefaultApplicationBase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。