mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
* MemberDescriptor.cs: implemented Attributes and Category. * PropertyDescriptor.cs: implemented Converter. Declared GetValue (). * PropertyDescriptorCollection.cs: fixed indexers declaration. * ReadOnlyAttribute.cs: GetHashCoder (), Equals (), IsDefault () and fixed value for Yes. * ToolboxItemAttribute.cs: fixed declaration of IsDefaultAttribute. * TypeConverter.cs: added SimplePropertyDescriptor class. svn path=/trunk/mcs/; revision=5957
55 lines
1.0 KiB
C#
Executable File
55 lines
1.0 KiB
C#
Executable File
//
|
|
// ReadOnlyAttribute.cs
|
|
//
|
|
// Author:
|
|
// Chris J Breisch ([email protected])
|
|
//
|
|
// (C) 2002 Chris J Breisch
|
|
//
|
|
namespace System.ComponentModel {
|
|
[AttributeUsage (AttributeTargets.All)]
|
|
sealed public class ReadOnlyAttribute : Attribute {
|
|
bool read_only;
|
|
|
|
public static readonly ReadOnlyAttribute No;
|
|
public static readonly ReadOnlyAttribute Yes;
|
|
public static readonly ReadOnlyAttribute Default;
|
|
|
|
static ReadOnlyAttribute ()
|
|
{
|
|
No = new ReadOnlyAttribute (false);
|
|
Yes = new ReadOnlyAttribute (true);
|
|
Default = new ReadOnlyAttribute (false);
|
|
}
|
|
|
|
public ReadOnlyAttribute (bool read_only)
|
|
{
|
|
this.read_only = read_only;
|
|
}
|
|
|
|
public bool IsReadOnly {
|
|
get {
|
|
return read_only;
|
|
}
|
|
}
|
|
|
|
public override int GetHashCode ()
|
|
{
|
|
return base.GetHashCode ();
|
|
}
|
|
|
|
public override bool Equals (object o)
|
|
{
|
|
if (!(o is ReadOnlyAttribute))
|
|
return false;
|
|
|
|
return (((ReadOnlyAttribute) o).read_only == read_only);
|
|
}
|
|
|
|
public override bool IsDefaultAttribute ()
|
|
{
|
|
return Equals (Default);
|
|
}
|
|
}
|
|
}
|