Show / Hide Table of Contents

Class VersionableCommandBase

Provides a base class from which Addins implementing an IVersionableCommand can derive.

Inheritance
object
VersionableCommandBase
Implements
IVersionableCommand
IGenericCommand
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Algenta.Colectica.ViewModel.Commands
Assembly: Algenta.Colectica.ViewModel.dll
Syntax
public abstract class VersionableCommandBase : IVersionableCommand, IGenericCommand

Constructors

VersionableCommandBase()

Initializes a new instance of the VersionableCommandBase class.

Declaration
public VersionableCommandBase()

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
string

Image

Gets the path to an image that represents the command.

Declaration
public string Image { get; set; }
Property Value
Type Description
string

IncludeInTaskMode

Gets a value indicating whether this command should be displayed in task mode.

Declaration
public bool IncludeInTaskMode { get; protected set; }
Property Value
Type Description
bool

IsFeatured

Gets a value that indicates whether the command should be prominently displayed in the user interface.

Declaration
public bool IsFeatured { get; set; }
Property Value
Type Description
bool

IsLongRunning

Gets a value indicating whether the command takes a long time to run. If true, the command will be executed on a background thread and progress will be displayed to the user.

Declaration
public bool IsLongRunning { get; protected set; }
Property Value
Type Description
bool

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
string

Parameter

Gets a parameter that provides additional context for the command's execution. This is useful when creating many commands from an IVersionableCommandProvider.

Declaration
public object Parameter { get; set; }
Property Value
Type Description
object

Result

Gets the result of the command's execution.

Declaration
public CommandResult Result { get; }
Property Value
Type Description
CommandResult

The result of the command.

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
string

SupportedTypes

Gets a collection of types for which this command can execute. If empty, the command can be used for all item types.

Declaration
public Collection<Guid> SupportedTypes { get; protected set; }
Property Value
Type Description
Collection<Guid>

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; protected set; }
Property Value
Type Description
int

Methods

CanEverExecute(VersionableCommandContext)

Determines whether this command should be displayed for the specified node. If not overridden, the method always returns true.

Declaration
public virtual bool CanEverExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context
Returns
Type Description
bool

true if the command should be displayed for the specified node; otherwise false.

Remarks

The value returned from this method determines the Visibility of the command's menu item or button.

CanExecute(VersionableCommandContext)

Determines whether this command should be enabled for the specified node. If not overridden, the method always returns true.

Declaration
public virtual bool CanExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context
Returns
Type Description
bool

true if the command should be enabled for the specified node; otherwise false.

Remarks

The value returned from this method determines the IsEnabled state of the command's menu item or button.

Execute(VersionableCommandContext)

Executes the command. If IsLongRunning is set to true, the method is called on a background thread. In this case, the method implementation must not interact with the user interface.

Declaration
public abstract void Execute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command is being executed.

PostExecute(VersionableCommandContext)

This method is called after the Execute method, and always runs on the user interface thread.

Declaration
public virtual void PostExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command is being executed.

PreExecute(VersionableCommandContext)

This method is called before the Execute method, and always runs on the user interface thread.

Declaration
public virtual void PreExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command is being executed.

ReportProgress(int, int, object)

Reports on the progress of the command's execution.

Declaration
protected void ReportProgress(int completed, int total, object userState)
Parameters
Type Name Description
int completed

The amount of work currently completed.

int total

The total amount of work to be completed.

object userState

An object or string providing the state of the command's execution.

ReportProgress(int, object)

Reports on the progress of the command's execution.

Declaration
protected void ReportProgress(int percent, object userState)
Parameters
Type Name Description
int percent

The percentage of work currently completed.

object userState

An object or string providing the state of the command's execution.

Events

ProgressChanged

An event that should be raised when progress changes during a command's execution.

Declaration
public event ProgressChangedEventHandler ProgressChanged
Event Type
Type Description
ProgressChangedEventHandler

Implements

IVersionableCommand
IGenericCommand
In this article
Back to top Generated by DocFX