C# Class Microsoft.Sarif.Viewer.DelegateCommandBase

An ICommand whose delegates can be attached for Execute and CanExecute.
Inheritance: ICommand
Mostrar archivo Open project: Microsoft/sarif-sdk

Protected Properties

Property Type Description
_canExecuteMethod bool>.Func
_executeMethod Task>.Func

Protected Methods

Method Description
CanExecute ( object parameter ) : bool

Determines if the command can execute with the provided parameter by invoking the Func{Object,Bool} supplied during construction.

DelegateCommandBase ( Action executeMethod, bool>.Func canExecuteMethod ) : System

Creates a new instance of a DelegateCommandBase, specifying both the execute action and the can execute function.

DelegateCommandBase ( Task>.Func executeMethod, bool>.Func canExecuteMethod ) : System

Creates a new instance of a DelegateCommandBase, specifying both the Execute action as an awaitable Task and the CanExecute function.

Execute ( object parameter ) : System.Threading.Tasks.Task

Executes the command with the provided parameter by invoking the Action{Object} supplied during construction.

OnCanExecuteChanged ( ) : void

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute.

Private Methods

Method Description
ICommand ( object parameter ) : bool
ICommand ( object parameter ) : void
RaiseCanExecuteChanged ( ) : void

Method Details

CanExecute() protected method

Determines if the command can execute with the provided parameter by invoking the Func{Object,Bool} supplied during construction.
protected CanExecute ( object parameter ) : bool
parameter object The parameter to use when determining if this command can execute.
return bool

DelegateCommandBase() protected method

Creates a new instance of a DelegateCommandBase, specifying both the execute action and the can execute function.
protected DelegateCommandBase ( Action executeMethod, bool>.Func canExecuteMethod ) : System
executeMethod Action The to execute when is invoked.
canExecuteMethod bool>.Func The to invoked when is invoked.
return System

DelegateCommandBase() protected method

Creates a new instance of a DelegateCommandBase, specifying both the Execute action as an awaitable Task and the CanExecute function.
protected DelegateCommandBase ( Task>.Func executeMethod, bool>.Func canExecuteMethod ) : System
executeMethod Task>.Func The to execute when is invoked.
canExecuteMethod bool>.Func The to invoked when is invoked.
return System

Execute() protected method

Executes the command with the provided parameter by invoking the Action{Object} supplied during construction.
protected Execute ( object parameter ) : System.Threading.Tasks.Task
parameter object
return System.Threading.Tasks.Task

OnCanExecuteChanged() protected method

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute.
protected OnCanExecuteChanged ( ) : void
return void

Property Details

_canExecuteMethod protected_oe property

protected Func _canExecuteMethod
return bool>.Func

_executeMethod protected_oe property

protected Func _executeMethod
return Task>.Func