Show / Hide Table of Contents

Interface IVersionableCommand

Provides an extension point for Addins to provide a command that can be executed on an IVersionable item.

Inherited Members
IGenericCommand.Name
IGenericCommand.Category
IGenericCommand.SubCategory
IGenericCommand.Image
IGenericCommand.Weight
Namespace: Algenta.Colectica.ViewModel.Commands
Assembly: Algenta.Colectica.ViewModel.dll
Syntax
public interface IVersionableCommand : IGenericCommand

Properties

IncludeInTaskMode

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

Declaration
bool IncludeInTaskMode { get; }
Property Value
Type Description
System.Boolean

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
bool IsLongRunning { get; }
Property Value
Type Description
System.Boolean

Parameter

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

Declaration
object Parameter { get; }
Property Value
Type Description
System.Object

Result

Gets the result of the command's execution.

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

The result of the command.

SupportedTypes

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

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

Methods

CanEverExecute(VersionableCommandContext)

Determines whether this command should be displayed for the specified node.

Declaration
bool CanEverExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command will be displayed or hidden.

Returns
Type Description
System.Boolean

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.

Declaration
bool CanExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command will be enabled or disabled.

Returns
Type Description
System.Boolean

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
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
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
void PreExecute(VersionableCommandContext context)
Parameters
Type Name Description
VersionableCommandContext context

The context in which the command is being executed.

Events

ProgressChanged

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

Declaration
event ProgressChangedEventHandler ProgressChanged
Event Type
Type Description
ProgressChangedEventHandler

Extension Methods

Extensions.Yield<T>(T)
Back to top Copyright © 2009-2018 Colectica