In This Article

MacroRecording Class

Provides access to all macro recording functionality for a SyntaxEditor.

public class MacroRecording : IMacroRecording
Inheritance:
object object
Implements:
IMacroRecording

Constructors

MacroRecording(SyntaxEditor)

Initializes a new instance of the MacroRecording class.

public MacroRecording(SyntaxEditor syntaxEditor)
Parameter Type Description
syntaxEditor SyntaxEditor

The SyntaxEditor that owns the object.

Properties

CurrentMacroAction

Gets the IMacroAction that is currently being recorded.

public IMacroAction CurrentMacroAction { get; }

Property Value

IMacroAction:

The IMacroAction that is currently being recorded.

Remarks

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

LastMacroAction

Gets the last IMacroAction that was recorded.

public IMacroAction LastMacroAction { get; }

Property Value

IMacroAction:

The last IMacroAction that was recorded.

Remarks

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

State

Gets the current state of macro recording.

public MacroRecordingState State { get; }

Property Value

MacroRecordingState:

A MacroRecordingState that specifies the state.

Methods

Cancel()

Cancels recording a macro.

public void Cancel()

Remarks

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

CreateMacroAction()

Creates a new IMacroAction to use when recording starts.

protected virtual IMacroAction CreateMacroAction()

Returns

IMacroAction:

The IMacroAction that was created.

NotifyEditAction(ITextView, IEditAction)

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

public virtual 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.

public void Pause()

Remarks

Use the Resume() method to resume recording.

Record()

Starts recording a new macro.

public 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.

public void Resume()

Remarks

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

Stop()

Stops recording a macro.

public 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.

Inherited Members