示例#1
0
 internal DefinitionAppId(System.Deployment.Internal.Isolation.IDefinitionAppId id)
 {
     if (id == null)
     {
         throw new ArgumentNullException();
     }
     _id = id;
 }
 public DefinitionAppId(string codebase, params System.Deployment.Application.DefinitionIdentity[] idPath)
 {
     uint length = (uint) idPath.Length;
     System.Deployment.Internal.Isolation.IDefinitionIdentity[] definitionIdentity = new System.Deployment.Internal.Isolation.IDefinitionIdentity[length];
     for (uint i = 0; i < length; i++)
     {
         definitionIdentity[i] = idPath[i].ComPointer;
     }
     this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.CreateDefinition();
     this._idComPtr.put_Codebase(codebase);
     this._idComPtr.SetAppPath(length, definitionIdentity);
 }
        public DefinitionAppId(string codebase, params System.Deployment.Application.DefinitionIdentity[] idPath)
        {
            uint length = (uint)idPath.Length;

            System.Deployment.Internal.Isolation.IDefinitionIdentity[] definitionIdentity = new System.Deployment.Internal.Isolation.IDefinitionIdentity[length];
            for (uint i = 0; i < length; i++)
            {
                definitionIdentity[i] = idPath[i].ComPointer;
            }
            this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.CreateDefinition();
            this._idComPtr.put_Codebase(codebase);
            this._idComPtr.SetAppPath(length, definitionIdentity);
        }
        private static bool SearchPreviousTrustedVersion(ActivationContext activationContext, ApplicationIdentity previousAppId, out ArrayList matchingTrusts)
        {
            matchingTrusts = null;
            ApplicationTrustCollection userApplicationTrusts = ApplicationSecurityManager.UserApplicationTrusts;
            ApplicationTrustEnumerator enumerator            = userApplicationTrusts.GetEnumerator();

            while (enumerator.MoveNext())
            {
                ApplicationTrust current = enumerator.Current;
                System.Deployment.Internal.Isolation.IDefinitionAppId id  = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, current.ApplicationIdentity.FullName);
                System.Deployment.Internal.Isolation.IDefinitionAppId id2 = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, activationContext.Identity.FullName);
                if (System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.AreDefinitionsEqual(1, id, id2))
                {
                    if (matchingTrusts == null)
                    {
                        matchingTrusts = new ArrayList();
                    }
                    matchingTrusts.Add(current);
                }
            }
            if (previousAppId != null)
            {
                ApplicationTrustEnumerator enumerator2 = userApplicationTrusts.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    ApplicationTrust trust2 = enumerator2.Current;
                    System.Deployment.Internal.Isolation.IDefinitionAppId id3 = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, trust2.ApplicationIdentity.FullName);
                    System.Deployment.Internal.Isolation.IDefinitionAppId id4 = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, previousAppId.FullName);
                    if (System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.AreDefinitionsEqual(1, id3, id4))
                    {
                        if (matchingTrusts == null)
                        {
                            matchingTrusts = new ArrayList();
                        }
                        matchingTrusts.Add(trust2);
                    }
                }
            }
            return(matchingTrusts != null);
        }
 public DefinitionAppId(string text)
 {
     this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, text);
 }
 public DefinitionAppId(System.Deployment.Internal.Isolation.IDefinitionAppId idComPtr)
 {
     this._idComPtr = idComPtr;
 }
 public DefinitionAppId()
 {
     this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.CreateDefinition();
 }
 public DefinitionAppId(string text)
 {
     this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.TextToDefinition(0, text);
 }
 public DefinitionAppId(System.Deployment.Internal.Isolation.IDefinitionAppId idComPtr)
 {
     this._idComPtr = idComPtr;
 }
 public DefinitionAppId()
 {
     this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.AppIdAuthority.CreateDefinition();
 }
 private static System.Deployment.Internal.Isolation.IDefinitionAppId[] DeployAppIdsToComPtrs(ArrayList deployAppIdList)
 {
     System.Deployment.Internal.Isolation.IDefinitionAppId[] idArray = new System.Deployment.Internal.Isolation.IDefinitionAppId[deployAppIdList.Count];
     for (int i = 0; i < deployAppIdList.Count; i++)
     {
         idArray[i] = ((System.Deployment.Application.DefinitionAppId) deployAppIdList[i]).ComPointer;
     }
     return idArray;
 }