DisplayAttribute Class
Namespace: Stride.CoreAssembly: Stride.Core.dll
Portable DisplayAttribute equivalent to
public class DisplayAttribute : Attribute
| Name | Description | |
|---|---|---|
| Constructors | ||
| DisplayAttribute(Int32, String, String) | Initializes a new instance of the DisplayAttribute class. |
|
| DisplayAttribute(String, String) | Initializes a new instance of the DisplayAttribute class. |
|
| Properties | ||
| Browsable | Gets or sets whether the related member is browsable when its class is exposed in the UI. |
|
| Category | Gets a string that is used to group fields in the UI. |
|
| CustomHue | Gets the hue of a color that is used in the UI. |
|
| Expand | Gets or sets whether to expand the control representing the associated object in the UI. |
|
| Name | Gets a string that is used for display in the UI. |
|
| Order | Gets the order weight of the column. |
|
| Methods | ||
| GetDisplay(MemberInfo) | Gets the display attribute attached to the specified member info. |
|
| GetDisplayName(Type) | Gets the display name of the given type. The display name is the name of the type, or, if the DisplayAttribute is applied on the type, value of the Name property. |
|
| GetOrder(MemberInfo) | ||
Constructors
DisplayAttribute(Int32, String, String)
Initializes a new instance of the DisplayAttribute class.
public DisplayAttribute(int order, string name = null, string category = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | order | The order weight of the column. |
| System.String | name | A value that is used for display in the UI.. |
| System.String | category | A value that is used to group fields in the UI.. |
DisplayAttribute(String, String)
Initializes a new instance of the DisplayAttribute class.
public DisplayAttribute(string name = null, string category = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | A value that is used for display in the UI.. |
| System.String | category | A value that is used to group fields in the UI.. |
Properties
Browsable
Gets or sets whether the related member is browsable when its class is exposed in the UI.
public bool Browsable { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Category
Gets a string that is used to group fields in the UI.
public string Category { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The category. |
CustomHue
Gets the hue of a color that is used in the UI.
public float? CustomHue { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Single> |
Remarks
If not null, this value must be in the range [0, 360].
Expand
Gets or sets whether to expand the control representing the associated object in the UI.
public ExpandRule Expand { get; set; }
Property Value
| Type | Description |
|---|---|
| ExpandRule |
Name
Gets a string that is used for display in the UI.
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The name. |
Order
Gets the order weight of the column.
public int? Order { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Int32> | The order. |
Methods
GetDisplay(MemberInfo)
Gets the display attribute attached to the specified member info.
[Obsolete("Display attribute should be retrieved via an AttributeRegistry.")]
public static DisplayAttribute GetDisplay(MemberInfo memberInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.MemberInfo | memberInfo | Member type (Property, Field or Type). |
Returns
| Type | Description |
|---|---|
| DisplayAttribute | DisplayAttribute. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | memberInfo |
GetDisplayName(Type)
Gets the display name of the given type. The display name is the name of the type, or, if the DisplayAttribute is applied on the type, value of the Name property.
[Obsolete("Display attribute should be retrieved via an AttributeRegistry.")]
public static string GetDisplayName(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type for which to get the display name. |
Returns
| Type | Description |
|---|---|
| System.String | A string representing the display name of the type. |
GetOrder(MemberInfo)
[Obsolete("Display attribute should be retrieved via an AttributeRegistry.")]
public static int? GetOrder(MemberInfo memberInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.MemberInfo | memberInfo |
Returns
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |