Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-5816 locale splash screen #14118

Merged
merged 62 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
18c74c4
Display the proper language in the Splash Screen
jesusalvino Jun 29, 2023
2ebe836
spacing RootDirectories
jesusalvino Jun 29, 2023
9614f08
Keeping spacing
jesusalvino Jun 29, 2023
b265118
Remove Splash Screen default title
jesusalvino Jun 30, 2023
4766900
Dissect the Preferences creation from the DynamoModel ctor
jesusalvino Jun 30, 2023
7194409
removing null validation
jesusalvino Jun 30, 2023
fe25ed1
Refactoring based on the PathManager and Preferences
Jul 11, 2023
f27f2de
Adding a PathManager and Preference singleton
Jul 12, 2023
49cfc60
cleaning text
Jul 12, 2023
4da1ea6
PathManager and PreferenceSetttings as singleton
Jul 13, 2023
695628c
Cleaning spacing and others
Jul 13, 2023
1fb48cb
Using the singleton PathManager class instead of the Interface
Jul 14, 2023
db89a94
Changing the scope and documenting the function CreateIPathResolver
Jul 20, 2023
fb647ec
Changing access to be flexible for integrators
Jul 20, 2023
777f584
Removing unused function
Jul 21, 2023
4c42d65
Setting the Preferences to the RecorderTests
Jul 21, 2023
7dd7321
Add the PreferenceSettings.Instance to the DynamoCoreTests setup
Jul 22, 2023
06bbbd4
Adding the preference settings to the DynamoTestUIBase Start configur…
Jul 22, 2023
1aefe4a
Set the Preferences to the SystemTesttBase
Jul 23, 2023
2ce8be4
Set the PreferenceSettings.Instance to the DynamoViewModelUnitTest Start
Jul 24, 2023
d229f81
Dealing with the PathResolver
Jul 25, 2023
0b3902f
Passing the Preferences to the DynamoModel Start function and update …
Jul 25, 2023
1f449e0
Passing the Prererences to the VisualizationTest Start
Jul 25, 2023
b63a8dd
Update the MakeCLIModel function
Jul 25, 2023
2eab90c
Passing the Preferences to the DefaultStartConfiguration
Jul 25, 2023
9e1f6d9
merge master-resolve conflicts
reddyashish Jul 28, 2023
b50b5e4
Update AssemblySharedInfo.cs
reddyashish Jul 28, 2023
ff3862c
Passing the settings to the configuration from the parameter
Jul 31, 2023
6fc2258
untouch the hostApplicationDirectory
Jul 31, 2023
e81b146
Untouching the preLoadedLibraries field and renaming
Jul 31, 2023
9da3a1f
Restoring fields and adding doc
Aug 1, 2023
f4bafcd
Adding the preferences to the start of some tests
Aug 1, 2023
7ed64f7
Validating the settings in the DynamoModelTestBase setup
Aug 2, 2023
4dfdef4
Adding Preferences to the config Settings Test
Aug 3, 2023
7252051
Refactoring the PathManager and Preference creation on the DynamoMode…
Aug 3, 2023
1ddba71
Merge branch 'master' into DYN-5816-locale-splash-screen
Aug 3, 2023
84e111d
Cleaning Tests setup and ignore Pref Instance property for xml
Aug 3, 2023
37620ba
Merge branch 'DynamoDS:master' into DYN-5816-locale-splash-screen
jesusalvino Aug 4, 2023
1321eb7
Merge branch 'DynamoDS:master' into DYN-5816-locale-splash-screen
jesusalvino Aug 4, 2023
8c3ee26
Removing Pref Singleton to the CoreTest Setup
Aug 4, 2023
cc58ece
Rollback fron the 6213 commit
Aug 4, 2023
90e4a7f
Merge branch 'master' into DYN-5816-locale-splash-screen
Aug 4, 2023
1f0d671
keep the StartInTestMode to false since this is an special case and s…
Aug 4, 2023
e14ee63
Handling Preferences
Aug 5, 2023
fe980b9
clieaning references
Aug 5, 2023
4771ed4
Saving them with the proper Unicode
Aug 5, 2023
33a5d63
Removing Singletion Preferences
Aug 5, 2023
e5e92ab
Explicit Settings since the StartInTestMode is false
Aug 5, 2023
745a431
Add the specific Preferences
Aug 7, 2023
53d2218
Rollback the cc58
Aug 7, 2023
2539d97
Rollback the cc58
Aug 7, 2023
b630a38
Merge branch 'master' of https://github.com/jesusalvino/Dynamo
Aug 7, 2023
06ea6c5
Merge branch 'master' into DYN-5816-T1
Aug 7, 2023
2caf714
Fix Solution
Aug 8, 2023
c290e73
Fixing the Assembly character and test file
Aug 8, 2023
63e905a
Merge branch 'master' into DYN-5816-locale-splash-screen
Aug 8, 2023
87636bb
Merge branch 'DYN-5816-T1' into DYN-5816-locale-splash-screen
Aug 8, 2023
d10541a
Forcing to update the cc58 commit
Aug 8, 2023
549e3c2
Removing the test file
Aug 8, 2023
162fe2c
Fixing Tests Unicode
Aug 8, 2023
d2f3731
No new line
Aug 8, 2023
5a22b9d
Merge branch 'DynamoDS:master' into DYN-5816-locale-splash-screen
jesusalvino Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions src/DynamoApplications/StartupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -241,6 +243,13 @@ private static IUpdateManager InitializeUpdateManager()
/// <returns></returns>
public static DynamoModel MakeCLIModel(string asmPath, string userDataFolder, string commonDataFolder, HostAnalyticsInfo info = new HostAnalyticsInfo(), bool isServiceMode = false)
{
IPathResolver pathResolver = CreateIPathResolver(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);
Expand Down Expand Up @@ -273,6 +282,13 @@ public static DynamoModel MakeModel(bool CLImode, string asmPath = "", string ho
/// <returns></returns>
public static DynamoModel MakeModel(bool CLImode, string asmPath = "", HostAnalyticsInfo info = new HostAnalyticsInfo())
{
IPathResolver pathResolver = CreateIPathResolver(false, string.Empty, string.Empty, string.Empty);
Copy link
Contributor

@QilongTang QilongTang Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested in DynamoRevit yet? These string.empty params later will cause certain folder property to be missing. For sandbox it is OK but for integration case, we get these from the integration code. Unless you meant to not reuse the same pathResolver later?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang Works fine in Revit. Jesus has tested it.
@jesusalvino Can you expand why we are just initializing pathResolver with the empty arguments here? I see that you are setting the pathResolver correctly in DynamoModel constructor(Line 674)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function not called by integrators, if not, then probably OK this way

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);
Expand All @@ -281,6 +297,20 @@ public static DynamoModel MakeModel(bool CLImode, string asmPath = "", string ho
return model;
}

/// <summary>
/// It returns an IPathResolver based on the mode and some locations
/// </summary>
/// <param name="CLImode">CLI mode starts the model in test mode and uses a seperate path resolver.</param>
/// <param name="preloaderLocation">Path to be used by PathResolver for preLoaderLocation</param>
/// <param name="userDataFolder">Path to be used by PathResolver for UserDataFolder</param>
/// <param name="commonDataFolder">Path to be used by PathResolver for CommonDataFolder</param>
/// <returns></returns>
private static IPathResolver CreateIPathResolver(bool CLImode, string preloaderLocation, string userDataFolder, string commonDataFolder)
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
{
IPathResolver pathResolver = CLImode ? new CLIPathResolver(preloaderLocation, userDataFolder, commonDataFolder) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver;
return pathResolver;
}

/// <summary>
/// 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.
Expand Down Expand Up @@ -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 = CreateIPathResolver(CLImode, preloaderLocation, userDataFolder, commonDataFolder),
IsServiceMode = isServiceMode,
Preferences = PreferenceSettings.Instance
};

var model = DynamoModel.Start(config);
Expand Down
32 changes: 28 additions & 4 deletions src/DynamoCore/Configuration/PathManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,15 @@ struct PathManagerParams
internal IPathResolver PathResolver { get; set; }
}

class PathManager : IPathManager
public class PathManager : IPathManager
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to clarify that all of the public methods of this class (which were hidden before because the class was private) are now going to be exposed as public members of the class. Not sure if this was intended
FYI @mjkkirschner @QilongTang

Copy link
Contributor

@QilongTang QilongTang Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point. @jesusalvino Does PathManager need to be a public singleton or internal?

Copy link
Contributor Author

@jesusalvino jesusalvino Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I think keep it within the .Core namespace should be enough, I will take a look

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer internal if possible!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guys this is the PR #14263

{
internal static Lazy<PathManager>
lazy =
new Lazy<PathManager>
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
(() => new PathManager(new PathManagerParams()));

public static PathManager Instance { get { return lazy.Value; } }

#region Class Private Data Members

public const string PackagesDirectoryName = "packages";
Expand All @@ -70,7 +77,7 @@ class PathManager : IPathManager
private readonly int majorFileVersion;
private readonly int minorFileVersion;
private readonly string dynamoCoreDir;
private readonly string hostApplicationDirectory;
private string hostApplicationDirectory;
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
private readonly string userDataDir;
private readonly string commonDataDir;

Expand All @@ -86,10 +93,10 @@ class PathManager : IPathManager
private readonly List<string> rootDirectories;
private readonly HashSet<string> nodeDirectories;
private readonly HashSet<string> additionalResolutionPaths;
private readonly HashSet<string> preloadedLibraries;
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
private HashSet<string> preloadedLibraries;
private readonly HashSet<string> extensionsDirectories;
private readonly HashSet<string> viewExtensionsDirectories;
private readonly IPathResolver pathResolver;
private IPathResolver pathResolver;

#endregion

Expand Down Expand Up @@ -274,6 +281,11 @@ public int MinorFileVersion
get { return minorFileVersion; }
}

public bool HasPathResolver
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
{
get { return pathResolver != null; }
}

public void AddResolutionPath(string path)
{
if (string.IsNullOrEmpty(path))
Expand Down Expand Up @@ -346,6 +358,18 @@ public bool ResolveDocumentPath(ref string document)

#region Public Class Operational Methods

/// <summary>
/// Assigns an IPathResolver on demand with the same behavior as the Ctor.
/// </summary>
/// <param name="resolver"></param>
internal void AssignIPathResolver(IPathResolver resolver)
{
hostApplicationDirectory = string.Empty;
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
pathResolver = resolver;
preloadedLibraries = new HashSet<string>();
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
LoadPathsFromResolver();
}

/// <summary>
/// Constructs an instance of PathManager object.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ internal static void CopyProperties(this PreferenceSettings source, PreferenceSe
/// </summary>
public class PreferenceSettings : NotificationObject, IPreferences, IRenderPrecisionPreference, IDisablePackageLoadingPreferences, ILogSource, IHideAutocompleteMethodOptions
{
internal readonly static Lazy<PreferenceSettings>
lazy = new Lazy<PreferenceSettings>
(() => PreferenceSettings.Load(PathManager.Instance.PreferenceFilePath));

public static PreferenceSettings Instance { get { return lazy.Value; } }
QilongTang marked this conversation as resolved.
Show resolved Hide resolved

private string numberFormat;
private string lastUpdateDownloadPath;
private int maxNumRecentFiles;
Expand Down
49 changes: 6 additions & 43 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ public struct DefaultStartConfiguration : IStartConfiguration
/// <returns>The instance of <see cref="DynamoModel"/></returns>
public static DynamoModel Start()
{
return Start(new DefaultStartConfiguration() { ProcessMode = TaskProcessMode.Asynchronous });
return Start(new DefaultStartConfiguration() { ProcessMode = TaskProcessMode.Asynchronous, Preferences = PreferenceSettings.Instance });
}

/// <summary>
Expand Down Expand Up @@ -668,12 +668,11 @@ protected DynamoModel(IStartConfiguration config)

ClipBoard = new ObservableCollection<ModelBase>();

pathManager = new PathManager(new PathManagerParams
pathManager = Core.PathManager.Instance;
if (!Core.PathManager.Instance.HasPathResolver)
{
CorePath = config.DynamoCorePath,
HostPath = config.DynamoHostPath,
PathResolver = config.PathResolver
});
Core.PathManager.Instance.AssignIPathResolver(config.PathResolver);
}

// Ensure we have all directories in place.
var exceptions = new List<Exception>();
Expand Down Expand Up @@ -707,13 +706,9 @@ protected DynamoModel(IStartConfiguration config)

OnRequestUpdateLoadBarStatus(new SplashScreenLoadEventArgs(Resources.SplashScreenInitPreferencesSettings, 30));

IPreferences preferences = CreateOrLoadPreferences(config.Preferences);
if (preferences is PreferenceSettings settings)
if (config.Preferences is PreferenceSettings settings)
{
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;
}
Expand Down Expand Up @@ -1727,38 +1722,6 @@ private void LoadNodeModels(List<TypeLoadData> 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)
Expand Down
4 changes: 4 additions & 0 deletions src/DynamoCore/Models/DynamoModelDelegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ namespace Dynamo.Models
/// <param name="args"></param>
internal delegate void SplashScreenLoadingHandler(SplashScreenLoadEventArgs args);

/// <summary>
/// This delegate is used to notify the detected language to the Splash Screen.
/// </summary>
internal delegate void SplashScreenLanguageDetected();
}
9 changes: 9 additions & 0 deletions src/DynamoCore/Models/DynamoModelEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ internal static void OnRequestUpdateLoadBarStatus(SplashScreenLoadEventArgs args
RequestUpdateLoadBarStatus?.Invoke(args);
}

/// <summary>
/// Event to throw for Splash Screen to display the content in the proper language
/// </summary>
internal static event SplashScreenLanguageDetected LanguageDetected;
QilongTang marked this conversation as resolved.
Show resolved Hide resolved
internal static void OnDetectLanguage()
{
LanguageDetected?.Invoke();
}

/// <summary>
/// Occurs when changes in data may affect UI and UI needs to be refreshed
/// </summary>
Expand Down
11 changes: 9 additions & 2 deletions src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,21 @@ public SplashScreen()
// Bind event handlers
webView.NavigationCompleted += WebView_NavigationCompleted;
DynamoModel.RequestUpdateLoadBarStatus += DynamoModel_RequestUpdateLoadBarStatus;
DynamoModel.LanguageDetected += DynamoModel_LanguageDetected;
StaticSplashScreenReady += OnStaticScreenReady;
RequestLaunchDynamo = LaunchDynamo;
RequestImportSettings = ImportSettings;
RequestSignIn = SignIn;
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;
Expand Down Expand Up @@ -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))
{
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion src/VisualizationTests/HelixWatch3DViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using CoreNodeModels;
using CoreNodeModels.Input;
using Dynamo;
using Dynamo.Configuration;
using Dynamo.Controls;
using Dynamo.Graph;
using Dynamo.Graph.Nodes;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions test/DynamoCoreTests/DynamoModelTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Dynamo.Configuration;
using Dynamo.Core;
using Dynamo.Graph.Nodes;
using Dynamo.Graph.Workspaces;
Expand Down Expand Up @@ -44,7 +45,7 @@ public override void Setup()

// Store a copy of the PathManager.BuiltinPackagesDirectory so that we can reset it after each DynamoModelTest
originalBuiltinPackagesDirectory = originalBuiltinPackagesDirectory ?? PathManager.BuiltinPackagesDirectory;
StartDynamo(dynamoSettings);
StartDynamo(PreferenceSettings.Instance);
}

public override void Cleanup()
Expand Down
3 changes: 2 additions & 1 deletion test/DynamoCoreWpfTests/CoreUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,8 @@ private void RestartTestSetup(bool startInTestMode)
StartInTestMode = startInTestMode,
ProcessMode = startInTestMode
? TaskProcessMode.Synchronous
: TaskProcessMode.Asynchronous
: TaskProcessMode.Asynchronous,
Preferences= PreferenceSettings.Instance
});

ViewModel = DynamoViewModel.Start(
Expand Down
5 changes: 3 additions & 2 deletions test/DynamoCoreWpfTests/DynamoTestUIBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -101,7 +101,8 @@ protected virtual DynamoModel.IStartConfiguration CreateStartConfiguration(IPath
PathResolver = pathResolver,
StartInTestMode = true,
GeometryFactoryPath = preloader.GeometryFactoryPath,
ProcessMode = TaskProcessMode.Synchronous
ProcessMode = TaskProcessMode.Synchronous,
Preferences = PreferenceSettings.Instance
};
}

Expand Down
8 changes: 5 additions & 3 deletions test/DynamoCoreWpfTests/DynamoViewModelUnitTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Dynamo.Configuration;
using Dynamo.Models;
using Dynamo.Scheduler;
using Dynamo.Selection;
Expand Down Expand Up @@ -123,7 +124,8 @@ protected void StartDynamo()
PathResolver = pathResolver,
StartInTestMode = true,
GeometryFactoryPath = preloader.GeometryFactoryPath,
ProcessMode = TaskProcessMode.Synchronous
ProcessMode = TaskProcessMode.Synchronous,
Preferences = PreferenceSettings.Instance
});

var watch3DViewParams = new Watch3DViewModelStartupParams(model);
Expand Down Expand Up @@ -185,4 +187,4 @@ protected void RunCurrentModel() // Run currently loaded model.
Assert.DoesNotThrow(() => ViewModel.HomeSpace.Run());
}
}
}
}
Loading