From 7e8f29f8446552940730af3999bed292239df91e Mon Sep 17 00:00:00 2001 From: Bogdan Zavu Date: Mon, 10 Feb 2025 20:12:04 -0500 Subject: [PATCH] reinstate splashscreen --- src/DynamoRevit/DynamoRevit.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/DynamoRevit/DynamoRevit.cs b/src/DynamoRevit/DynamoRevit.cs index 6cddc062b..392e3c20e 100644 --- a/src/DynamoRevit/DynamoRevit.cs +++ b/src/DynamoRevit/DynamoRevit.cs @@ -214,7 +214,7 @@ public class DynamoRevit : IExternalCommand private static List preLoadExceptions; private static Action shutdownHandler; private Stopwatch startupTimer; - private Dynamo.UI.Views.SplashScreen splashScreen; + private static Dynamo.UI.Views.SplashScreen splashScreen; /// /// Get or Set the current RevitDynamoModel available in Revit context @@ -226,6 +226,11 @@ public class DynamoRevit : IExternalCommand /// public static DynamoViewModel RevitDynamoViewModel { get; private set; } + /// + /// Determines whether the splash screen is currently visible. + /// + public static bool IsSplashScreenVisible() => splashScreen != null && splashScreen.IsVisible; + static DynamoRevit() { idleActions = new List(); @@ -289,8 +294,7 @@ public Result ExecuteCommand(DynamoRevitCommandData commandData) try { // Launch main Dynamo directly when ShowUiKey is true. - bool bSkipSplashScreen = true; // TODO: remove this when issue with System.Windows.Application.Current not being null - if (CheckJournalForKey(commandData, JournalKeys.ShowUiKey, false) || bSkipSplashScreen) + if (CheckJournalForKey(commandData, JournalKeys.ShowUiKey, false)) { extCommandData = commandData; LoadDynamoWithoutSplashScreen(); @@ -1082,6 +1086,8 @@ private static void OnSplashScreenClosed(object sender, EventArgs e) //the model is shutdown when splash screen is closed RevitDynamoModel.State = DynamoModel.DynamoModelState.NotStarted; } + + splashScreen = null; } #endregion