71 lines
3.3 KiB
C#
71 lines
3.3 KiB
C#
using System;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
/// <summary>Specifies whether the property this attribute is bound to is read-only or read/write. This class cannot be inherited</summary>
|
|
// Token: 0x020000B7 RID: 183
|
|
[AttributeUsage(AttributeTargets.All)]
|
|
public sealed class ReadOnlyAttribute : Attribute
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ReadOnlyAttribute" /> class.</summary>
|
|
/// <param name="isReadOnly">true to show that the property this attribute is bound to is read-only; false to show that the property is read/write. </param>
|
|
// Token: 0x06000624 RID: 1572 RVA: 0x0000FC1C File Offset: 0x0000DE1C
|
|
public ReadOnlyAttribute(bool read_only)
|
|
{
|
|
this.read_only = read_only;
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the property this attribute is bound to is read-only.</summary>
|
|
/// <returns>true if the property this attribute is bound to is read-only; false if the property is read/write.</returns>
|
|
// Token: 0x1700019B RID: 411
|
|
// (get) Token: 0x06000626 RID: 1574 RVA: 0x0000FC50 File Offset: 0x0000DE50
|
|
public bool IsReadOnly
|
|
{
|
|
get
|
|
{
|
|
return this.read_only;
|
|
}
|
|
}
|
|
|
|
/// <summary>Returns the hash code for this instance.</summary>
|
|
/// <returns>A hash code for the current <see cref="T:System.ComponentModel.ReadOnlyAttribute" />.</returns>
|
|
// Token: 0x06000627 RID: 1575 RVA: 0x0000FC58 File Offset: 0x0000DE58
|
|
public override int GetHashCode()
|
|
{
|
|
return this.read_only.GetHashCode();
|
|
}
|
|
|
|
/// <summary>Indicates whether this instance and a specified object are equal.</summary>
|
|
/// <returns>true if <paramref name="value" /> is equal to this instance; otherwise, false.</returns>
|
|
/// <param name="value">Another object to compare to. </param>
|
|
// Token: 0x06000628 RID: 1576 RVA: 0x0000FC68 File Offset: 0x0000DE68
|
|
public override bool Equals(object o)
|
|
{
|
|
return o is ReadOnlyAttribute && ((ReadOnlyAttribute)o).IsReadOnly.Equals(this.read_only);
|
|
}
|
|
|
|
/// <summary>Determines if this attribute is the default.</summary>
|
|
/// <returns>true if the attribute is the default value for this attribute class; otherwise, false.</returns>
|
|
// Token: 0x06000629 RID: 1577 RVA: 0x0000FC9C File Offset: 0x0000DE9C
|
|
public override bool IsDefaultAttribute()
|
|
{
|
|
return this.Equals(ReadOnlyAttribute.Default);
|
|
}
|
|
|
|
// Token: 0x040001C3 RID: 451
|
|
private bool read_only;
|
|
|
|
/// <summary>Specifies that the property this attribute is bound to is read/write and can be modified. This static field is read-only.</summary>
|
|
// Token: 0x040001C4 RID: 452
|
|
public static readonly ReadOnlyAttribute No = new ReadOnlyAttribute(false);
|
|
|
|
/// <summary>Specifies that the property this attribute is bound to is read-only and cannot be modified in the server explorer. This static field is read-only.</summary>
|
|
// Token: 0x040001C5 RID: 453
|
|
public static readonly ReadOnlyAttribute Yes = new ReadOnlyAttribute(true);
|
|
|
|
/// <summary>Specifies the default value for the <see cref="T:System.ComponentModel.ReadOnlyAttribute" />, which is <see cref="F:System.ComponentModel.ReadOnlyAttribute.No" /> (that is, the property this attribute is bound to is read/write). This static field is read-only.</summary>
|
|
// Token: 0x040001C6 RID: 454
|
|
public static readonly ReadOnlyAttribute Default = new ReadOnlyAttribute(false);
|
|
}
|
|
}
|