private void RestartTestSetup() { // Shutdown Dynamo and restart it View.Close(); View = null; if (ViewModel != null) { ViewModel.Model.ShutDown(false); ViewModel = null; } // Setup Temp PreferenceSetting Location for testing PreferenceSettings.DYNAMO_TEST_PATH = Path.Combine(TempFolder, "UserPreferenceTest.xml"); Model = DynamoModel.Start( new DynamoModel.StartConfiguration() { StartInTestMode = true }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
public void Init() { storageExt = new Mock <IExtensionStorageAccess>(); extensionMock = storageExt.As <IExtension>(); storageExt.SetupGet(x => x.UniqueId).Returns(MOCK_EXTENSION_GUID); storageExt.SetupGet(x => x.Name).Returns(MOCK_EXTENSION_NAME); extensionMock.SetupGet(x => x.UniqueId).Returns(MOCK_EXTENSION_GUID); extensionMock.SetupGet(x => x.Name).Returns(MOCK_EXTENSION_NAME); model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { extensionMock.Object }, ProcessMode = TaskProcessMode.Synchronous }); extensionManager = model.ExtensionManager as ExtensionManager; // Make sure events that the storageExt mock uses are not null. model.WorkspaceSaving += delegate { }; model.WorkspaceOpened += delegate { }; }
private static void MakeStandaloneAndRun(string commandFilePath, out DynamoViewModel viewModel) { var geometryFactoryPath = string.Empty; var preloaderLocation = string.Empty; PreloadShapeManager(ref geometryFactoryPath, ref preloaderLocation); DynamoModel.RequestMigrationStatusDialog += MigrationStatusDialogRequested; var model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { PathResolver = new PathResolver(preloaderLocation), GeometryFactoryPath = geometryFactoryPath }); viewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { CommandFilePath = commandFilePath, DynamoModel = model }); var view = new DynamoView(viewModel); view.Loaded += (sender, args) => CloseMigrationWindow(); var app = new Application(); app.Run(view); DynamoModel.RequestMigrationStatusDialog -= MigrationStatusDialogRequested; }
private static void MakeStandaloneAndRun(string commandFilePath, ref DynamoViewModel viewModel) { DynamoPathManager.Instance.InitializeCore( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); DynamoPathManager.PreloadAsmLibraries(DynamoPathManager.Instance); var model = DynamoModel.Start( new DynamoModel.StartConfiguration() { Preferences = PreferenceSettings.Load() }); viewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { CommandFilePath = commandFilePath, DynamoModel = model }); var view = new DynamoView(viewModel); var app = new Application(); app.Run(view); }
public void Init() { mockExtension = new Mock <LinterExtensionBase>() { CallBase = true }; mockRule = new Mock <NodeLinterRule> { CallBase = true }; // Setup mock rule mockRule.Setup(r => r.Id).Returns(MOCK_RULE_ID); // Setup mock LinterExtension mockExtension.Setup(e => e.UniqueId).Returns(MOCK_GUID); mockExtension.Setup(e => e.Name).Returns(MOCK_Name); model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { mockExtension.Object }, ProcessMode = TaskProcessMode.Synchronous }); }
private void Init() { AppDomain.CurrentDomain.AssemblyResolve += AssemblyHelper.ResolveAssembly; var corePath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); Model = DynamoModel.Start( new DynamoModel.StartConfiguration() { StartInTestMode = true, DynamoCorePath = corePath }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); CreateTemporaryFolder(); }
public virtual void Start() { var assemblyPath = Assembly.GetExecutingAssembly().Location; preloader = new Preloader(Path.GetDirectoryName(assemblyPath)); preloader.Preload(); CreateTemporaryFolder(); // Setup Temp PreferenceSetting Location for testing PreferenceSettings.DynamoTestPath = Path.Combine(TempFolder, "UserPreferenceTest.xml"); Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, GeometryFactoryPath = preloader.GeometryFactoryPath }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
private static void MakeStandaloneAndRun(string commandFilePath, out DynamoViewModel viewModel) { var geometryFactoryPath = string.Empty; var preloaderLocation = string.Empty; PreloadShapeManager(ref geometryFactoryPath, ref preloaderLocation); // TODO(PATHMANAGER): Do we really libg_xxx folder on resolution path? // If not, PathResolver will be completely redundant so please remove it. var pathResolver = new PathResolver(preloaderLocation); var model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { PathResolver = pathResolver, GeometryFactoryPath = geometryFactoryPath }); viewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { CommandFilePath = commandFilePath, DynamoModel = model }); var view = new DynamoView(viewModel); var app = new Application(); app.Run(view); }
private void RestartTestSetupWithNewSettings(Dynamo.Models.DynamoModel.IStartConfiguration configuration, bool startInTestMode) { // Shutdown Dynamo and restart it View.Close(); View = null; if (ViewModel != null) { var shutdownParams = new DynamoViewModel.ShutdownParams( shutdownHost: false, allowCancellation: false); ViewModel.PerformShutdownSequence(shutdownParams); ViewModel = null; } Model = DynamoModel.Start(configuration); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); var expectedState = startInTestMode ? DynamoModel.DynamoModelState.StartedUIless : DynamoModel.DynamoModelState.StartedUI; Assert.AreEqual(ViewModel.Model.State, expectedState); //create the view View = new DynamoView(ViewModel); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
public virtual void Start() { DynamoPathManager.Instance.InitializeCore( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); DynamoPathManager.PreloadAsmLibraries(DynamoPathManager.Instance); AppDomain.CurrentDomain.AssemblyResolve += AssemblyHelper.ResolveAssembly; CreateTemporaryFolder(); // Setup Temp PreferenceSetting Location for testing PreferenceSettings.DynamoTestPath = Path.Combine(TempFolder, "UserPreferenceTest.xml"); Model = DynamoModel.Start( new DynamoModel.StartConfiguration() { StartInTestMode = true }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
protected virtual void StartDynamo(TestSessionConfiguration testConfig) { preloader = new Preloader(testConfig.DynamoCorePath, testConfig.RequestedLibraryVersion); preloader.Preload(); Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
protected override void StartDynamo(TestSessionConfiguration testConfig) { // Add Dynamo Core location to the PATH system environment variable. // This is to make sure dependencies(e.g.Helix assemblies) can be located. var path = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Process) + ";" + testConfig.DynamoCorePath; Environment.SetEnvironmentVariable("Path", path, EnvironmentVariableTarget.Process); var preloader = new Preloader(testConfig.DynamoCorePath, new[] { testConfig.RequestedLibraryVersion2 }); preloader.Preload(); var preloadedLibraries = new List <string>(); GetLibrariesToPreload(preloadedLibraries); if (preloadedLibraries.Any()) { if (pathResolver == null) { pathResolver = new TestPathResolver(); } var pr = pathResolver as TestPathResolver; foreach (var preloadedLibrary in preloadedLibraries.Distinct()) { pr.AddPreloadLibraryPath(preloadedLibrary); } } Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, UpdateManager = this.UpdateManager, ProcessMode = TaskProcessMode.Synchronous }); Model.EvaluationCompleted += Model_EvaluationCompleted; ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model, Watch3DViewModel = HelixWatch3DViewModel.TryCreateHelixWatch3DViewModel( null, new Watch3DViewModelStartupParams(Model), Model.Logger) }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
protected void StartDynamo() { var assemblyPath = Assembly.GetExecutingAssembly().Location; preloader = new Preloader(Path.GetDirectoryName(assemblyPath)); preloader.Preload(); TestPathResolver pathResolver = null; var preloadedLibraries = new List <string>(); GetLibrariesToPreload(preloadedLibraries); if (preloadedLibraries.Any()) { // Only when any library needs preloading will a path resolver be // created, otherwise DynamoModel gets created without preloading // any library. // var pathResolverParams = new TestPathResolverParams() { UserDataRootFolder = GetUserUserDataRootFolder(), CommonDataRootFolder = GetCommonDataRootFolder() }; pathResolver = new TestPathResolver(pathResolverParams); foreach (var preloadedLibrary in preloadedLibraries.Distinct()) { pathResolver.AddPreloadLibraryPath(preloadedLibrary); } } var model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { PathResolver = pathResolver, StartInTestMode = true, GeometryFactoryPath = preloader.GeometryFactoryPath, ProcessMode = TaskProcessMode.Synchronous }); var watch3DViewParams = new Watch3DViewModelStartupParams(model); this.ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = model, Watch3DViewModel = new DefaultWatch3DViewModel(null, watch3DViewParams) }); Assert.AreEqual(ViewModel.Model.State, DynamoModel.DynamoModelState.StartedUIless); this.ViewModel.RequestUserSaveWorkflow += RequestUserSaveWorkflow; }
//public void SetupDynamo(out DynamoViewModel viewModel) public void SetupDynamo( ) { SubscribeAssemblyResolvingEvent(); UpdateSystemPathForProcess(); PreloadDynamoCoreDlls(); var corePath = DynamoCorePath; var dynamoMayaExeLoc = Assembly.GetExecutingAssembly().Location; var dynamoMayaRoot = Path.GetDirectoryName(dynamoMayaExeLoc); var userDataFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Dynamo", "Dynamo Core"); var commonDataFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Dynamo", "Dynamo Core"); var geometryFactoryPath = string.Empty; var preloaderLocation = string.Empty; var loadedLibGVersion = PreloadAsmFromMayaATF(); try { if (isDynModelNull) { DynModel = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration { DynamoCorePath = corePath, DynamoHostPath = corePath, GeometryFactoryPath = GetGeometryFactoryPath(corePath, loadedLibGVersion), PathResolver = new PathResolver(userDataFolder, commonDataFolder), }); isDynModelNull = false; } if (isDynViewModelNull) { DynViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration { // CommandFilePath = commandFilePath, DynamoModel = DynModel }); isDynViewModelNull = false; } } catch (Exception e) { MGlobal.displayWarning(e.Message); } }
public void SetPythonTemplateFromConfigWithInvalidPath() { var templatePath = Path.Combine(@"C:\Users\SomeDynamoUser\Desktop", "PythonTemplate-initial.py"); var config = new DynamoModel.DefaultStartConfiguration() { PythonTemplatePath = templatePath }; var model = DynamoModel.Start(config); Assert.AreEqual(model.PreferenceSettings.PythonTemplateFilePath, string.Empty); }
public void SetPythonTemplateFromConfigWithValidPath() { var templatePath = Path.Combine(SettingDirectory, "PythonTemplate-initial.py"); var config = new DynamoModel.DefaultStartConfiguration() { PythonTemplatePath = templatePath }; var model = DynamoModel.Start(config); Assert.AreEqual(model.PreferenceSettings.PythonTemplateFilePath, templatePath); }
// Test checks png images. If at least one icon is not presented, test fails. public void SearchForPNGFiles() { var model = DynamoModel.Start(); IEnumerable searchEntries = model.SearchModel.SearchEntries.OfType <NodeSearchElement>(); IconServices iconServices = new IconServices(model.PathManager); IconWarehouse currentWarehouse = null; var currentWarehouseAssembly = string.Empty; List <String> missingIcons = new List <string>(); foreach (var entry in searchEntries) { var searchEle = entry as NodeSearchElement; if (String.IsNullOrEmpty(searchEle.IconName)) { continue; } var smallIconName = searchEle.IconName + Configurations.SmallIconPostfix; var largeIconName = searchEle.IconName + Configurations.LargeIconPostfix; // Only retrieve the icon warehouse for different assembly. if (currentWarehouseAssembly != searchEle.Assembly) { currentWarehouseAssembly = searchEle.Assembly; currentWarehouse = iconServices.GetForAssembly(searchEle.Assembly); } ImageSource smallIcon = null; ImageSource largeIcon = null; if (currentWarehouse != null) { smallIcon = currentWarehouse.LoadIconInternal(smallIconName); largeIcon = currentWarehouse.LoadIconInternal(largeIconName); } if (smallIcon == null) { missingIcons.Add(smallIconName); } if (largeIcon == null) { missingIcons.Add(largeIconName); } } Assert.IsTrue(missingIcons.Count == 0, String.Join(Environment.NewLine, missingIcons)); model.ShutDown(false); }
protected override void StartDynamo(TestSessionConfiguration testConfig) { var preloader = new Preloader(testConfig.DynamoCorePath, testConfig.RequestedLibraryVersion); preloader.Preload(); var preloadedLibraries = new List <string>(); GetLibrariesToPreload(preloadedLibraries); if (preloadedLibraries.Any()) { if (pathResolver == null) { pathResolver = new TestPathResolver(); } var pr = pathResolver as TestPathResolver; foreach (var preloadedLibrary in preloadedLibraries.Distinct()) { pr.AddPreloadLibraryPath(preloadedLibrary); } } Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, UpdateManager = this.UpdateManager, ProcessMode = TaskProcessMode.Synchronous }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model, Watch3DViewModel = HelixWatch3DViewModel.TryCreateHelixWatch3DViewModel( null, new Watch3DViewModelStartupParams(Model), Model.Logger) }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
public virtual void Start() { var assemblyPath = Assembly.GetExecutingAssembly().Location; preloader = new Preloader(Path.GetDirectoryName(assemblyPath)); preloader.Preload(); CreateTemporaryFolder(); // Setup Temp PreferenceSetting Location for testing PreferenceSettings.DynamoTestPath = Path.Combine(TempFolder, "UserPreferenceTest.xml"); TestPathResolver pathResolver = null; var preloadedLibraries = new List <string>(); GetLibrariesToPreload(preloadedLibraries); if (preloadedLibraries.Any()) { // Only when any library needs preloading will a path resolver be // created, otherwise DynamoModel gets created without preloading // any library. // pathResolver = new TestPathResolver(); foreach (var preloadedLibrary in preloadedLibraries.Distinct()) { pathResolver.AddPreloadLibraryPath(preloadedLibrary); } } Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, ProcessMode = Dynamo.Core.Threading.TaskProcessMode.Synchronous }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
public void Init() { extensionsPath = Path.Combine(Directory.GetCurrentDirectory(), "extensions"); extMock = new Mock <IExtension>(); model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { extMock.Object } }); }
public void Init() { extensionsPath = Path.Combine(Directory.GetCurrentDirectory(), "extensions"); extMock = new Mock <IExtension>(); model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { extMock.Object }, ProcessMode = Core.Threading.TaskProcessMode.Synchronous }); }
private static DynamoModel StartDynamoWithDefaultConfig(bool CLImode, string geometryFactoryPath, string preloaderLocation) { var config = new DynamoModel.DefaultStartConfiguration() { GeometryFactoryPath = geometryFactoryPath, ProcessMode = TaskProcessMode.Asynchronous }; config.UpdateManager = CLImode ? null : InitializeUpdateManager(); config.StartInTestMode = CLImode ? true : false; config.PathResolver = CLImode ? new CLIPathResolver(preloaderLocation) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver; var model = DynamoModel.Start(config); return(model); }
public DynamoModel MakeModel() { var geometryFactoryPath = string.Empty; var config = new DynamoModel.DefaultStartConfiguration() { GeometryFactoryPath = geometryFactoryPath, ProcessMode = TaskProcessMode.Asynchronous }; config.PathResolver = new SandboxPathResolver() as IPathResolver; var model = DynamoModel.Start(config); return(model); }
public void Init() { extMock = new Mock <IExtension>(); extMock.Setup(ext => ext.Ready(It.IsAny <ReadyParams>())).Callback((ReadyParams r) => ExtensionReadyCallback(r)); cmdExecutionState = -1; model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { extMock.Object }, ProcessMode = TaskProcessMode.Synchronous, }); //Setting this flag to true will enable to execute a specific section in the ExecuteCommand() method model.DebugSettings.VerboseLogging = true; }
protected virtual void StartDynamo(TestSessionConfiguration testConfig) { preloader = new Preloader(testConfig.DynamoCorePath, testConfig.RequestedLibraryVersion); preloader.Preload(); var preloadedLibraries = new List <string>(); GetLibrariesToPreload(preloadedLibraries); if (preloadedLibraries.Any()) { if (pathResolver == null) { pathResolver = new TestPathResolver(); } var pr = pathResolver as TestPathResolver; foreach (var preloadedLibrary in preloadedLibraries.Distinct()) { pr.AddPreloadLibraryPath(preloadedLibrary); } } Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, UpdateManager = this.UpdateManager }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); //create the view View = new DynamoView(ViewModel); View.Show(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
protected void RunCommandsFromFile(string commandFileName, bool autoRun = false, CommandCallback commandCallback = null) { string commandFilePath = SystemTestBase.GetTestDirectory(ExecutingDirectory); commandFilePath = Path.Combine(commandFilePath, @"core\recorded\"); commandFilePath = Path.Combine(commandFilePath, commandFileName); if (this.ViewModel != null) { var message = "Multiple DynamoViewModel instances detected!"; throw new InvalidOperationException(message); } var model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = model, CommandFilePath = commandFilePath }); ViewModel.HomeSpace.RunSettings.RunType = autoRun ? RunType.Automatic : RunType.Manual; RegisterCommandCallback(commandCallback); // Create the view. var dynamoView = new DynamoView(this.ViewModel); dynamoView.ShowDialog(); Assert.IsNotNull(ViewModel); Assert.IsNotNull(ViewModel.Model); Assert.IsNotNull(ViewModel.Model.CurrentWorkspace); workspace = ViewModel.Model.CurrentWorkspace; workspaceViewModel = ViewModel.CurrentSpaceViewModel; }
public void Init() { extensionsPath = Path.Combine(Directory.GetCurrentDirectory(), "extensions"); extMock = new Mock <IExtension>(); extMock.Setup(ext => ext.Ready(It.IsAny <ReadyParams>())).Callback((ReadyParams r) => ExtensionReadyCallback(r)); cmdExecutionState = -1; model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = true, Extensions = new List <IExtension> { extMock.Object }, ProcessMode = TaskProcessMode.Synchronous }); model.ExtensionManager.ExtensionAdded += OnExtensionAdded; model.ExtensionManager.ExtensionRemoved += OnExtensionRemoved; }
private void RestartTestSetup(bool startInTestMode) { // Shutdown Dynamo and restart it View.Close(); View = null; if (ViewModel != null) { var shutdownParams = new DynamoViewModel.ShutdownParams( shutdownHost: false, allowCancellation: false); ViewModel.PerformShutdownSequence(shutdownParams); ViewModel = null; } // Setup Temp PreferenceSetting Location for testing PreferenceSettings.DynamoTestPath = Path.Combine(TempFolder, "UserPreferenceTest.xml"); Model = DynamoModel.Start( new DynamoModel.DefaultStartConfiguration() { StartInTestMode = startInTestMode, ProcessMode = startInTestMode ? TaskProcessMode.Synchronous : TaskProcessMode.Asynchronous }); ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = Model }); var expectedState = startInTestMode ? DynamoModel.DynamoModelState.StartedUIless : DynamoModel.DynamoModelState.StartedUI; Assert.AreEqual(ViewModel.Model.State, expectedState); //create the view View = new DynamoView(ViewModel); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); }
protected void StartDynamo() { DynamoPathManager.Instance.InitializeCore( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); DynamoPathManager.Instance.PreloadASMLibraries(); var model = DynamoModel.Start( new DynamoModel.StartConfiguration() { StartInTestMode = true }); this.ViewModel = DynamoViewModel.Start( new DynamoViewModel.StartConfiguration() { DynamoModel = model }); }
public static DynamoModel MakeModel(bool CLImode) { var geometryFactoryPath = string.Empty; var preloaderLocation = string.Empty; PreloadShapeManager(ref geometryFactoryPath, ref preloaderLocation); var config = new DynamoModel.DefaultStartConfiguration() { GeometryFactoryPath = geometryFactoryPath, }; config.UpdateManager = CLImode ? null : InitializeUpdateManager(); config.StartInTestMode = CLImode ? true : false; config.PathResolver = CLImode ? new CLIPathResolver(preloaderLocation) as IPathResolver : new SandboxPathResolver(preloaderLocation) as IPathResolver; var model = DynamoModel.Start(config); return(model); }