Click or drag to resize

DocumentCollectionExtensionInvokeAsCommandAsync Method

Invokes an action in the document context that can be safely called from the application context. Credit: Tony Tanzillo.

Namespace:  Gile.AutoCAD.R20.Extension
Assembly:  Gile.AutoCAD.R20.Extension (in Gile.AutoCAD.R20.Extension.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public static Task InvokeAsCommandAsync(
	this DocumentCollection docs,
	Action<Document> action
)

Parameters

docs
Type: DocumentCollection
Documents collection.
action
Type: SystemActionDocument
Action to invoke.

Return Value

Type: Task
Task.CompletedTask.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DocumentCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if docs is null;
ArgumentNullExceptionThrown if action is null;
ExceptioneNoDocument thrown if no active document.
ExceptioneInvalidContext thrown if not called from application context.
See Also