In This Article

IMacroRecording Interface

Provides the base requirements for all macro recording functionality in a SyntaxEditor.

public interface IMacroRecording

Properties

CurrentMacroAction

The IMacroAction that is currently being recorded.

IMacroAction? CurrentMacroAction { get; }

Property Value

IMacroAction

Remarks

This method returns null if no macro recording is currently taking place.

LastMacroAction

The last IMacroAction that was recorded.

IMacroAction? LastMacroAction { get; }

Property Value

IMacroAction

Remarks

After macro recording is stopped, this property contains what was recorded.

State

The current state of macro recording.

MacroRecordingState State { get; }

Property Value

MacroRecordingState

Methods

Cancel()

Cancels recording a macro.

void Cancel()

Remarks

When macro recording is cancelled, the old value of the LastMacroAction property is not overwritten.

NotifyEditAction(ITextView, IEditAction)

Notifies that an IEditAction is going to attempt to execute within an ITextView.

void NotifyEditAction(ITextView view, IEditAction action)
Parameter Type Description
view ITextView

The ITextView in which the edit action will attempt to execute.

action IEditAction

The IEditAction that will execute if its CanExecute(IEditorView) method returns true.

Remarks

Implementations of this method should append the IEditAction to the current macro being recorded if currently in a recording state and the action's CanRecordInMacro property is true.

Pause()

Pauses recording a macro.

void Pause()

Remarks

Use the Resume() method to resume recording.

Record()

Starts recording a new macro.

void Record()

Remarks

Use the Stop() method to end recording and save the macro that was recorded.

Resume()

Resumes recording a macro from a paused state.

void Resume()

Remarks

This method should be called after a Pause() to resume recording.

Stop()

Stops recording a macro.

IMacroAction? Stop()

Returns

IMacroAction:

The IMacroAction that was recorded.

Remarks

The IMacroAction that is recorded is stored in the LastMacroAction property. If no actions were recorded during this recording session, the old value of the LastMacroAction property will not be overwritten.

Extension Methods