Interface IRevitEventHandler
Provides a way to run asyncronous taks on Revit's main thread
Inherited Members
Autodesk.Revit.UI.IExternalEventHandler.Execute(Autodesk.Revit.UI.UIApplication)
Autodesk.Revit.UI.IExternalEventHandler.GetName()
Namespace: Onbox.Revit.V8.Async
Assembly: Onbox.Revit.dll
Syntax
public interface IRevitEventHandler : IExternalEventHandler
Methods
| Improve this Doc View SourceCancelAll()
Cancels all queue tasks
Declaration
void CancelAll()
GetQueueCount()
Gets the number of queue tasks
Declaration
int GetQueueCount()
Returns
Type | Description |
---|---|
System.Int32 |
RunAsync(Action<UIApplication>, CancellationTokenSource)
The action will run by Revit as soon as its thread is available
Declaration
Task RunAsync(Action<UIApplication> action, CancellationTokenSource cancelSource = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Autodesk.Revit.UI.UIApplication> | action | |
System.Threading.CancellationTokenSource | cancelSource |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
RunAsync<T>(Func<UIApplication, T>, CancellationTokenSource)
The action will run by Revit as soon as its thread is available
Declaration
Task<T> RunAsync<T>(Func<UIApplication, T> action, CancellationTokenSource cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Autodesk.Revit.UI.UIApplication, T> | action | |
System.Threading.CancellationTokenSource | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> |
Type Parameters
Name | Description |
---|---|
T |