In This Article

EditActionBase Class

Provides a base implementation for an edit action that can be performed in an IEditorView.

public abstract class EditActionBase : RoutedUICommand, IEditAction, IKeyedObject
Inheritance:
object RoutedCommand RoutedUICommand object
Derived:
AddNextOccurrenceToSelectionAction ApplyDefaultOutliningExpansionAction BackspaceAction BackspaceToPreviousWordAction CancelMacroRecordingAction ChangeCharacterCasingAction CodeBlockSelectionContractAction CodeBlockSelectionExpandAction CollapseSelectionAction CollapseSelectionLeftAction CollapseSelectionRightAction CollapseToDefinitionsAction CommentLinesAction ConvertSpacesToTabsAction ConvertTabsToSpacesAction CopyToClipboardAction CutLineToClipboardAction CutToClipboardAction DeleteAction DeleteBlankLinesAction DeleteHorizontalWhitespaceAction DeleteLineAction DeleteToLineEndAction DeleteToLineStartAction DeleteToNextWordAction DuplicateAction ExpandAllOutliningAction FormatDocumentAction FormatSelectionAction HideSelectionAction IncrementalSearchAction IndentAction InsertLineBreakAction MacroAction MoveDownAction MoveLeftAction MovePageDownAction MovePageUpAction MoveRightAction MoveSelectedLinesDownAction MoveSelectedLinesUpAction MoveToDocumentEndAction MoveToDocumentStartAction MoveToLineEndAction MoveToLineStartAction MoveToLineStartAfterIndentationAction MoveToMatchingBracketAction MoveToNextLineStartAfterIndentationAction MoveToNextWordAction MoveToPreviousLineStartAfterIndentationAction MoveToPreviousWordAction MoveToVisibleBottomAction MoveToVisibleTopAction MoveUpAction OpenLineAboveAction OpenLineBelowAction OutdentAction PasteFromClipboardAction PauseResumeMacroRecordingAction RedoAction RequestIntelliPromptAutoCompleteAction RequestIntelliPromptCompletionSessionAction RequestIntelliPromptInsertSnippetSessionAction RequestIntelliPromptParameterInfoSessionAction RequestIntelliPromptQuickInfoSessionAction RequestIntelliPromptSurroundWithSessionAction ReverseIncrementalSearchAction RunMacroAction ScrollDownAction ScrollLeftAction ScrollLineToVisibleBottomAction ScrollLineToVisibleMiddleAction ScrollLineToVisibleTopAction ScrollPageDownAction ScrollPageUpAction ScrollRightAction ScrollToDocumentEndAction ScrollToDocumentStartAction ScrollUpAction SearchActionBase SelectAllAction SelectBlockDownAction SelectBlockLeftAction SelectBlockRightAction SelectBlockToNextWordAction SelectBlockToPreviousWordAction SelectBlockUpAction SelectDownAction SelectLeftAction SelectPageDownAction SelectPageUpAction SelectRightAction SelectToDocumentEndAction SelectToDocumentStartAction SelectToLineEndAction SelectToLineStartAction SelectToLineStartAfterIndentationAction SelectToMatchingBracketAction SelectToNextWordAction SelectToPreviousWordAction SelectToVisibleBottomAction SelectToVisibleTopAction SelectUpAction SelectWordAction StartAutomaticOutliningAction StopHidingCurrentAction StopOutliningAction TabifySelectedLinesAction ToggleAllOutliningExpansionAction ToggleMacroRecordingAction ToggleOutliningExpansionAction ToggleOverwriteModeAction TransposeCharactersAction TransposeLinesAction TransposeWordsAction TrimAllTrailingWhitespaceAction TrimTrailingWhitespaceAction TypingAction UncommentLinesAction UndoAction UntabifySelectedLinesAction ZoomActionBase
Implements:
IEditAction IKeyedObject

Constructors

EditActionBase(string)

Initializes an instance of the EditActionBase class.

protected EditActionBase(string text)
Parameter Type Description
text string

The command text.

Properties

CanRecordInMacro

Gets whether the action can be recorded in a macro.

public virtual bool CanRecordInMacro { get; }

Property Value

bool:

true if the action can be recorded in a macro; otherwise, false.

Key

Gets the string key that uniquely identifies the edit action.

public virtual string Key { get; }

Property Value

string:

The string key that uniquely identifies the edit action.

Methods

CanExecute(IEditorView)

Returns whether the edit action can execute in the specified IEditorView.

public virtual bool CanExecute(IEditorView view)
Parameter Type Description
view IEditorView

The IEditorView to examine.

Returns

bool:

true if the edit action can execute in the specified IEditorView; otherwise, false.

CreateCommandBinding()

Returns a CommandBinding for this edit action.

public CommandBinding CreateCommandBinding()

Returns

CommandBinding:

A CommandBinding for this edit action.

CreateCommandBinding(ICommand)

Returns a CommandBinding for this edit action.

public CommandBinding CreateCommandBinding(ICommand alternateCommand)
Parameter Type Description
alternateCommand ICommand

The alternate ICommand to use in the command binding for this edit action.

Returns

CommandBinding:

A CommandBinding for this edit action.

Execute(IEditorView)

Executes the edit action in the specified IEditorView.

public abstract void Execute(IEditorView view)
Parameter Type Description
view IEditorView

The IEditorView in which to execute the edit action.

GetKeyText(ModifierKeys, Key)

Gets the string version of a keyboard shortcut.

public static string GetKeyText(ModifierKeys modifiers, Key key)
Parameter Type Description
modifiers ModifierKeys

The System.Windows.Input.ModifierKeys to examine.

key Key

The System.Windows.Input.Key to examine.

Returns

string:

The string version of a keyboard shortcut.

ReadFromXml(XmlReader)

Deserializes the data for the IEditAction from XML.

public virtual void ReadFromXml(XmlReader reader)
Parameter Type Description
reader XmlReader

The System.Xml.XmlReader to use.

Remarks

This method is used for macro serialization.

WriteToXml(XmlWriter)

Serializes the data for the IEditAction to XML.

public virtual void WriteToXml(XmlWriter writer)
Parameter Type Description
writer XmlWriter

The System.Xml.XmlWriter to use.

Remarks

This method is used for macro serialization.

Inherited Members