WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TextFormatCmd - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TextFormatCmd

    Base class for text formatting commands.

    Inheritance
    System.Object
    TextFormatCmd
    BoldTextCmd
    ColorTextCmd
    FontFamilyTextCmd
    FontHeightTextCmd
    HorizontalAlignmentTextCmd
    ItalicTextCmd
    StrikeoutTextCmd
    UnderlineTextCmd
    Implements
    ICommand
    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.Windows.Forms.Diagram
    Assembly: Syncfusion.Diagram.Windows.dll
    Syntax
    public abstract class TextFormatCmd : ICommand
    Remarks

    This is the base class for a series of text formatting commands that modify the font style and alignment of text objects.

    Constructors

    TextFormatCmd(NodeCollection)

    Initializes a new instance of the TextFormatCmd class.

    Declaration
    public TextFormatCmd(NodeCollection nodesAffected)
    Parameters
    Type Name Description
    NodeCollection nodesAffected

    The nodes affected.

    TextFormatCmd(TextEditor, TextNode)

    Initializes a new instance of the TextFormatCmd class.

    Declaration
    public TextFormatCmd(TextEditor txtEditor, TextNode nodeEditing)
    Parameters
    Type Name Description
    TextEditor txtEditor

    The text editor.

    TextNode nodeEditing

    The node editing.

    TextFormatCmd(TextNode)

    Initializes a new instance of the TextFormatCmd class.

    Declaration
    public TextFormatCmd(TextNode nodeAffected)
    Parameters
    Type Name Description
    TextNode nodeAffected

    The node affected.

    Fields

    m_fNewFormatValue

    New format value.

    Declaration
    protected object m_fNewFormatValue
    Field Value
    Type Description
    System.Object

    m_fOldFormatValue

    Old format value.

    Declaration
    protected object m_fOldFormatValue
    Field Value
    Type Description
    System.Object
    Remarks

    Valid only when new formatting is applied to one node or when formatting is applied using textEditor.

    m_hashOldFormatValues

    Helper Hashtable containing old format values.

    Declaration
    protected Hashtable m_hashOldFormatValues
    Field Value
    Type Description
    System.Collections.Hashtable
    Remarks

    Valid only when new formatting is applied to multiple nodes.

    m_nodesAffected

    Nodes Affected with new format.

    Declaration
    protected NodeCollection m_nodesAffected
    Field Value
    Type Description
    NodeCollection

    m_strDescription

    Short, user-friendly description of the command.

    Declaration
    protected string m_strDescription
    Field Value
    Type Description
    System.String

    m_txtEditor

    TextEditor used to format text.

    Declaration
    protected TextEditor m_txtEditor
    Field Value
    Type Description
    TextEditor
    Remarks

    Valid only when one formatting is applied to one node using textEditor.

    Properties

    CanUndo

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

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

    All text formatting commands support Undo.

    Description

    Gets short, user-friendly description of the command.

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

    NewFormatValue

    Gets the new format value.

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

    The new format value.

    NodeAffected

    Gets the node affected.

    Declaration
    public NodeCollection NodeAffected { get; }
    Property Value
    Type Description
    NodeCollection

    The node affected.

    OldValues

    Gets the hash of old values where key is textnode, value is format style.

    Declaration
    protected Hashtable OldValues { get; }
    Property Value
    Type Description
    System.Collections.Hashtable

    The old values.

    Methods

    CanMerge(ICommand)

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

    Declaration
    public virtual 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)

    Applies the text formatting value to the text nodes attached to the command.

    Declaration
    public virtual bool Do(object cmdTarget)
    Parameters
    Type Name Description
    System.Object cmdTarget

    Command target.

    Returns
    Type Description
    System.Boolean

    True if formatting applied to at least one node; otherwise False.

    Format(TextNode)

    Formats the specified node to format.

    Declaration
    protected abstract object Format(TextNode nodeToFormat)
    Parameters
    Type Name Description
    TextNode nodeToFormat

    The node to format.

    Returns
    Type Description
    System.Object

    The object

    FormatTextEditor()

    Formats the text editor.

    Declaration
    protected abstract void FormatTextEditor()

    Merge(ICommand)

    Merges the specified command to merge.

    Declaration
    public virtual void Merge(ICommand cmdMerging)
    Parameters
    Type Name Description
    ICommand cmdMerging

    The command to merge.

    Undo()

    Restores the original text formatting to each node attached to the command.

    Declaration
    public virtual bool Undo()
    Returns
    Type Description
    System.Boolean

    True if successful; otherwise False.

    UndoFormat(TextNode, Object)

    Undoes the format changes.

    Declaration
    protected abstract void UndoFormat(TextNode nodeToFormat, object fmtValue)
    Parameters
    Type Name Description
    TextNode nodeToFormat

    The node to format.

    System.Object fmtValue

    The format style.

    UndoFormatTextEditor()

    Undoes the format text editor.

    Declaration
    protected abstract void UndoFormatTextEditor()

    Implements

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