Interface IProperty
Base interface for working with properties.
Namespace: Unity.Properties
Syntax
public interface IProperty
Remarks
This is used to pass or store properties without knowing the underlying container or value type.
Properties
IsReadOnly
Gets a value indicating whether the property is read-only or not.
Declaration
bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Name
Gets the name of the property.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
Methods
DeclaredValueType()
Returns the declared value type of the property.
Declaration
Type DeclaredValueType()
Returns
Type | Description |
---|---|
Type | The declared value type. |
GetAttribute<TAttribute>()
Returns the first attribute of the given type.
Declaration
TAttribute GetAttribute<TAttribute>()
where TAttribute : Attribute
Returns
Type | Description |
---|---|
TAttribute | The attribute of the given type for this property. |
Type Parameters
Name | Description |
---|---|
TAttribute | The attribute type to get. |
GetAttributes()
Returns all attribute for this property.
Declaration
IEnumerable<Attribute> GetAttributes()
Returns
Type | Description |
---|---|
IEnumerable<Attribute> | An |
GetAttributes<TAttribute>()
Returns all attribute of the given type.
Declaration
IEnumerable<TAttribute> GetAttributes<TAttribute>()
where TAttribute : Attribute
Returns
Type | Description |
---|---|
IEnumerable<TAttribute> | An |
Type Parameters
Name | Description |
---|---|
TAttribute | The attribute type to get. |
HasAttribute<TAttribute>()
Returns true if the property has any attributes of the given type.
Declaration
bool HasAttribute<TAttribute>()
where TAttribute : Attribute
Returns
Type | Description |
---|---|
Boolean | true if the property has the given attribute type; otherwise, false. |
Type Parameters
Name | Description |
---|---|
TAttribute | The attribute type to check for. |