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


C# System.ApplicationIdentity類代碼示例

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


ApplicationIdentity類屬於System命名空間,在下文中一共展示了ApplicationIdentity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ApplicationIdentity_WithCulture

		public void ApplicationIdentity_WithCulture ()
		{
			ApplicationIdentity appid = new ApplicationIdentity ("Mono, Culture=fr-ca");
			Assert.IsNull (appid.CodeBase, "CodeBase");
			Assert.AreEqual ("Mono, Culture=fr-ca", appid.FullName);
			Assert.AreEqual ("Mono, Culture=fr-ca", appid.ToString ());
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:7,代碼來源:ApplicationIdentityTest.cs

示例2: CreateFromName

 private void CreateFromName(ApplicationIdentity applicationIdentity)
 {
     if (applicationIdentity == null)
     {
         throw new ArgumentNullException("applicationIdentity");
     }
     this._applicationIdentity = applicationIdentity;
     IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();
     this._definitionIdentities = new ArrayList(2);
     IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
     while (identity.Next(1, definitionIdentity) == 1)
     {
         this._definitionIdentities.Add(definitionIdentity[0]);
     }
     this._definitionIdentities.TrimToSize();
     if (this._definitionIdentities.Count <= 1)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
     }
     this._manifestPaths = null;
     this._manifests = null;
     this._actContext = IsolationInterop.CreateActContext(this._applicationIdentity.Identity);
     this._form = ContextForm.StoreBounded;
     this._appRunState = ApplicationStateDisposition.Undefined;
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:25,代碼來源:ActivationContext.cs

示例3: CreatePartialActivationContext

    public static System.ActivationContext CreatePartialActivationContext (ApplicationIdentity identity, string[] manifestPaths)
    {
      Contract.Ensures (Contract.Result<System.ActivationContext>() != null);
      Contract.Ensures (manifestPaths.Length >= 0);

      return default(System.ActivationContext);
    }
開發者ID:asvishnyakov,項目名稱:CodeContracts,代碼行數:7,代碼來源:System.ActivationContext.cs

示例4: CreatePartialActivationContext

		static public ActivationContext CreatePartialActivationContext (ApplicationIdentity identity)
		{
			if (identity == null)
				throw new ArgumentNullException ("identity");

			// TODO - throw new ArgumentException
			// - for invalid ApplicationIdentity

			return new ActivationContext (identity);
		}
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:10,代碼來源:ActivationContext.cs

示例5: HostContextInternal

 public HostContextInternal(TrustManagerContext trustManagerContext)
 {
     if (trustManagerContext == null)
     {
         this.persist = true;
     }
     else
     {
         this.ignorePersistedDecision = trustManagerContext.IgnorePersistedDecision;
         this.noPrompt = trustManagerContext.NoPrompt;
         this.persist = trustManagerContext.Persist;
         this.previousAppId = trustManagerContext.PreviousApplicationIdentity;
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:14,代碼來源:HostContextInternal.cs

示例6: CreateActivationContext

 internal static void CreateActivationContext(string fullName, string[] manifestPaths, bool useFusionActivationContext, out ApplicationIdentity applicationIdentity, out ActivationContext activationContext)
 {
     applicationIdentity = new ApplicationIdentity(fullName);
     activationContext = null;
     if (useFusionActivationContext)
     {
         if (manifestPaths != null)
         {
             activationContext = new ActivationContext(applicationIdentity, manifestPaths);
         }
         else
         {
             activationContext = new ActivationContext(applicationIdentity);
         }
     }
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:16,代碼來源:CmsUtils.cs

示例7: CreateFromNameAndManifests

 private void CreateFromNameAndManifests(ApplicationIdentity applicationIdentity, string[] manifestPaths)
 {
     if (applicationIdentity == null)
     {
         throw new ArgumentNullException("applicationIdentity");
     }
     if (manifestPaths == null)
     {
         throw new ArgumentNullException("manifestPaths");
     }
     this._applicationIdentity = applicationIdentity;
     IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();
     this._manifests = new ArrayList(2);
     this._manifestPaths = new string[manifestPaths.Length];
     IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
     int index = 0;
     while (identity.Next(1, definitionIdentity) == 1)
     {
         ICMS icms = (ICMS) IsolationInterop.ParseManifest(manifestPaths[index], null, ref IsolationInterop.IID_ICMS);
         if (!IsolationInterop.IdentityAuthority.AreDefinitionsEqual(0, icms.Identity, definitionIdentity[0]))
         {
             throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppIdMismatch"));
         }
         this._manifests.Add(icms);
         this._manifestPaths[index] = manifestPaths[index];
         index++;
     }
     if (index != manifestPaths.Length)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppId"));
     }
     this._manifests.TrimToSize();
     if (this._manifests.Count <= 1)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
     }
     this._definitionIdentities = null;
     this._actContext = null;
     this._form = ContextForm.Loose;
     this._appRunState = ApplicationStateDisposition.Undefined;
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:41,代碼來源:ActivationContext.cs

示例8: CompareIdentities

        internal static bool CompareIdentities(ApplicationIdentity applicationIdentity1, ApplicationIdentity applicationIdentity2, ApplicationVersionMatch versionMatch)
        {
            uint num;
            if ((applicationIdentity1 == null) || (applicationIdentity2 == null))
            {
                return (applicationIdentity1 == applicationIdentity2);
            }
            switch (versionMatch)
            {
                case ApplicationVersionMatch.MatchExactVersion:
                    num = 0;
                    break;

                case ApplicationVersionMatch.MatchAllVersions:
                    num = 1;
                    break;

                default:
                    throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", new object[] { (int) versionMatch }), "versionMatch");
            }
            return IsolationInterop.AppIdAuthority.AreDefinitionsEqual(num, applicationIdentity1.Identity, applicationIdentity2.Identity);
        }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:22,代碼來源:CmsUtils.cs

示例9: CreateFromName

        private void CreateFromName (ApplicationIdentity applicationIdentity) 
        {
            if (applicationIdentity == null) 
                throw new ArgumentNullException("applicationIdentity"); 
            Contract.EndContractBlock();
 
            _applicationIdentity = applicationIdentity;

            IEnumDefinitionIdentity idenum = _applicationIdentity.Identity.EnumAppPath();
 
            _definitionIdentities = new ArrayList(DefaultComponentCount);
 
            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1]; 
            while (idenum.Next(1, asbId) == 1)
            { 
                _definitionIdentities.Add(asbId[0]);
            }
            _definitionIdentities.TrimToSize();
            if (_definitionIdentities.Count <= 1) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId")); 
#else
                throw new ArgumentException("Invalid identity: no deployment/app identity specified"); 
#endif
            }

            _manifestPaths = null; 
            _manifests = null;
 
            // Construct real IActContext from store. 
            _actContext = IsolationInterop.CreateActContext(_applicationIdentity.Identity);
            _form = ContextForm.StoreBounded; 
            _appRunState = ApplicationStateDisposition.Undefined;

#if ISOLATION_IN_MSCORLIB
            Contract.Assert(_definitionIdentities.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey"); 
#endif
        } 
開發者ID:sjyanxin,項目名稱:WPFSource,代碼行數:39,代碼來源:activationcontext.cs

示例10: ActivationContext

 internal ActivationContext(ApplicationIdentity applicationIdentity)
 {
     this.CreateFromName(applicationIdentity);
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:4,代碼來源:ActivationContext.cs

示例11: CreatePartialActivationContext

 public static ActivationContext CreatePartialActivationContext(ApplicationIdentity identity, string[] manifestPaths)
 {
     return new ActivationContext(identity, manifestPaths);
 }
開發者ID:randomize,項目名稱:VimConfig,代碼行數:4,代碼來源:ActivationContext.cs

示例12: SetupDomainSecurityForApplication

 [System.Security.SecurityCritical]  // auto-generated
 private void SetupDomainSecurityForApplication(ApplicationIdentity appIdentity,
                                                ApplicationTrust appTrust)
 {
     // Set the Application trust on the managed side.
     _applicationIdentity = appIdentity;
     SetupDomainSecurityForHomogeneousDomain(appTrust, false);
 }
開發者ID:Rayislandstyle,項目名稱:dotnet-coreclr,代碼行數:8,代碼來源:AppDomain.cs

示例13: ApplicationTrust

 public ApplicationTrust(ApplicationIdentity applicationIdentity)
 {
 }
開發者ID:asvishnyakov,項目名稱:CodeContracts,代碼行數:3,代碼來源:System.Security.Policy.ApplicationTrust.cs

示例14: GetInternalAppId

		public static object GetInternalAppId (ApplicationIdentity id)
		{
			throw new NotImplementedException ();
		}
開發者ID:runefs,項目名稱:Marvin,代碼行數:4,代碼來源:InternalApplicationIdentityHelper.cs

示例15: CreateFromNameAndManifests

        private void CreateFromNameAndManifests (ApplicationIdentity applicationIdentity, string[] manifestPaths)
        {
            if (applicationIdentity == null) 
                throw new ArgumentNullException("applicationIdentity");
            if (manifestPaths == null) 
                throw new ArgumentNullException("manifestPaths"); 
            Contract.EndContractBlock();
 
            _applicationIdentity = applicationIdentity;

            // ISSUE - need validation on manifestPaths
 
            IEnumDefinitionIdentity idenum = _applicationIdentity.Identity.EnumAppPath();
 
            _manifests = new ArrayList(DefaultComponentCount); 
            _manifestPaths = new String[manifestPaths.Length];
 
            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1];
            int i=0;
            while (idenum.Next(1, asbId) == 1)
            { 
                ICMS cms = (ICMS) IsolationInterop.ParseManifest(manifestPaths[i], null, ref IsolationInterop.IID_ICMS);
 
                if (IsolationInterop.IdentityAuthority.AreDefinitionsEqual(0, cms.Identity, asbId[0])) 
                {
                    _manifests.Add(cms); 
                    _manifestPaths[i]=manifestPaths[i];
                }
                else
                { 
#if ISOLATION_IN_MSCORLIB
                    throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppIdMismatch")); 
#else 
                    throw new ArgumentException("Application Identity does not match identity in manifests");
#endif 
                }
                i++;
            }
            if (i!=manifestPaths.Length) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppId")); 
#else
                throw new ArgumentException("Application Identity does not have same number of components as manifest paths"); 
#endif
            }
            _manifests.TrimToSize();
            if (_manifests.Count <= 1) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId")); 
#else
                throw new ArgumentException("Invalid identity: no deployment/app identity specified"); 
#endif
            }

            _definitionIdentities = null; 
            _actContext = null;
            _form = ContextForm.Loose; 
            _appRunState = ApplicationStateDisposition.Undefined; 

#if ISOLATION_IN_MSCORLIB 
            Contract.Assert(_manifests.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey");
#endif
        }
開發者ID:sjyanxin,項目名稱:WPFSource,代碼行數:65,代碼來源:activationcontext.cs


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