mscorlib(4.0.0.0) API with additions
EditorAttribute.cs
2 
3 namespace System.ComponentModel
4 {
6  [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
7  public sealed class EditorAttribute : Attribute
8  {
9  private string baseTypeName;
10 
11  private string typeName;
12 
13  private string typeId;
14 
17  public string EditorBaseTypeName => baseTypeName;
18 
21  public string EditorTypeName => typeName;
22 
25  public override object TypeId
26  {
27  get
28  {
29  if (typeId == null)
30  {
31  string text = baseTypeName;
32  int num = text.IndexOf(',');
33  if (num != -1)
34  {
35  text = text.Substring(0, num);
36  }
37  typeId = GetType().FullName + text;
38  }
39  return typeId;
40  }
41  }
42 
44  public EditorAttribute()
45  {
46  typeName = string.Empty;
47  baseTypeName = string.Empty;
48  }
49 
53  public EditorAttribute(string typeName, string baseTypeName)
54  {
55  string text = typeName.ToUpper(CultureInfo.InvariantCulture);
56  this.typeName = typeName;
57  this.baseTypeName = baseTypeName;
58  }
59 
63  public EditorAttribute(string typeName, Type baseType)
64  {
65  string text = typeName.ToUpper(CultureInfo.InvariantCulture);
66  this.typeName = typeName;
67  baseTypeName = baseType.AssemblyQualifiedName;
68  }
69 
73  public EditorAttribute(Type type, Type baseType)
74  {
75  typeName = type.AssemblyQualifiedName;
76  baseTypeName = baseType.AssemblyQualifiedName;
77  }
78 
83  public override bool Equals(object obj)
84  {
85  if (obj == this)
86  {
87  return true;
88  }
89  EditorAttribute editorAttribute = obj as EditorAttribute;
90  if (editorAttribute != null && editorAttribute.typeName == typeName)
91  {
92  return editorAttribute.baseTypeName == baseTypeName;
93  }
94  return false;
95  }
96 
99  public override int GetHashCode()
100  {
101  return base.GetHashCode();
102  }
103  }
104 }
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
override int GetHashCode()
Returns the hash code for this instance.
Represents the base class for custom attributes.
Definition: Attribute.cs:15
abstract string AssemblyQualifiedName
Gets the assembly-qualified name of the type, which includes the name of the assembly from which this...
Definition: Type.cs:171
Definition: __Canon.cs:3
EditorAttribute(string typeName, Type baseType)
Initializes a new instance of the T:System.ComponentModel.EditorAttribute class with the type name an...
string EditorTypeName
Gets the name of the editor class in the P:System.Type.AssemblyQualifiedName format.
override object TypeId
Gets a unique ID for this attribute type.
string EditorBaseTypeName
Gets the name of the base class or interface serving as a lookup key for this editor.
Specifies the editor to use to change a property. This class cannot be inherited.
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
EditorAttribute(Type type, Type baseType)
Initializes a new instance of the T:System.ComponentModel.EditorAttribute class with the type and the...
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
EditorAttribute(string typeName, string baseTypeName)
Initializes a new instance of the T:System.ComponentModel.EditorAttribute class with the type name an...
override bool Equals(object obj)
Returns whether the value of the given object is equal to the current T:System.ComponentModel....
EditorAttribute()
Initializes a new instance of the T:System.ComponentModel.EditorAttribute class with the default edit...
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16