In This Article

MacroAction Class

Represents an IEditAction that contains a list of IEditAction objects that can be executed in a macro.

public class MacroAction : EditActionBase, IMacroAction, IEditAction, IKeyedObject
Inheritance:
object RoutedCommand RoutedUICommand EditActionBase object
Implements:
IMacroAction IEditAction IKeyedObject

Constructors

MacroAction()

Initializes an instance of the MacroAction class.

public MacroAction()

Properties

CanRecordInMacro

Gets whether the action can be recorded in a macro.

public override bool CanRecordInMacro { get; }

Property Value

bool:

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

Count

Gets the number of actions in the macro.

public int Count { get; }

Property Value

int:

The number of actions in the macro.

IsEmpty

Gets whether the macro action is empty and doesn't currently contain any child IEditAction objects.

public bool IsEmpty { get; }

Property Value

bool:

true if the macro action is empty and doesn't currently contain any child IEditAction objects; otherwise, false.

this[int]

Gets the IEditAction at the specified index.

[C#] In C#, this property is the indexer for the MacroAction class.

public IEditAction this[int index] { get; }
Parameter Type Description
index int

The index of the IEditAction to return.

Property Value

IEditAction:

The IEditAction at the specified index.

Methods

Add(IEditAction)

Adds an IEditAction to the end of the macro.

public void Add(IEditAction action)
Parameter Type Description
action IEditAction

The IEditAction to add.

Execute(IEditorView)

Executes the edit action in the specified IEditorView.

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

The IEditorView in which to execute the edit action.

GetEnumerator()

Retrieves an IEnumerator object for the entire collection.

public IEnumerator<IEditAction> GetEnumerator()

Returns

IEnumerator<IEditAction>:

An IEnumerator object for the entire collection

Remarks

Enumerators are intended to be used only to read data in the collection. Enumerators cannot be used to modify the underlying collection.

The enumerator does not have exclusive access to the collection.

When an enumerator is instantiated, it takes a snapshot of the current state of the collection. If changes are made to the collection, such as adding, modifying or deleting elements, the snapshot gets out of sync and the enumerator throws an InvalidOperationException. Two enumerators instantiated from the same collection at the same time can have different snapshots of the collection.

ReadFromXml(XmlReader)

Deserializes the data for the IEditAction from XML.

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