Files
2026-06-04 11:42:34 +02:00

94 lines
4.4 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace System.Security.Policy
{
/// <summary>Represents a membership condition that matches all code. This class cannot be inherited.</summary>
// Token: 0x02000579 RID: 1401
[ComVisible(true)]
[Serializable]
public sealed class AllMembershipCondition : IConstantMembershipCondition, IMembershipCondition, ISecurityEncodable, ISecurityPolicyEncodable
{
/// <summary>Determines whether the specified evidence satisfies the membership condition.</summary>
/// <returns>Always true.</returns>
/// <param name="evidence">The evidence set against which to make the test. </param>
// Token: 0x06003333 RID: 13107 RVA: 0x000B0354 File Offset: 0x000AE554
public bool Check(Evidence evidence)
{
return true;
}
/// <summary>Creates an equivalent copy of the membership condition.</summary>
/// <returns>A new, identical copy of the current membership condition.</returns>
// Token: 0x06003334 RID: 13108 RVA: 0x000B0358 File Offset: 0x000AE558
public IMembershipCondition Copy()
{
return new AllMembershipCondition();
}
/// <summary>Determines whether the specified membership condition is an <see cref="T:System.Security.Policy.AllMembershipCondition" />.</summary>
/// <returns>true if the specified membership condition is an <see cref="T:System.Security.Policy.AllMembershipCondition" />; otherwise, false.</returns>
/// <param name="o">The object to compare to <see cref="T:System.Security.Policy.AllMembershipCondition" />. </param>
// Token: 0x06003335 RID: 13109 RVA: 0x000B0360 File Offset: 0x000AE560
public override bool Equals(object o)
{
return o is AllMembershipCondition;
}
/// <summary>Reconstructs a security object with a specified state from an XML encoding.</summary>
/// <param name="e">The XML encoding to use to reconstruct the security object. </param>
// Token: 0x06003336 RID: 13110 RVA: 0x000B036C File Offset: 0x000AE56C
public void FromXml(SecurityElement e)
{
this.FromXml(e, null);
}
/// <summary>Reconstructs a security object with a specified state from an XML encoding.</summary>
/// <param name="e">The XML encoding to use to reconstruct the security object. </param>
/// <param name="level">The policy level context used to resolve named permission set references. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="e" /> parameter is null. </exception>
/// <exception cref="T:System.ArgumentException">The <paramref name="e" /> parameter is not a valid membership condition element. </exception>
// Token: 0x06003337 RID: 13111 RVA: 0x000B0378 File Offset: 0x000AE578
public void FromXml(SecurityElement e, PolicyLevel level)
{
MembershipConditionHelper.CheckSecurityElement(e, "e", this.version, this.version);
}
/// <summary>Gets the hash code for the current membership condition.</summary>
/// <returns>The hash code for the current membership condition.</returns>
// Token: 0x06003338 RID: 13112 RVA: 0x000B0394 File Offset: 0x000AE594
public override int GetHashCode()
{
return typeof(AllMembershipCondition).GetHashCode();
}
/// <summary>Creates and returns a string representation of the membership condition.</summary>
/// <returns>A representation of the membership condition.</returns>
// Token: 0x06003339 RID: 13113 RVA: 0x000B03A8 File Offset: 0x000AE5A8
public override string ToString()
{
return "All code";
}
/// <summary>Creates an XML encoding of the security object and its current state.</summary>
/// <returns>An XML encoding of the security object, including any state information.</returns>
// Token: 0x0600333A RID: 13114 RVA: 0x000B03B0 File Offset: 0x000AE5B0
public SecurityElement ToXml()
{
return this.ToXml(null);
}
/// <summary>Creates an XML encoding of the security object and its current state with the specified <see cref="T:System.Security.Policy.PolicyLevel" />.</summary>
/// <returns>An XML encoding of the security object, including any state information.</returns>
/// <param name="level">The policy level context for resolving named permission set references. </param>
// Token: 0x0600333B RID: 13115 RVA: 0x000B03BC File Offset: 0x000AE5BC
public SecurityElement ToXml(PolicyLevel level)
{
return MembershipConditionHelper.Element(typeof(AllMembershipCondition), this.version);
}
// Token: 0x04001501 RID: 5377
private readonly int version = 1;
}
}