Skip to content

Commit

Permalink
Fix on AddIn.Loader it was loading Rhino unnecessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
kike-garbo committed May 2, 2024
1 parent 3758931 commit 4e7d453
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 @@ -121,8 +121,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 4e7d453

Please sign in to comment.