Skip to content

Commit

Permalink
Merge pull request #1111 from mcneel/1.21
Browse files Browse the repository at this point in the history
1.21
  • Loading branch information
kike-garbo authored May 2, 2024
2 parents 664d28d + f1ca16f commit efd0a10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/RhinoInside.Revit.AddIn/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,16 @@ static async void CheckForUpdates()
#endregion

#region IHostedApplication
void ERUI.IHostedApplication.InvokeInHostContext(Action action) => Rhinoceros.InvokeInHostContext(action);
T ERUI.IHostedApplication.InvokeInHostContext<T>(Func<T> func) => Rhinoceros.InvokeInHostContext(func);
void ERUI.IHostedApplication.InvokeInHostContext(Action action)
{
if (Core.CurrentStatus == Core.Status.Ready) Rhinoceros.InvokeInHostContext(action);
else action();
}
T ERUI.IHostedApplication.InvokeInHostContext<T>(Func<T> func)
{
if (Core.CurrentStatus == Core.Status.Ready) return Rhinoceros.InvokeInHostContext(func);
else return func();
}

bool ERUI.IHostedApplication.DoEvents() => Rhinoceros.Run();
Microsoft.Win32.SafeHandles.WindowHandle ERUI.IHostedApplication.MainWindow => Rhinoceros.MainWindow;
Expand Down

0 comments on commit efd0a10

Please sign in to comment.