menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Command

    Show / Hide Table of Contents

    Class Command

    Defines a combination of keys and key modifiers on recognition of which the command will be executed.

    Inheritance
    System.Object
    EJTagHelper
    Command
    Inherited Members
    EJTagHelper.GetControlDetails()
    EJTagHelper.GetControlDetails(String)
    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 Command : EJTagHelper

    Constructors

    Command()

    Declaration
    public Command()

    Properties

    CanExecute

    Gets or sets a method that defines whether the command is executable at the moment or not

    Declaration
    [JsonProperty("canExecute")]
    public string CanExecute { get; set; }
    Property Value
    Type Description
    System.String

    null

    Examples
     <script>
    
           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.Execute = "execute";
               Model.CommandManager.Commands.Add("clone", Command);

    Execute

    Gets or sets method that defines the action to be done when the specified key gesture is recognized

    Declaration
    [JsonProperty("execute")]
    public string Execute { get; set; }
    Property Value
    Type Description
    System.String

    null

    Examples
       <script>
           function canExecute(args) {
               var diagram = $("#DiagramContent").ejDiagram("instance");
               return diagram.model.selectedItems.children.length;
           } 
       </script>
               DiagramProperties Model = new DiagramProperties();
               Model.CommandManager = new CommandManager();
               Command Command = new Command();
               Command.CanExecute = "canExecute"; 
               Model.CommandManager.Commands.Add("clone", Command);

    Gesture

    Gets or sets a combination of keys and key modifiers, on recognition of which the command will be executed

    Declaration
    [JsonProperty("gesture")]
    public Gesture Gesture { get; set; }
    Property Value
    Type Description
    Gesture

    null

    Examples
               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;
               Model.CommandManager.Commands.Add("clone", Command);

    Parameter

    Gets or sets any additional parameters that are required at runtime

    Declaration
    [JsonProperty("parameter")]
    public object Parameter { get; set; }
    Property Value
    Type Description
    System.Object

    null

    Examples
       <script>
           function execute(args) {
               var diagram = $("#DiagramContent").ejDiagram("instance");
               return diagram.model.selectedItems.children.length;
           } 
       </script>
               DiagramProperties Model = new DiagramProperties();
               Model.CommandManager = new CommandManager();
               Command Command = new Command();
               Command.Parameter = "node";
               Command.Execute = "execute"; 
               Model.CommandManager.Commands.Add("clone", Command);
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved