From 542dcfba8be7d55e0f69498a0328de1864cbee69 Mon Sep 17 00:00:00 2001 From: jesusalvino <96534278+jesusalvino@users.noreply.github.com> Date: Wed, 9 Aug 2023 13:37:35 -0500 Subject: [PATCH] DYN-5816 locale splash screen (#14118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Display the proper language in the Splash Screen * spacing RootDirectories * Keeping spacing * Remove Splash Screen default title * Dissect the Preferences creation from the DynamoModel ctor * removing null validation * Refactoring based on the PathManager and Preferences * Adding a PathManager and Preference singleton * cleaning text * PathManager and PreferenceSetttings as singleton * Cleaning spacing and others * Using the singleton PathManager class instead of the Interface * Changing the scope and documenting the function CreateIPathResolver * Changing access to be flexible for integrators * Removing unused function * Setting the Preferences to the RecorderTests * Add the PreferenceSettings.Instance to the DynamoCoreTests setup * Adding the preference settings to the DynamoTestUIBase Start configuration * Set the Preferences to the SystemTesttBase * Set the PreferenceSettings.Instance to the DynamoViewModelUnitTest Start * Dealing with the PathResolver * Passing the Preferences to the DynamoModel Start function and update a comment * Passing the Prererences to the VisualizationTest Start * Update the MakeCLIModel function * Passing the Preferences to the DefaultStartConfiguration * Update AssemblySharedInfo.cs * Passing the settings to the configuration from the parameter * untouch the hostApplicationDirectory * Untouching the preLoadedLibraries field and renaming * Restoring fields and adding doc * Adding the preferences to the start of some tests * Validating the settings in the DynamoModelTestBase setup * Adding Preferences to the config Settings Test * Refactoring the PathManager and Preference creation on the DynamoModel ctor and DynamoModelTestBase * Cleaning Tests setup and ignore Pref Instance property for xml * Removing Pref Singleton to the CoreTest Setup * Rollback fron the 6213 commit * keep the StartInTestMode to false since this is an special case and set an explicit preferences instance * Handling Preferences * clieaning references * Saving them with the proper Unicode * Removing Singletion Preferences * Explicit Settings since the StartInTestMode is false * Add the specific Preferences * Rollback the cc58 * Rollback the cc58 * Fix Solution * Fixing the Assembly character and test file * Forcing to update the cc58 commit * Removing the test file * Fixing Tests Unicode * No new line --------- Co-authored-by: Jesus Alfredo Alviño Co-authored-by: reddyashish <43763136+reddyashish@users.noreply.github.com> --- src/DynamoApplications/StartupUtils.cs | 35 ++++- src/DynamoCore/Configuration/PathManager.cs | 29 +++- .../Configuration/PreferenceSettings.cs | 7 + src/DynamoCore/Models/DynamoModel.cs | 137 ++++++++++++------ src/DynamoCore/Models/DynamoModelDelegates.cs | 4 + src/DynamoCore/Models/DynamoModelEvents.cs | 9 ++ .../Views/SplashScreen/SplashScreen.xaml.cs | 11 +- .../Logging/DynamoAnalyticsClientTest.cs | 4 +- test/DynamoCoreTests/SchedulerTests.cs | 4 +- test/DynamoCoreTests/Settings.cs | 6 +- test/DynamoCoreWpfTests/CoreUITests.cs | 7 +- .../PythonTestsWithLogging.cs | 3 +- .../HelixWatch3DViewModelTests.cs | 4 +- 13 files changed, 199 insertions(+), 61 deletions(-) diff --git a/src/DynamoApplications/StartupUtils.cs b/src/DynamoApplications/StartupUtils.cs index 6d1406a9b17..8a9fb62226c 100644 --- a/src/DynamoApplications/StartupUtils.cs +++ b/src/DynamoApplications/StartupUtils.cs @@ -8,6 +8,8 @@ using System.Text; using System.Threading; using CommandLine; +using Dynamo.Configuration; +using Dynamo.Core; using Dynamo.Interfaces; using Dynamo.Models; using Dynamo.Scheduler; @@ -241,6 +243,13 @@ private static IUpdateManager InitializeUpdateManager() /// public static DynamoModel MakeCLIModel(string asmPath, string userDataFolder, string commonDataFolder, HostAnalyticsInfo info = new HostAnalyticsInfo(), bool isServiceMode = false) { + IPathResolver pathResolver = CreatePathResolver(false, string.Empty, string.Empty, string.Empty); + PathManager.Instance.AssignIPathResolver(pathResolver); + + Thread.CurrentThread.CurrentUICulture = new CultureInfo(PreferenceSettings.Instance.Locale); + Thread.CurrentThread.CurrentCulture = new CultureInfo(PreferenceSettings.Instance.Locale); + DynamoModel.OnDetectLanguage(); + // Preload ASM and display corresponding message on splash screen DynamoModel.OnRequestUpdateLoadBarStatus(new SplashScreenLoadEventArgs(Resources.SplashScreenPreLoadingAsm, 10)); var isASMloaded = PreloadASM(asmPath, out string geometryFactoryPath, out string preloaderLocation); @@ -273,6 +282,13 @@ public static DynamoModel MakeModel(bool CLImode, string asmPath = "", string ho /// public static DynamoModel MakeModel(bool CLImode, string asmPath = "", HostAnalyticsInfo info = new HostAnalyticsInfo()) { + IPathResolver pathResolver = CreatePathResolver(false, string.Empty, string.Empty, string.Empty); + PathManager.Instance.AssignIPathResolver(pathResolver); + + Thread.CurrentThread.CurrentUICulture = new CultureInfo(PreferenceSettings.Instance.Locale); + Thread.CurrentThread.CurrentCulture = new CultureInfo(PreferenceSettings.Instance.Locale); + DynamoModel.OnDetectLanguage(); + // Preload ASM and display corresponding message on splash screen DynamoModel.OnRequestUpdateLoadBarStatus(new SplashScreenLoadEventArgs(Resources.SplashScreenPreLoadingAsm, 10)); var isASMloaded = PreloadASM(asmPath, out string geometryFactoryPath, out string preloaderLocation); @@ -281,6 +297,20 @@ public static DynamoModel MakeModel(bool CLImode, string asmPath = "", string ho return model; } + /// + /// It returns an IPathResolver based on the mode and some locations + /// + /// CLI mode starts the model in test mode and uses a seperate path resolver. + /// Path to be used by PathResolver for preLoaderLocation + /// Path to be used by PathResolver for UserDataFolder + /// Path to be used by PathResolver for CommonDataFolder + /// + private static IPathResolver CreatePathResolver(bool CLImode, string preloaderLocation, string userDataFolder, string commonDataFolder) + { + IPathResolver pathResolver = CLImode ? new CLIPathResolver(preloaderLocation, userDataFolder, commonDataFolder) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver; + return pathResolver; + } + /// /// TODO (DYN-2118) remove this method in 3.0 and unify this method with the overload above. /// Use this overload to construct a DynamoModel when the location of ASM to use is known. @@ -377,8 +407,9 @@ private static DynamoModel StartDynamoWithDefaultConfig(bool CLImode, AuthProvider = CLImode ? null : new Core.IDSDKManager(), UpdateManager = CLImode ? null : OSHelper.IsWindows() ? InitializeUpdateManager() : null, StartInTestMode = CLImode, - PathResolver = CLImode ? new CLIPathResolver(preloaderLocation, userDataFolder, commonDataFolder) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver, - IsServiceMode = isServiceMode + PathResolver = CreatePathResolver(CLImode, preloaderLocation, userDataFolder, commonDataFolder), + IsServiceMode = isServiceMode, + Preferences = PreferenceSettings.Instance }; var model = DynamoModel.Start(config); diff --git a/src/DynamoCore/Configuration/PathManager.cs b/src/DynamoCore/Configuration/PathManager.cs index 14f4c4f99fb..457a04a5890 100644 --- a/src/DynamoCore/Configuration/PathManager.cs +++ b/src/DynamoCore/Configuration/PathManager.cs @@ -48,8 +48,15 @@ struct PathManagerParams internal IPathResolver PathResolver { get; set; } } - class PathManager : IPathManager + public class PathManager : IPathManager { + internal static Lazy + lazy = + new Lazy + (() => new PathManager(new PathManagerParams())); + + public static PathManager Instance { get { return lazy.Value; } } + #region Class Private Data Members public const string PackagesDirectoryName = "packages"; @@ -89,7 +96,7 @@ class PathManager : IPathManager private readonly HashSet preloadedLibraries; private readonly HashSet extensionsDirectories; private readonly HashSet viewExtensionsDirectories; - private readonly IPathResolver pathResolver; + private IPathResolver pathResolver; #endregion @@ -274,6 +281,14 @@ public int MinorFileVersion get { return minorFileVersion; } } + /// + /// This function indicates if there is an already assigned Path Resolver , otherwise it will take from the ctor config + /// + public bool HasPathResolver + { + get { return pathResolver != null; } + } + public void AddResolutionPath(string path) { if (string.IsNullOrEmpty(path)) @@ -346,6 +361,16 @@ public bool ResolveDocumentPath(ref string document) #region Public Class Operational Methods + /// + /// Assigns an IPathResolver on demand with the same behavior as the Ctor. + /// + /// + internal void AssignIPathResolver(IPathResolver resolver) + { + pathResolver = resolver; + LoadPathsFromResolver(); + } + /// /// Constructs an instance of PathManager object. /// diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index 29280ac83d1..b5d25850206 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -47,6 +47,13 @@ internal static void CopyProperties(this PreferenceSettings source, PreferenceSe /// public class PreferenceSettings : NotificationObject, IPreferences, IRenderPrecisionPreference, IDisablePackageLoadingPreferences, ILogSource, IHideAutocompleteMethodOptions { + internal readonly static Lazy + lazy = new Lazy + (() => PreferenceSettings.Load(PathManager.Instance.PreferenceFilePath)); + + [XmlIgnore] + public static PreferenceSettings Instance { get { return lazy.Value; } } + private string numberFormat; private string lastUpdateDownloadPath; private int maxNumRecentFiles; diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index bfcf141bae6..fe092ba6d0b 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -593,7 +593,7 @@ public struct DefaultStartConfiguration : IStartConfiguration /// The instance of public static DynamoModel Start() { - return Start(new DefaultStartConfiguration() { ProcessMode = TaskProcessMode.Asynchronous }); + return Start(new DefaultStartConfiguration() { ProcessMode = TaskProcessMode.Asynchronous, Preferences = PreferenceSettings.Instance }); } /// @@ -614,7 +614,7 @@ public static DynamoModel Start(IStartConfiguration configuration) internal static readonly string BuiltInPackagesToken = @"%BuiltInPackages%"; [Obsolete("Only used for migration to the new for this directory - BuiltInPackages - do not use for other purposes")] // Token representing the standard library directory - internal static readonly string StandardLibraryToken = @"%StandardLibrary%"; + internal static readonly string StandardLibraryToken = @"%StandardLibrary%"; /// /// Default constructor for DynamoModel @@ -638,12 +638,7 @@ protected DynamoModel(IStartConfiguration config) ClipBoard = new ObservableCollection(); - pathManager = new PathManager(new PathManagerParams - { - CorePath = config.DynamoCorePath, - HostPath = config.DynamoHostPath, - PathResolver = config.PathResolver - }); + pathManager = CreatePathManager(config); // Ensure we have all directories in place. var exceptions = new List(); @@ -677,13 +672,9 @@ protected DynamoModel(IStartConfiguration config) OnRequestUpdateLoadBarStatus(new SplashScreenLoadEventArgs(Resources.SplashScreenInitPreferencesSettings, 30)); - IPreferences preferences = CreateOrLoadPreferences(config.Preferences); - if (preferences is PreferenceSettings settings) + PreferenceSettings = CreatePreferences(config); + if (PreferenceSettings != null) { - PreferenceSettings = settings; - // Setting the new locale for Dynamo after Preferences loaded - Thread.CurrentThread.CurrentUICulture = new CultureInfo(PreferenceSettings.Locale); - Thread.CurrentThread.CurrentCulture = new CultureInfo(PreferenceSettings.Locale); PreferenceSettings.PropertyChanged += PreferenceSettings_PropertyChanged; PreferenceSettings.MessageLogged += LogMessage; } @@ -1016,6 +1007,92 @@ protected DynamoModel(IStartConfiguration config) DynamoReady(new ReadyParams(this)); } + /// + /// It returns a PathManager instance based on the mode in order to reuse it's Singleton instance or create a new one + /// + /// + /// + internal PathManager CreatePathManager(IStartConfiguration config) + { + if (!config.StartInTestMode) + { + if (!Core.PathManager.Instance.HasPathResolver) + { + Core.PathManager.Instance.AssignIPathResolver(config.PathResolver); + } + return Core.PathManager.Instance; + } + else + { + return new PathManager(new PathManagerParams + { + CorePath = config.DynamoCorePath, + HostPath = config.DynamoHostPath, + PathResolver = config.PathResolver + }); + } + } + + /// + /// It returns a PreferenceSettings instance based on the mode in order to reuse it's Singleton instance or create a new one + /// + /// + /// + internal PreferenceSettings CreatePreferences(IStartConfiguration config) + { + PreferenceSettings preferences = null; + if (!config.StartInTestMode) + { + if (config.Preferences is PreferenceSettings settings) + { + preferences = settings; + } + } + else + { + preferences = (PreferenceSettings)CreateOrLoadPreferences(config.Preferences); + } + + return preferences; + } + + /// + /// Create or load a preference checking the usage mode and if it already exists + /// + /// + /// + private IPreferences CreateOrLoadPreferences(IPreferences preferences) + { + if (preferences != null) // If there is preference settings provided... + return preferences; + + //Skip file handling and trust location in service mode. + if (IsServiceMode) + { + var setting = new PreferenceSettings(); + setting.SetTrustWarningsDisabled(true); + return setting; + } + + // Is order for test cases not to interfere with the regular preference + // settings xml file, a test case usually specify a temporary xml file + // path from where preference settings are to be loaded. If that value + // is not set, then fall back to the file path specified in PathManager. + // + var xmlFilePath = PreferenceSettings.DynamoTestPath; + if (string.IsNullOrEmpty(xmlFilePath)) + xmlFilePath = pathManager.PreferenceFilePath; + + if (File.Exists(xmlFilePath)) + { + // If the specified xml file path exists, load it. + return PreferenceSettings.Load(xmlFilePath); + } + + // Otherwise make a default preference settings object. + return new PreferenceSettings(); + } + private void CheckFeatureFlagTest() { if (!DynamoModel.IsTestMode) @@ -1702,38 +1779,6 @@ private void LoadNodeModels(List nodes, bool isPackageMember) } } - private IPreferences CreateOrLoadPreferences(IPreferences preferences) - { - if (preferences != null) // If there is preference settings provided... - return preferences; - - //Skip file handling and trust location in service mode. - if (IsServiceMode) - { - var setting = new PreferenceSettings(); - setting.SetTrustWarningsDisabled(true); - return setting; - } - - // Is order for test cases not to interfere with the regular preference - // settings xml file, a test case usually specify a temporary xml file - // path from where preference settings are to be loaded. If that value - // is not set, then fall back to the file path specified in PathManager. - // - var xmlFilePath = PreferenceSettings.DynamoTestPath; - if (string.IsNullOrEmpty(xmlFilePath)) - xmlFilePath = pathManager.PreferenceFilePath; - - if (File.Exists(xmlFilePath)) - { - // If the specified xml file path exists, load it. - return PreferenceSettings.Load(xmlFilePath); - } - - // Otherwise make a default preference settings object. - return new PreferenceSettings(); - } - private void InitializePreferences() { if (PreferenceSettings != null) diff --git a/src/DynamoCore/Models/DynamoModelDelegates.cs b/src/DynamoCore/Models/DynamoModelDelegates.cs index b952473fa7d..56cfe0d8871 100644 --- a/src/DynamoCore/Models/DynamoModelDelegates.cs +++ b/src/DynamoCore/Models/DynamoModelDelegates.cs @@ -47,4 +47,8 @@ namespace Dynamo.Models /// internal delegate void SplashScreenLoadingHandler(SplashScreenLoadEventArgs args); + /// + /// This delegate is used to notify the detected language to the Splash Screen. + /// + internal delegate void SplashScreenLanguageDetected(); } diff --git a/src/DynamoCore/Models/DynamoModelEvents.cs b/src/DynamoCore/Models/DynamoModelEvents.cs index e3fdbb70904..7a76d0379c7 100644 --- a/src/DynamoCore/Models/DynamoModelEvents.cs +++ b/src/DynamoCore/Models/DynamoModelEvents.cs @@ -73,6 +73,15 @@ internal static void OnRequestUpdateLoadBarStatus(SplashScreenLoadEventArgs args RequestUpdateLoadBarStatus?.Invoke(args); } + /// + /// Event to throw for Splash Screen to display the content in the proper language + /// + internal static event SplashScreenLanguageDetected LanguageDetected; + internal static void OnDetectLanguage() + { + LanguageDetected?.Invoke(); + } + /// /// Occurs when changes in data may affect UI and UI needs to be refreshed /// diff --git a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs index 90838774925..d42f51e6a7c 100644 --- a/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs +++ b/src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs @@ -130,6 +130,7 @@ public SplashScreen() // Bind event handlers webView.NavigationCompleted += WebView_NavigationCompleted; DynamoModel.RequestUpdateLoadBarStatus += DynamoModel_RequestUpdateLoadBarStatus; + DynamoModel.LanguageDetected += DynamoModel_LanguageDetected; StaticSplashScreenReady += OnStaticScreenReady; RequestLaunchDynamo = LaunchDynamo; RequestImportSettings = ImportSettings; @@ -137,9 +138,13 @@ public SplashScreen() RequestSignOut = SignOut; } - private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCompletedEventArgs e) + private void DynamoModel_LanguageDetected() { SetLabels(); + } + + private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCompletedEventArgs e) + { if (webView != null) { webView.NavigationCompleted -= WebView_NavigationCompleted; @@ -276,7 +281,7 @@ protected override async void OnContentRendered(EventArgs e) webView.CoreWebView2.Settings.IsZoomControlEnabled = false; var assembly = Assembly.GetExecutingAssembly(); - + using (Stream stream = assembly.GetManifestResourceStream(htmlEmbeddedFile)) using (StreamReader reader = new StreamReader(stream)) { @@ -296,6 +301,7 @@ protected override async void OnContentRendered(EventArgs e) jsonString = jsonString.Replace("#base64BackgroundImage", $"data:image/{imageFileExtension};base64,{resourceBase64}"); } + jsonString = jsonString.Replace("Welcome to Dynamo!", ""); htmlString = htmlString.Replace("mainJs", jsonString); webView.NavigateToString(htmlString); @@ -474,6 +480,7 @@ protected override void OnClosed(EventArgs e) base.OnClosed(e); DynamoModel.RequestUpdateLoadBarStatus -= DynamoModel_RequestUpdateLoadBarStatus; + DynamoModel.LanguageDetected -= DynamoModel_LanguageDetected; webView.Dispose(); webView = null; diff --git a/test/DynamoCoreTests/Logging/DynamoAnalyticsClientTest.cs b/test/DynamoCoreTests/Logging/DynamoAnalyticsClientTest.cs index b8b27c38f2a..69b450d3c1a 100644 --- a/test/DynamoCoreTests/Logging/DynamoAnalyticsClientTest.cs +++ b/test/DynamoCoreTests/Logging/DynamoAnalyticsClientTest.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Dynamo.Configuration; using Dynamo.Graph.Nodes; using Dynamo.Graph.Nodes.ZeroTouch; using Dynamo.Graph.Workspaces; @@ -29,7 +30,8 @@ protected override DynamoModel.IStartConfiguration CreateStartConfiguration(IPre PathResolver = pathResolver, StartInTestMode = false, GeometryFactoryPath = preloader.GeometryFactoryPath, - ProcessMode = TaskProcessMode.Synchronous + ProcessMode = TaskProcessMode.Synchronous, + Preferences = new PreferenceSettings() }; } diff --git a/test/DynamoCoreTests/SchedulerTests.cs b/test/DynamoCoreTests/SchedulerTests.cs index 89b9d0a4bfd..bf292716185 100644 --- a/test/DynamoCoreTests/SchedulerTests.cs +++ b/test/DynamoCoreTests/SchedulerTests.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using CoreNodeModels.Input; +using Dynamo.Configuration; using Dynamo.Graph.Nodes; using Dynamo.Graph.Nodes.ZeroTouch; using Dynamo.Models; @@ -1154,7 +1155,8 @@ protected void StartDynamo() SchedulerThread = schedulerThread, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, - ProcessMode = TaskProcessMode.Asynchronous + ProcessMode = TaskProcessMode.Asynchronous, + Preferences = new PreferenceSettings() }); } diff --git a/test/DynamoCoreTests/Settings.cs b/test/DynamoCoreTests/Settings.cs index 62ae8a97c7a..ef28af61cc3 100644 --- a/test/DynamoCoreTests/Settings.cs +++ b/test/DynamoCoreTests/Settings.cs @@ -91,7 +91,8 @@ public void SetPythonTemplateFromConfigWithValidPath() var config = new DynamoModel.DefaultStartConfiguration() { - PythonTemplatePath = templatePath + PythonTemplatePath = templatePath, + StartInTestMode = true }; var model = DynamoModel.Start(config); @@ -106,7 +107,8 @@ public void SetPythonTemplateFromConfigWithInvalidPath() var config = new DynamoModel.DefaultStartConfiguration() { - PythonTemplatePath = templatePath + PythonTemplatePath = templatePath, + StartInTestMode = true }; var model = DynamoModel.Start(config); diff --git a/test/DynamoCoreWpfTests/CoreUITests.cs b/test/DynamoCoreWpfTests/CoreUITests.cs index c2f3a3fa455..55237b26967 100644 --- a/test/DynamoCoreWpfTests/CoreUITests.cs +++ b/test/DynamoCoreWpfTests/CoreUITests.cs @@ -799,9 +799,10 @@ private void RestartTestSetup(bool startInTestMode) new DynamoModel.DefaultStartConfiguration() { StartInTestMode = startInTestMode, - ProcessMode = startInTestMode - ? TaskProcessMode.Synchronous - : TaskProcessMode.Asynchronous + ProcessMode = startInTestMode + ? TaskProcessMode.Synchronous + : TaskProcessMode.Asynchronous, + Preferences= PreferenceSettings.Instance }); ViewModel = DynamoViewModel.Start( diff --git a/test/Libraries/DynamoPythonTests/PythonTestsWithLogging.cs b/test/Libraries/DynamoPythonTests/PythonTestsWithLogging.cs index 29a63a45613..16bfac42d6c 100644 --- a/test/Libraries/DynamoPythonTests/PythonTestsWithLogging.cs +++ b/test/Libraries/DynamoPythonTests/PythonTestsWithLogging.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using Dynamo; +using Dynamo.Configuration; using Dynamo.Graph.Workspaces; using Dynamo.Interfaces; using Dynamo.Models; @@ -24,7 +25,7 @@ protected override void GetLibrariesToPreload(List libraries) protected override DynamoModel.IStartConfiguration CreateStartConfiguration(IPreferences settings) { - var config = base.CreateStartConfiguration(settings); + var config = base.CreateStartConfiguration(new PreferenceSettings()); config.StartInTestMode = false; return config; } diff --git a/test/VisualizationTests/HelixWatch3DViewModelTests.cs b/test/VisualizationTests/HelixWatch3DViewModelTests.cs index c4e472d7196..1b1532e826e 100644 --- a/test/VisualizationTests/HelixWatch3DViewModelTests.cs +++ b/test/VisualizationTests/HelixWatch3DViewModelTests.cs @@ -12,6 +12,7 @@ using CoreNodeModels; using CoreNodeModels.Input; using Dynamo; +using Dynamo.Configuration; using Dynamo.Controls; using Dynamo.Graph; using Dynamo.Graph.Nodes; @@ -98,7 +99,8 @@ protected override void StartDynamo(TestSessionConfiguration testConfig) PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, UpdateManager = this.UpdateManager, - ProcessMode = TaskProcessMode.Synchronous + ProcessMode = TaskProcessMode.Synchronous, + Preferences = PreferenceSettings.Instance }); Model.EvaluationCompleted += Model_EvaluationCompleted;