private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
		{
			StoreOperationMetadataProperty[] setProperties = new StoreOperationMetadataProperty[]
			{
				new StoreOperationMetadataProperty(ApplicationTrustCollection.ClrPropertySet, "ApplicationTrust", trustXml)
			};
			IEnumDefinitionIdentity enumDefinitionIdentity = applicationIdentity.Identity.EnumAppPath();
			IDefinitionIdentity[] array = new IDefinitionIdentity[1];
			IDefinitionIdentity definitionIdentity = null;
			if (enumDefinitionIdentity.Next(1U, array) == 1U)
			{
				definitionIdentity = array[0];
			}
			IDefinitionAppId definitionAppId = IsolationInterop.AppIdAuthority.CreateDefinition();
			definitionAppId.SetAppPath(1U, new IDefinitionIdentity[]
			{
				definitionIdentity
			});
			definitionAppId.put_Codebase(applicationIdentity.CodeBase);
			using (StoreTransaction storeTransaction = new StoreTransaction())
			{
				storeTransaction.Add(new StoreOperationSetDeploymentMetadata(definitionAppId, ApplicationTrustCollection.InstallReference, setProperties));
				this.RefreshStorePointer();
				this.m_pStore.Transact(storeTransaction.Operations);
			}
			this.m_appTrusts = null;
		}
Exemplo n.º 2
0
        [System.Security.SecurityCritical]  // auto-generated
        private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
        {
            StoreOperationMetadataProperty[] properties = new StoreOperationMetadataProperty[] {
                new StoreOperationMetadataProperty(ClrPropertySet, ApplicationTrustProperty, trustXml)
            };

            IEnumDefinitionIdentity idenum = applicationIdentity.Identity.EnumAppPath();

            IDefinitionIdentity[] asbId  = new IDefinitionIdentity[1];
            IDefinitionIdentity   deplId = null;

            if (idenum.Next(1, asbId) == 1)
            {
                deplId = asbId[0];
            }

            IDefinitionAppId defAppId = IsolationInterop.AppIdAuthority.CreateDefinition();

            defAppId.SetAppPath(1, new IDefinitionIdentity[] { deplId });
            defAppId.put_Codebase(applicationIdentity.CodeBase);

            using (StoreTransaction storeTxn = new StoreTransaction()) {
                storeTxn.Add(new StoreOperationSetDeploymentMetadata(defAppId, InstallReference, properties));
                RefreshStorePointer();
                m_pStore.Transact(storeTxn.Operations);
            }

            m_appTrusts = null; // reset the app trusts in the collection.
        }
Exemplo n.º 3
0
        private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
        {
            StoreOperationMetadataProperty[] SetProperties = new StoreOperationMetadataProperty[1] {
                new StoreOperationMetadataProperty(ApplicationTrustCollection.ClrPropertySet, "ApplicationTrust", trustXml)
            };
            IEnumDefinitionIdentity definitionIdentity1 = applicationIdentity.Identity.EnumAppPath();

            IDefinitionIdentity[] definitionIdentityArray = new IDefinitionIdentity[1];
            IDefinitionIdentity   definitionIdentity2     = (IDefinitionIdentity)null;
            int num = 1;

            IDefinitionIdentity[] DefinitionIdentity = definitionIdentityArray;
            if ((int)definitionIdentity1.Next((uint)num, DefinitionIdentity) == 1)
            {
                definitionIdentity2 = definitionIdentityArray[0];
            }
            IDefinitionAppId definition = IsolationInterop.AppIdAuthority.CreateDefinition();

            definition.SetAppPath(1U, new IDefinitionIdentity[1]
            {
                definitionIdentity2
            });
            definition.put_Codebase(applicationIdentity.CodeBase);
            using (StoreTransaction storeTransaction = new StoreTransaction())
            {
                storeTransaction.Add(new StoreOperationSetDeploymentMetadata(definition, ApplicationTrustCollection.InstallReference, SetProperties));
                this.RefreshStorePointer();
                this.m_pStore.Transact(storeTransaction.Operations);
            }
            this.m_appTrusts = (object)null;
        }
Exemplo n.º 4
0
        private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
        {
            StoreOperationMetadataProperty[] setProperties = new StoreOperationMetadataProperty[] { new StoreOperationMetadataProperty(ClrPropertySet, "ApplicationTrust", trustXml) };
            IEnumDefinitionIdentity          identity      = applicationIdentity.Identity.EnumAppPath();

            IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
            IDefinitionIdentity   identity2          = null;

            if (identity.Next(1, definitionIdentity) == 1)
            {
                identity2 = definitionIdentity[0];
            }
            IDefinitionAppId deployment = IsolationInterop.AppIdAuthority.CreateDefinition();

            deployment.SetAppPath(1, new IDefinitionIdentity[] { identity2 });
            deployment.put_Codebase(applicationIdentity.CodeBase);
            using (StoreTransaction transaction = new StoreTransaction())
            {
                transaction.Add(new StoreOperationSetDeploymentMetadata(deployment, InstallReference, setProperties));
                this.RefreshStorePointer();
                this.m_pStore.Transact(transaction.Operations);
            }
            this.m_appTrusts = null;
        }
Exemplo n.º 5
0
 public void OnCompleted(StoreTransaction storeTransaction, CustomerInfo customerInfo)
 {
     ReportSuccess(new PurchaseSuccessInfo(storeTransaction, customerInfo));
 }
Exemplo n.º 6
0
 public PurchaseSuccessInfo(StoreTransaction storeTransaction, CustomerInfo customerInfo)
 {
     StoreTransaction = storeTransaction;
     CustomerInfo     = customerInfo;
 }