Class CommandManager
Command Manager provides support to define custom commands. The custom commands are executed when the specified key gesture is recognized.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.JavaScript.DataVisualization.Models.Diagram
Assembly: Syncfusion.EJ.dll
Syntax
public class CommandManager : EJTagHelper
Constructors
CommandManager()
Declaration
public CommandManager()
Properties
Commands
Gets or sets object that maps a set of command names with the corresponding command objects
Declaration
[JsonProperty("commands")]
public Dictionary<string, object> Commands { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | Object |
Examples
<script>
function canExecute(args) {
var diagram = $("#DiagramContent").ejDiagram("instance");
return diagram.model.selectedItems.children.length;
}
function execute(args) {
var diagram = $("#DiagramContent").ejDiagram("instance");
diagram.copy();
diagram.paste();
}
</script>
DiagramProperties Model = new DiagramProperties();
Model.CommandManager = new CommandManager();
Command Command = new Command();
Command.Gesture = new Gesture();
Command.Gesture.Key = Keys.C;
Command.Gesture.KeyModifiers = KeyModifiers.Shift;
Command.CanExecute = "canExecute";
Command.Execute = "execute";
Model.CommandManager.Commands.Add("clone", Command);