WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface ICommand - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface ICommand

    This interface is implemented by command objects.

    Namespace: Syncfusion.Windows.Forms.Diagram
    Assembly: Syncfusion.Diagram.Base.dll
    Syntax
    public interface ICommand
    Remarks

    A command object encapsulates an action and the data required to perform the action. A command is executed using Do(Object) and can be reversed using the Undo() method.

    Properties

    CanUndo

    Gets a value indicating whether or not the command supports undo.

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

    Description

    Gets short, user-friendly description of the command.

    Declaration
    string Description { get; }
    Property Value
    Type Description
    System.String

    Methods

    CanMerge(ICommand)

    Determines whether this instance can merge the specified command to previous recorded command.

    Declaration
    bool CanMerge(ICommand cmd)
    Parameters
    Type Name Description
    ICommand cmd

    The command to merge.

    Returns
    Type Description
    System.Boolean

    true if this instance can merge the specified command to last recorded command; otherwise, false.

    Do(Object)

    Performs the action.

    Declaration
    bool Do(object target)
    Parameters
    Type Name Description
    System.Object target

    Object that is acted upon (noun).

    Returns
    Type Description
    System.Boolean

    True if successful; otherwise False.

    Merge(ICommand)

    Merges the specified command with last recorded user operation.

    Declaration
    void Merge(ICommand cmd)
    Parameters
    Type Name Description
    ICommand cmd

    The command to merge.

    Undo()

    Reverses the command.

    Declaration
    bool Undo()
    Returns
    Type Description
    System.Boolean

    True if successful; otherwise False.

    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved