public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
		{
			ApplicationTrustCollection applicationTrustCollection = new ApplicationTrustCollection(false);
			foreach (ApplicationTrust applicationTrust in this)
			{
				if (CmsUtils.CompareIdentities(applicationTrust.ApplicationIdentity, applicationIdentity, versionMatch))
				{
					applicationTrustCollection.Add(applicationTrust);
				}
			}
			return applicationTrustCollection;
		}
Пример #2
0
        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);
        }
 public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
 }
        /// <summary>Gets the application trusts in the collection that match the specified application identity.</summary>
        /// <returns>An <see cref="T:System.Security.Policy.ApplicationTrustCollection" /> containing all matching <see cref="T:System.Security.Policy.ApplicationTrust" /> objects.</returns>
        /// <param name="applicationIdentity">An <see cref="T:System.ApplicationIdentity" /> object describing the application to find.</param>
        /// <param name="versionMatch">One of the <see cref="T:System.Security.Policy.ApplicationVersionMatch" /> values. </param>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
        ///   <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" />
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence, ControlPolicy" />
        /// </PermissionSet>
        public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
        {
            if (applicationIdentity == null)
            {
                throw new ArgumentNullException("applicationIdentity");
            }
            string text = applicationIdentity.FullName;

            if (versionMatch != ApplicationVersionMatch.MatchExactVersion)
            {
                if (versionMatch != ApplicationVersionMatch.MatchAllVersions)
                {
                    throw new ArgumentException("versionMatch");
                }
                int num = text.IndexOf(", Version=");
                if (num >= 0)
                {
                    text = text.Substring(0, num);
                }
            }
            ApplicationTrustCollection applicationTrustCollection = new ApplicationTrustCollection();

            foreach (object obj in this._list)
            {
                ApplicationTrust applicationTrust = (ApplicationTrust)obj;
                if (applicationTrust.ApplicationIdentity.FullName.StartsWith(text))
                {
                    applicationTrustCollection.Add(applicationTrust);
                }
            }
            return(applicationTrustCollection);
        }
        public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
        {
            if (applicationIdentity == null)
            {
                throw new ArgumentNullException("applicationIdentity");
            }

            string fullname = applicationIdentity.FullName;

            switch (versionMatch)
            {
            case ApplicationVersionMatch.MatchAllVersions:
                int pos = fullname.IndexOf(", Version=");
                if (pos >= 0)
                {
                    fullname = fullname.Substring(0, pos);
                }
                break;

            case ApplicationVersionMatch.MatchExactVersion:
                break;

            default:
                throw new ArgumentException("versionMatch");
            }

            ApplicationTrustCollection coll = new ApplicationTrustCollection();

            foreach (ApplicationTrust t in _list)
            {
                if (t.ApplicationIdentity.FullName.StartsWith(fullname))
                {
                    coll.Add(t);
                }
            }

            return(coll);
        }
Пример #6
0
 [System.Security.SecurityCritical]  // auto-generated
 public ApplicationTrustCollection Find (ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch) { 
     ApplicationTrustCollection collection = new ApplicationTrustCollection(false);
     foreach (ApplicationTrust trust in this) { 
         if (CmsUtils.CompareIdentities(trust.ApplicationIdentity, applicationIdentity, versionMatch)) 
             collection.Add(trust);
     } 
     return collection;
 }
Пример #7
0
        [System.Security.SecurityCritical]  // auto-generated
        public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
        {
            ApplicationTrustCollection collection = Find(applicationIdentity, versionMatch);

            RemoveRange(collection);
        }
 public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     return(default(ApplicationTrustCollection));
 }
		public ApplicationTrustCollection Find (ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
		{
			if (applicationIdentity == null)
				throw new ArgumentNullException ("applicationIdentity");

			string fullname = applicationIdentity.FullName;

			switch (versionMatch) {
			case ApplicationVersionMatch.MatchAllVersions:
				int pos = fullname.IndexOf (", Version=");
				if (pos >= 0)
					fullname = fullname.Substring (0, pos);
				break;
			case ApplicationVersionMatch.MatchExactVersion:
				break;
			default:
				throw new ArgumentException ("versionMatch");
			}

			ApplicationTrustCollection coll = new ApplicationTrustCollection ();
			foreach (ApplicationTrust t in _list) {
				if (t.ApplicationIdentity.FullName.StartsWith (fullname)) {
					coll.Add (t);
				}
			}

			return coll;
		}
Пример #10
0
 public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     throw new NotImplementedException();
 }
Пример #11
0
 public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     throw new NotImplementedException();
 }
Пример #12
0
        public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
        {
            ApplicationTrustCollection trusts     = new ApplicationTrustCollection(false);
            ApplicationTrustEnumerator enumerator = this.GetEnumerator();

            while (enumerator.MoveNext())
            {
                ApplicationTrust current = enumerator.Current;
                if (CmsUtils.CompareIdentities(current.ApplicationIdentity, applicationIdentity, versionMatch))
                {
                    trusts.Add(current);
                }
            }
            return(trusts);
        }
Пример #13
0
 public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     this.RemoveRange(this.Find(applicationIdentity, versionMatch));
 }
Пример #14
0
        internal static bool CompareIdentities(ApplicationIdentity applicationIdentity1, ApplicationIdentity applicationIdentity2, ApplicationVersionMatch versionMatch)
        {
            if (applicationIdentity1 == null || applicationIdentity2 == null)
            {
                return(applicationIdentity1 == applicationIdentity2);
            }
            uint flags;

            switch (versionMatch)
            {
            case ApplicationVersionMatch.MatchExactVersion:
                flags = 0;
                break;

            case ApplicationVersionMatch.MatchAllVersions:
                flags = (uint)IAPPIDAUTHORITY_ARE_DEFINITIONS_EQUAL_FLAGS.IAPPIDAUTHORITY_ARE_DEFINITIONS_EQUAL_FLAG_IGNORE_VERSION;
                break;

            default:
                throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)versionMatch), "versionMatch");
            }
            return(IsolationInterop.AppIdAuthority.AreDefinitionsEqual(flags, applicationIdentity1.Identity, applicationIdentity2.Identity));
        }
		public void Remove (ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
		{
			ApplicationTrustCollection coll = Find (applicationIdentity, versionMatch);
			foreach (ApplicationTrust t in coll) {
				RemoveAllInstances (t);
			}
		}
Пример #16
0
 public ApplicationTrustCollection Find(System.ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
 }
 public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     ApplicationTrustCollection trusts = new ApplicationTrustCollection(false);
     ApplicationTrustEnumerator enumerator = this.GetEnumerator();
     while (enumerator.MoveNext())
     {
         ApplicationTrust current = enumerator.Current;
         if (CmsUtils.CompareIdentities(current.ApplicationIdentity, applicationIdentity, versionMatch))
         {
             trusts.Add(current);
         }
     }
     return trusts;
 }
 public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
 }
 public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
 {
     ApplicationTrustCollection trusts = this.Find(applicationIdentity, versionMatch);
     this.RemoveRange(trusts);
 }
Пример #20
0
        internal static bool CompareIdentities(ApplicationIdentity applicationIdentity1, ApplicationIdentity applicationIdentity2, ApplicationVersionMatch versionMatch)
        {
            if (applicationIdentity1 == null || applicationIdentity2 == null)
            {
                return(applicationIdentity1 == applicationIdentity2);
            }
            uint Flags;

            if (versionMatch != ApplicationVersionMatch.MatchExactVersion)
            {
                if (versionMatch == ApplicationVersionMatch.MatchAllVersions)
                {
                    Flags = 1U;
                }
                else
                {
                    throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (object)versionMatch), "versionMatch");
                }
            }
            else
            {
                Flags = 0U;
            }
            return(IsolationInterop.AppIdAuthority.AreDefinitionsEqual(Flags, applicationIdentity1.Identity, applicationIdentity2.Identity));
        }
	public ApplicationTrustCollection Find(System.ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch) {}
Пример #22
0
 [System.Security.SecurityCritical]  // auto-generated 
 public void Remove (ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch) {
     ApplicationTrustCollection collection = Find(applicationIdentity, versionMatch); 
     RemoveRange(collection); 
 }
Пример #23
0
 internal static bool CompareIdentities (ApplicationIdentity applicationIdentity1, ApplicationIdentity applicationIdentity2, ApplicationVersionMatch versionMatch) {
     if (applicationIdentity1 == null || applicationIdentity2 == null)
         return applicationIdentity1 == applicationIdentity2;
     uint flags;
     switch (versionMatch) {
     case ApplicationVersionMatch.MatchExactVersion:
         flags = 0;
         break;
     case ApplicationVersionMatch.MatchAllVersions:
         flags = (uint) IAPPIDAUTHORITY_ARE_DEFINITIONS_EQUAL_FLAGS.IAPPIDAUTHORITY_ARE_DEFINITIONS_EQUAL_FLAG_IGNORE_VERSION;
         break;
     default:
         throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)versionMatch), "versionMatch");
     }
     return IsolationInterop.AppIdAuthority.AreDefinitionsEqual(flags, applicationIdentity1.Identity, applicationIdentity2.Identity);
 }
		public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
		{
			ApplicationTrustCollection trusts = this.Find(applicationIdentity, versionMatch);
			this.RemoveRange(trusts);
		}
    public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
    {
      Contract.Ensures(Contract.Result<System.Security.Policy.ApplicationTrustCollection>() != null);

      return default(ApplicationTrustCollection);
    }
Пример #26
0
        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));
        }
        public ApplicationTrustCollection Find(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
        {
            Contract.Ensures(Contract.Result <System.Security.Policy.ApplicationTrustCollection>() != null);

            return(default(ApplicationTrustCollection));
        }