using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace System.Security.Policy
{
/// Represents a collection of objects. This class cannot be inherited.
// Token: 0x0200057F RID: 1407
[ComVisible(true)]
public sealed class ApplicationTrustCollection : IEnumerable, ICollection
{
// Token: 0x0600336C RID: 13164 RVA: 0x000B0C34 File Offset: 0x000AEE34
internal ApplicationTrustCollection()
{
this._list = new ArrayList();
}
/// Copies the elements of the to the specified , starting at the specified index.
/// The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than zero.
///
/// is multidimensional.-or- The number of elements in the source is greater than the available space from to the end of the destination .
// Token: 0x0600336D RID: 13165 RVA: 0x000B0C48 File Offset: 0x000AEE48
void ICollection.CopyTo(Array array, int index)
{
this._list.CopyTo(array, index);
}
/// Returns an enumerator that iterates through the collection.
/// An that can be used to iterate through the collection.
// Token: 0x0600336E RID: 13166 RVA: 0x000B0C58 File Offset: 0x000AEE58
IEnumerator IEnumerable.GetEnumerator()
{
return new ApplicationTrustEnumerator(this);
}
/// Gets the number of items contained in the collection.
/// The number of items contained in the collection.
// Token: 0x17000A1A RID: 2586
// (get) Token: 0x0600336F RID: 13167 RVA: 0x000B0C60 File Offset: 0x000AEE60
public int Count
{
get
{
return this._list.Count;
}
}
/// Gets a value indicating whether access to the collection is synchronized (thread safe).
/// false in all cases.
// Token: 0x17000A1B RID: 2587
// (get) Token: 0x06003370 RID: 13168 RVA: 0x000B0C70 File Offset: 0x000AEE70
public bool IsSynchronized
{
get
{
return false;
}
}
/// Gets an object that can be used to synchronize access to the collection.
/// The object to use to synchronize access to the collection.
// Token: 0x17000A1C RID: 2588
// (get) Token: 0x06003371 RID: 13169 RVA: 0x000B0C74 File Offset: 0x000AEE74
public object SyncRoot
{
get
{
return this;
}
}
/// Gets the object located at the specified index in the collection.
/// The object at the specified index in the collection.
/// The zero-based index of the object within the collection.
///
/// is greater than or equal to the count of objects in the collection.
///
/// is negative.
// Token: 0x17000A1D RID: 2589
public ApplicationTrust this[int index]
{
get
{
return (ApplicationTrust)this._list[index];
}
}
/// Gets the object for the specified application.
/// The object for the specified application, or null if the object cannot be found.
/// The full name of the application.
// Token: 0x17000A1E RID: 2590
public ApplicationTrust this[string appFullName]
{
get
{
for (int i = 0; i < this._list.Count; i++)
{
ApplicationTrust applicationTrust = this._list[i] as ApplicationTrust;
if (applicationTrust.ApplicationIdentity.FullName == appFullName)
{
return applicationTrust;
}
}
return null;
}
}
/// Adds an element to the collection.
/// The index at which the new element was inserted.
/// The object to add.
///
/// is null.
/// The property of the specified in is null.
///
///
///
///
///
// Token: 0x06003374 RID: 13172 RVA: 0x000B0CE0 File Offset: 0x000AEEE0
public int Add(ApplicationTrust trust)
{
if (trust == null)
{
throw new ArgumentNullException("trust");
}
if (trust.ApplicationIdentity == null)
{
throw new ArgumentException(Locale.GetText("ApplicationTrust.ApplicationIdentity can't be null."), "trust");
}
return this._list.Add(trust);
}
/// Copies the elements of the specified array to the end of the collection.
/// An array of type containing the objects to add to the collection.
///
/// is null.
/// The property of an specified in is null.
///
///
///
///
///
// Token: 0x06003375 RID: 13173 RVA: 0x000B0D20 File Offset: 0x000AEF20
public void AddRange(ApplicationTrust[] trusts)
{
if (trusts == null)
{
throw new ArgumentNullException("trusts");
}
foreach (ApplicationTrust applicationTrust in trusts)
{
if (applicationTrust.ApplicationIdentity == null)
{
throw new ArgumentException(Locale.GetText("ApplicationTrust.ApplicationIdentity can't be null."), "trust");
}
this._list.Add(applicationTrust);
}
}
/// Copies the elements of the specified to the end of the collection.
/// A containing the objects to add to the collection.
///
/// is null.
/// The property of an specified in is null.
///
///
///
///
///
// Token: 0x06003376 RID: 13174 RVA: 0x000B0D88 File Offset: 0x000AEF88
public void AddRange(ApplicationTrustCollection trusts)
{
if (trusts == null)
{
throw new ArgumentNullException("trusts");
}
foreach (ApplicationTrust applicationTrust in trusts)
{
if (applicationTrust.ApplicationIdentity == null)
{
throw new ArgumentException(Locale.GetText("ApplicationTrust.ApplicationIdentity can't be null."), "trust");
}
this._list.Add(applicationTrust);
}
}
/// Removes all the application trusts from the collection.
/// The property of an item in the collection is null.
// Token: 0x06003377 RID: 13175 RVA: 0x000B0DF4 File Offset: 0x000AEFF4
public void Clear()
{
this._list.Clear();
}
/// Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.
/// The one-dimensional array of type that is the destination of the elements copied from the current collection.
/// The zero-based index in at which copying begins.
///
/// is null.
///
/// is less than the lower bound of .
///
/// is multidimensional.-or- The number of elements in the is greater than the available space from to the end of the destination .
///
///
///
// Token: 0x06003378 RID: 13176 RVA: 0x000B0E04 File Offset: 0x000AF004
public void CopyTo(ApplicationTrust[] array, int index)
{
this._list.CopyTo(array, index);
}
/// Gets the application trusts in the collection that match the specified application identity.
/// An containing all matching objects.
/// An object describing the application to find.
/// One of the values.
///
///
///
///
///
// Token: 0x06003379 RID: 13177 RVA: 0x000B0E14 File Offset: 0x000AF014
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;
}
/// Returns an object that can be used to iterate over the collection.
/// An that can be used to iterate over the collection.
///
///
///
// Token: 0x0600337A RID: 13178 RVA: 0x000B0F08 File Offset: 0x000AF108
public ApplicationTrustEnumerator GetEnumerator()
{
return new ApplicationTrustEnumerator(this);
}
/// Removes the specified application trust from the collection.
/// The object to remove.
///
/// is null.
/// The property of the object specified by is null.
///
///
///
// Token: 0x0600337B RID: 13179 RVA: 0x000B0F10 File Offset: 0x000AF110
public void Remove(ApplicationTrust trust)
{
if (trust == null)
{
throw new ArgumentNullException("trust");
}
if (trust.ApplicationIdentity == null)
{
throw new ArgumentException(Locale.GetText("ApplicationTrust.ApplicationIdentity can't be null."), "trust");
}
this.RemoveAllInstances(trust);
}
/// Removes all application trust objects that match the specified criteria from the collection.
/// The of the object to be removed.
/// One of the values.
///
///
///
///
///
// Token: 0x0600337C RID: 13180 RVA: 0x000B0F58 File Offset: 0x000AF158
public void Remove(ApplicationIdentity applicationIdentity, ApplicationVersionMatch versionMatch)
{
ApplicationTrustCollection applicationTrustCollection = this.Find(applicationIdentity, versionMatch);
foreach (ApplicationTrust applicationTrust in applicationTrustCollection)
{
this.RemoveAllInstances(applicationTrust);
}
}
/// Removes the application trust objects in the specified array from the collection.
/// A one-dimensional array of type that contains items to be removed from the current collection.
///
/// is null.
///
///
///
// Token: 0x0600337D RID: 13181 RVA: 0x000B0F94 File Offset: 0x000AF194
public void RemoveRange(ApplicationTrust[] trusts)
{
if (trusts == null)
{
throw new ArgumentNullException("trusts");
}
foreach (ApplicationTrust applicationTrust in trusts)
{
this.RemoveAllInstances(applicationTrust);
}
}
/// Removes the application trust objects in the specified collection from the collection.
/// An that contains items to be removed from the currentcollection.
///
/// is null.
///
///
///
// Token: 0x0600337E RID: 13182 RVA: 0x000B0FD4 File Offset: 0x000AF1D4
public void RemoveRange(ApplicationTrustCollection trusts)
{
if (trusts == null)
{
throw new ArgumentNullException("trusts");
}
foreach (ApplicationTrust applicationTrust in trusts)
{
this.RemoveAllInstances(applicationTrust);
}
}
// Token: 0x0600337F RID: 13183 RVA: 0x000B1018 File Offset: 0x000AF218
internal void RemoveAllInstances(ApplicationTrust trust)
{
for (int i = this._list.Count - 1; i >= 0; i--)
{
if (trust.Equals(this._list[i]))
{
this._list.RemoveAt(i);
}
}
}
// Token: 0x04001512 RID: 5394
private ArrayList _list;
}
}