Class Descriptor
The base descriptor used by many classes in the core.
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Descriptor : IEquatable<Descriptor>, IComparable<Descriptor>
- Inheritance
-
Descriptor
- Implements
- Derived
- Inherited Members
Constructors
Descriptor(string, string)
Creates a new descriptor.
public Descriptor(string displayName, string description)
Parameters
displayNamestringThe name of the instance the descriptor refers to.
descriptionstringThe description of the instance the descriptor refers to.
Properties
Description
The description of instance the descriptor refers to.
public string Description { get; protected set; }
Property Value
DisplayName
The name of the instance the descriptor refers to, with arbitrary casing.
public string DisplayName { get; }
Property Value
Name
The name of the instance the descriptor refers to. This is enforced to be lower-case.
public string Name { get; }
Property Value
Methods
CompareTo(Descriptor)
Compares the current descriptor with another descriptor.
public virtual int CompareTo(Descriptor other)
Parameters
otherDescriptorA descriptor to compare with this descriptor.
Returns
- int
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value Meaning Less than zero This object is less than the otherparameter.Zero This object is equal to other.Greater than zero This object is greater than other.
CreateCaseInsensitiveIdentifier(string)
Creates a case insensitive identifier out of a display name.
public static string CreateCaseInsensitiveIdentifier(string displayName)
Parameters
displayNamestringThe display name.
Returns
- string
A case insensitive identifier for the display name.
Equals(Descriptor)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Descriptor other)
Parameters
otherDescriptorAn object to compare with this object.
Returns
- bool
trueif the current object is equal to theotherparameter; otherwise,false.
Equals(object)
Determines whether the specified object is equal to this instance.
public override bool Equals(object obj)
Parameters
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
ToString()
Creates a string representation.
public override string ToString()
Returns
- string
The displayname.
Operators
operator ==(Descriptor, Descriptor)
Implements the operator ==.
public static bool operator ==(Descriptor d1, Descriptor d2)
Parameters
d1DescriptorDescriptor 1.
d2DescriptorDescriptor 2.
Returns
- bool
Trueif the two Descriptor instances have the same Name, otherwisefalse.
operator !=(Descriptor, Descriptor)
Implements the operator !=.
public static bool operator !=(Descriptor d1, Descriptor d2)
Parameters
d1DescriptorDescriptor 1.
d2DescriptorDescriptor 2.
Returns
- bool
Trueif the two Descriptor instances do not have the same Name, otherwisefalse.