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

69 lines
3.0 KiB
C#

using System;
namespace System.ComponentModel
{
/// <summary>Specifies whether a property can only be set at design time.</summary>
// Token: 0x02000070 RID: 112
[AttributeUsage(AttributeTargets.All)]
public sealed class DesignOnlyAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.DesignOnlyAttribute" /> class.</summary>
/// <param name="isDesignOnly">true if a property can be set only at design time; false if the property can be set at design time and at run time. </param>
// Token: 0x06000417 RID: 1047 RVA: 0x0000C448 File Offset: 0x0000A648
public DesignOnlyAttribute(bool design_only)
{
this.design_only = design_only;
}
/// <summary>Gets a value indicating whether a property can be set only at design time.</summary>
/// <returns>true if a property can be set only at design time; otherwise, false.</returns>
// Token: 0x17000115 RID: 277
// (get) Token: 0x06000419 RID: 1049 RVA: 0x0000C47C File Offset: 0x0000A67C
public bool IsDesignOnly
{
get
{
return this.design_only;
}
}
/// <summary>Returns whether the value of the given object is equal to the current <see cref="T:System.ComponentModel.DesignOnlyAttribute" />.</summary>
/// <returns>true if the value of the given object is equal to that of the current; otherwise, false.</returns>
/// <param name="obj">The object to test the value equality of. </param>
// Token: 0x0600041A RID: 1050 RVA: 0x0000C484 File Offset: 0x0000A684
public override bool Equals(object obj)
{
return obj is DesignOnlyAttribute && (obj == this || ((DesignOnlyAttribute)obj).IsDesignOnly == this.design_only);
}
// Token: 0x0600041B RID: 1051 RVA: 0x0000C4B0 File Offset: 0x0000A6B0
public override int GetHashCode()
{
return this.design_only.GetHashCode();
}
/// <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: 0x0600041C RID: 1052 RVA: 0x0000C4C0 File Offset: 0x0000A6C0
public override bool IsDefaultAttribute()
{
return this.design_only == DesignOnlyAttribute.Default.IsDesignOnly;
}
// Token: 0x0400014E RID: 334
private bool design_only;
/// <summary>Specifies the default value for the <see cref="T:System.ComponentModel.DesignOnlyAttribute" />, which is <see cref="F:System.ComponentModel.DesignOnlyAttribute.No" />. This static field is read-only.</summary>
// Token: 0x0400014F RID: 335
public static readonly DesignOnlyAttribute Default = new DesignOnlyAttribute(false);
/// <summary>Specifies that a property can be set at design time or at run time. This static field is read-only.</summary>
// Token: 0x04000150 RID: 336
public static readonly DesignOnlyAttribute No = new DesignOnlyAttribute(false);
/// <summary>Specifies that a property can be set only at design time. This static field is read-only.</summary>
// Token: 0x04000151 RID: 337
public static readonly DesignOnlyAttribute Yes = new DesignOnlyAttribute(true);
}
}