70 lines
3.0 KiB
C#
70 lines
3.0 KiB
C#
using System;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
/// <summary>Specifies that an object has no subproperties capable of being edited. This class cannot be inherited.</summary>
|
|
// Token: 0x02000096 RID: 150
|
|
[AttributeUsage(AttributeTargets.All)]
|
|
public sealed class ImmutableObjectAttribute : Attribute
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ImmutableObjectAttribute" /> class.</summary>
|
|
/// <param name="immutable">true if the object is immutable; otherwise, false. </param>
|
|
// Token: 0x06000508 RID: 1288 RVA: 0x0000D96C File Offset: 0x0000BB6C
|
|
public ImmutableObjectAttribute(bool immutable)
|
|
{
|
|
this.immutable = immutable;
|
|
}
|
|
|
|
/// <summary>Gets whether the object is immutable.</summary>
|
|
/// <returns>true if the object is immutable; otherwise, false.</returns>
|
|
// Token: 0x17000154 RID: 340
|
|
// (get) Token: 0x0600050A RID: 1290 RVA: 0x0000D9A0 File Offset: 0x0000BBA0
|
|
public bool Immutable
|
|
{
|
|
get
|
|
{
|
|
return this.immutable;
|
|
}
|
|
}
|
|
|
|
/// <returns>true if <paramref name="obj" /> equals the type and value of this instance; otherwise, false.</returns>
|
|
/// <param name="obj">An <see cref="T:System.Object" /> to compare with this instance or null. </param>
|
|
// Token: 0x0600050B RID: 1291 RVA: 0x0000D9A8 File Offset: 0x0000BBA8
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is ImmutableObjectAttribute && (obj == this || ((ImmutableObjectAttribute)obj).Immutable == this.immutable);
|
|
}
|
|
|
|
/// <summary>Returns the hash code for this instance.</summary>
|
|
/// <returns>A hash code for the current <see cref="T:System.ComponentModel.ImmutableObjectAttribute" />.</returns>
|
|
// Token: 0x0600050C RID: 1292 RVA: 0x0000D9D4 File Offset: 0x0000BBD4
|
|
public override int GetHashCode()
|
|
{
|
|
return this.immutable.GetHashCode();
|
|
}
|
|
|
|
/// <summary>Indicates whether the value of this instance is the default value.</summary>
|
|
/// <returns>true if this instance is the default attribute for the class; otherwise, false.</returns>
|
|
// Token: 0x0600050D RID: 1293 RVA: 0x0000D9E4 File Offset: 0x0000BBE4
|
|
public override bool IsDefaultAttribute()
|
|
{
|
|
return this.immutable == ImmutableObjectAttribute.Default.Immutable;
|
|
}
|
|
|
|
// Token: 0x0400017C RID: 380
|
|
private bool immutable;
|
|
|
|
/// <summary>Represents the default value for <see cref="T:System.ComponentModel.ImmutableObjectAttribute" />.</summary>
|
|
// Token: 0x0400017D RID: 381
|
|
public static readonly ImmutableObjectAttribute Default = new ImmutableObjectAttribute(false);
|
|
|
|
/// <summary>Specifies that an object has at least one editable subproperty. This static field is read-only.</summary>
|
|
// Token: 0x0400017E RID: 382
|
|
public static readonly ImmutableObjectAttribute No = new ImmutableObjectAttribute(false);
|
|
|
|
/// <summary>Specifies that an object has no subproperties that can be edited. This static field is read-only.</summary>
|
|
// Token: 0x0400017F RID: 383
|
|
public static readonly ImmutableObjectAttribute Yes = new ImmutableObjectAttribute(true);
|
|
}
|
|
}
|