Class NodeCommandBase
Provides a base class from which Addins implementing INodeCommand can derive.
Inheritance
Namespace: Algenta.Colectica.ViewModel.Commands
Assembly: Algenta.Colectica.ViewModel.dll
Syntax
public abstract class NodeCommandBase : object, INodeCommand, IGenericCommand
Constructors
NodeCommandBase()
Initializes a new instance of the NodeCommandBase class.
Declaration
public NodeCommandBase()
Properties
Category
Gets the category of the command, which is used to group similar commands together. When commands appear in the ribbon, each category gets its own top level ribbon tab.
Declaration
public string Category { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
Image
Gets the path to an image that represents the command.
Declaration
public string Image { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
Name
Gets the name of the command, which is displayed in menus and on buttons.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
Result
Gets the result of the command's execution.
Declaration
public CommandResult Result { get; protected set; }
Property Value
Type | Description |
---|---|
CommandResult | The result of the command. |
Implements
SubCategory
Gets the subcategory of the command, which is used to group similar commads together. When commands appear in the ribbon, each subcategory gets its own labeled section of a ribbon tab.
Declaration
public string SubCategory { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
Weight
Gets the order in which this Addin should be displayed. Lower values are displayed higher or further to the left.
Declaration
public int Weight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Implements
Methods
CanEverExecute(Node)
Determines whether this command should be displayed for the specified node. If not overridden, this method
will always return true
.
Declaration
public virtual bool CanEverExecute(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node | The node for which the command will be displayed or hidden. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Implements
Remarks
The value returned from this method determines the Visibility
of the command's menu item or button.
CanExecute(Node)
Determines whether this command should be enabled for the specified node. If not overridden, this method
will always return true
.
Declaration
public virtual bool CanExecute(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node | The node for which the command will be enabled or disabled. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Implements
Remarks
The value returned from this method determines the IsEnabled
state of the command's menu item or button.
Execute(Node)
Executes the command.
Declaration
public abstract void Execute(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node | The node on which the command is being executed. |