79 lines
5.8 KiB
C#
79 lines
5.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Security.Principal
|
|
{
|
|
/// <summary>Represents an identity and is the base class for the <see cref="T:System.Security.Principal.NTAccount" /> and <see cref="T:System.Security.Principal.SecurityIdentifier" /> classes. This class does not provide a public constructor, and therefore cannot be inherited.</summary>
|
|
// Token: 0x020005AE RID: 1454
|
|
[ComVisible(false)]
|
|
public abstract class IdentityReference
|
|
{
|
|
// Token: 0x06003527 RID: 13607 RVA: 0x000B6F44 File Offset: 0x000B5144
|
|
internal IdentityReference()
|
|
{
|
|
}
|
|
|
|
/// <summary>Gets the string value of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</summary>
|
|
/// <returns>The string value of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</returns>
|
|
// Token: 0x17000A6F RID: 2671
|
|
// (get) Token: 0x06003528 RID: 13608
|
|
public abstract string Value { get; }
|
|
|
|
/// <summary>Returns a value that indicates whether the specified object equals this instance of the <see cref="T:System.Security.Principal.IdentityReference" /> class.</summary>
|
|
/// <returns>true if <paramref name="o" /> is an object with the same underlying type and value as this <see cref="T:System.Security.Principal.IdentityReference" /> instance; otherwise, false.</returns>
|
|
/// <param name="o">An object to compare with this <see cref="T:System.Security.Principal.IdentityReference" /> instance, or a null reference.</param>
|
|
// Token: 0x06003529 RID: 13609
|
|
public abstract override bool Equals(object o);
|
|
|
|
/// <summary>Serves as a hash function for <see cref="T:System.Security.Principal.IdentityReference" />. <see cref="M:System.Security.Principal.IdentityReference.GetHashCode" /> is suitable for use in hashing algorithms and data structures like a hash table.</summary>
|
|
/// <returns>The hash code for this <see cref="T:System.Security.Principal.IdentityReference" /> object.</returns>
|
|
// Token: 0x0600352A RID: 13610
|
|
public abstract override int GetHashCode();
|
|
|
|
/// <summary>Returns a value that indicates whether the specified type is a valid translation type for the <see cref="T:System.Security.Principal.IdentityReference" /> class.</summary>
|
|
/// <returns>true if <paramref name="targetType" /> is a valid translation type for the <see cref="T:System.Security.Principal.IdentityReference" /> class; otherwise, false.</returns>
|
|
/// <param name="targetType">The type being queried for validity to serve as a conversion from <see cref="T:System.Security.Principal.IdentityReference" />. The following target types are valid:<see cref="T:System.Security.Principal.NTAccount" /><see cref="T:System.Security.Principal.SecurityIdentifier" /></param>
|
|
// Token: 0x0600352B RID: 13611
|
|
public abstract bool IsValidTargetType(Type targetType);
|
|
|
|
/// <summary>Returns the string representation of the identity represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object.</summary>
|
|
/// <returns>The identity in string format.</returns>
|
|
// Token: 0x0600352C RID: 13612
|
|
public abstract override string ToString();
|
|
|
|
/// <summary>Translates the account name represented by the <see cref="T:System.Security.Principal.IdentityReference" /> object into another <see cref="T:System.Security.Principal.IdentityReference" />-derived type.</summary>
|
|
/// <returns>The converted identity.</returns>
|
|
/// <param name="targetType">The target type for the conversion from <see cref="T:System.Security.Principal.IdentityReference" />. </param>
|
|
// Token: 0x0600352D RID: 13613
|
|
public abstract IdentityReference Translate(Type targetType);
|
|
|
|
/// <summary>Compares two <see cref="T:System.Security.Principal.IdentityReference" /> objects to determine whether they are equal. They are considered equal if they have the same canonical name representation as the one returned by the <see cref="P:System.Security.Principal.IdentityReference.Value" /> property or if they are both null.</summary>
|
|
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are equal; otherwise, false.</returns>
|
|
/// <param name="left">The left <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the equality comparison. This parameter can be null.</param>
|
|
/// <param name="right">The right <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the equality comparison. This parameter can be null.</param>
|
|
// Token: 0x0600352E RID: 13614 RVA: 0x000B6F4C File Offset: 0x000B514C
|
|
public static bool operator ==(IdentityReference left, IdentityReference right)
|
|
{
|
|
if (left == null)
|
|
{
|
|
return right == null;
|
|
}
|
|
return right != null && left.Value == right.Value;
|
|
}
|
|
|
|
/// <summary>Compares two <see cref="T:System.Security.Principal.IdentityReference" /> objects to determine whether they are not equal. They are considered not equal if they have different canonical name representations than the one returned by the <see cref="P:System.Security.Principal.IdentityReference.Value" /> property or if one of the objects is null and the other is not.</summary>
|
|
/// <returns>true if <paramref name="left" /> and <paramref name="right" /> are not equal; otherwise, false.</returns>
|
|
/// <param name="left">The left <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the inequality comparison. This parameter can be null.</param>
|
|
/// <param name="right">The right <see cref="T:System.Security.Principal.IdentityReference" /> operand to use for the inequality comparison. This parameter can be null.</param>
|
|
// Token: 0x0600352F RID: 13615 RVA: 0x000B6F80 File Offset: 0x000B5180
|
|
public static bool operator !=(IdentityReference left, IdentityReference right)
|
|
{
|
|
if (left == null)
|
|
{
|
|
return right != null;
|
|
}
|
|
return right == null || left.Value != right.Value;
|
|
}
|
|
}
|
|
}
|