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)
Syntaxpublic static Task InvokeAsCommandAsync(
this DocumentCollection docs,
Action<Document> action
)
<ExtensionAttribute>
Public Shared Function InvokeAsCommandAsync (
docs As DocumentCollection,
action As Action(Of Document)
) As Task
public:
[ExtensionAttribute]
static Task^ InvokeAsCommandAsync(
DocumentCollection^ docs,
Action<Document^>^ action
)
[<ExtensionAttribute>]
static member InvokeAsCommandAsync :
docs : DocumentCollection *
action : Action<Document> -> Task
Parameters
- docs
- Type: DocumentCollection
Documents collection. - action
- Type: SystemActionDocument
Action to invoke.
Return Value
Type:
TaskTask.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).
ExceptionsException | Condition |
---|
ArgumentNullException | Thrown if docs is null; |
ArgumentNullException | Thrown if action is null; |
Exception | eNoDocument thrown if no active document. |
Exception | eInvalidContext thrown if not called from application context. |
See Also