Class ContextActionAttribute
- Namespace
- OFT.Attributes.Editors
- Assembly
- OFT.Attributes.dll
Adds a context menu item to the editor of a setting; choosing it calls a parameterless method of the object.
Not in ATAS 8.0.15 yet: available from the next version.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public sealed class ContextActionAttribute : Attribute
- Inheritance
-
objectAttributeContextActionAttribute
- Extension Methods
Constructors
ContextActionAttribute(string, string, Type)
Initializes the attribute.
public ContextActionAttribute(string methodName, string name, Type resourceType)
Parameters
methodNamestringThe name of the parameterless method of the object the item calls.
namestringThe name of the static string property of
resourceTypewith the text of the item.resourceTypeTypeThe resource class with the text of the item.
Properties
MethodName
Gets the name of the parameterless method of the object the item calls; the item is not shown when the method is not found.
public string MethodName { get; }
Property Value
- string
Name
Gets the name of the static string property of ResourceType with the text of the item.
public string Name { get; }
Property Value
- string
ResourceType
Gets the resource class with the text of the item.
public Type ResourceType { get; }
Property Value
- Type
Methods
GetDisplayName()
Gets the text of the item: the value of the Name property of ResourceType, or Name itself when there is no such property.
public string GetDisplayName()
Returns
- string
The text of the item.