Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        protected virtual void StartDynamo(IPreferences settings = null)
        {
            var assemblyPath = Assembly.GetExecutingAssembly().Location;

            preloader = new Preloader(Path.GetDirectoryName(assemblyPath));
            preloader.Preload();

            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);
                }
            }

            this.CurrentDynamoModel = DynamoModel.Start(CreateStartConfiguration(settings));
        }
Esempio n. 4
0
        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());
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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());
        }
Esempio n. 7
0
        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());
        }
Esempio n. 8
0
        //............................

        private static void PreloadShapeManager(out string geometryFactoryPath, out string preloaderLocation)
        {
            var exePath    = Assembly.GetExecutingAssembly().Location;
            var rootFolder = Path.GetDirectoryName(exePath);

            var versions = new Version[]
            {
                new Version(223, 0, 1),
            };

            var preloader = new Preloader(rootFolder, versions);

            preloader.Preload();
            geometryFactoryPath = preloader.GeometryFactoryPath;
            preloaderLocation   = preloader.PreloaderLocation;
        }
Esempio n. 9
0
        public static void PreloadShapeManager(ref string geometryFactoryPath, ref string preloaderLocation)
        {
            var exePath    = Assembly.GetExecutingAssembly().Location;
            var rootFolder = Path.GetDirectoryName(exePath);

            var versions = new[]
            {
                LibraryVersion.Version220,
                LibraryVersion.Version221
            };

            var preloader = new Preloader(rootFolder, versions);

            preloader.Preload();
            geometryFactoryPath = preloader.GeometryFactoryPath;
            preloaderLocation   = preloader.PreloaderLocation;
        }
Esempio n. 10
0
        protected void StartDynamo()
        {
            var assemblyPath = Assembly.GetExecutingAssembly().Location;

            preloader = new Preloader(Path.GetDirectoryName(assemblyPath));
            preloader.Preload();

            schedulerThread = new SampleSchedulerThread();
            dynamoModel     = DynamoModel.Start(
                new DynamoModel.DefaultStartConfiguration()
            {
                // See documentation for 'SchedulerIntegrationTests' above.
                StartInTestMode     = false,
                SchedulerThread     = schedulerThread,
                GeometryFactoryPath = preloader.GeometryFactoryPath
            });
        }
Esempio n. 11
0
 private void mbtnTestConnection_Click(object sender, EventArgs e)
 {
     try
     {
         FormHelpers.CursorWait(true);
         TestConnection();
         Preloader.Preload();
         MessageHelpers.ShowInfo("Test connection successful.");
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Esempio n. 12
0
        private static void InitializeCore()
        {
            if (initializedCore)
            {
                return;
            }

            string path = System.Environment.GetEnvironmentVariable("PATH");

            System.Environment.SetEnvironmentVariable("PATH", path + ";" + DynamoAdvanceSteelApplication.DynamoCorePath);

            var preloader = new Preloader(DynamoAdvanceSteelApplication.DynamoCorePath, DynamoAdvanceSteelApplication.ACADCorePath, LibraryVersion.Version222);

            preloader.Preload();
            GeometryFactoryPath = preloader.GeometryFactoryPath;

            initializedCore = true;
        }
Esempio n. 13
0
        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());
        }
Esempio n. 14
0
        public static void PreloadShapeManager(ref string geometryFactoryPath, ref string preloaderLocation)
        {
            var exePath    = Assembly.GetExecutingAssembly().Location;
            var rootFolder = Path.GetDirectoryName(exePath);

            var versions = new[]
            {
                new Version(226, 0, 0),
                new Version(225, 0, 0),
                new Version(224, 4, 0),
                new Version(224, 0, 1)
            };

            var preloader = new Preloader(rootFolder, versions);

            preloader.Preload();
            geometryFactoryPath = preloader.GeometryFactoryPath;
            preloaderLocation   = preloader.PreloaderLocation;
        }
        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.
                //
                pathResolver = new TestPathResolver();
                foreach (var preloadedLibrary in preloadedLibraries.Distinct())
                {
                    pathResolver.AddPreloadLibraryPath(preloadedLibrary);
                }
            }

            var model = DynamoModel.Start(
                new DynamoModel.DefaultStartConfiguration()
            {
                PathResolver        = pathResolver,
                StartInTestMode     = true,
                GeometryFactoryPath = preloader.GeometryFactoryPath
            });

            this.ViewModel = DynamoViewModel.Start(
                new DynamoViewModel.StartConfiguration()
            {
                DynamoModel = model
            });

            this.ViewModel.RequestUserSaveWorkflow += RequestUserSaveWorkflow;
        }
Esempio n. 16
0
        public object GetConfigValue(string config)
        {
            if (string.Compare(ConfigurationKeys.GeometryFactory, config) == 0)
            {
                if (preloader == null)
                {
                    var exePath = Assembly.GetExecutingAssembly().Location;
                    preloader = new Preloader(Path.GetDirectoryName(exePath));
                    preloader.Preload();
                }

                return(preloader.GeometryFactoryPath);
            }

            if (configValues.ContainsKey(config))
            {
                return(configValues[config]);
            }

            return(null);
        }
Esempio n. 17
0
        private static void TestConnection()
        {
            Thread t = new Thread(new ThreadStart(Loading));

            t.Start(); //open splash
            try
            {
                CompanyBAL compbal;
                compbal = new CompanyBAL();
                AppSettings.CompanyProfile = compbal.GetByID(1);
                AppSettings.AppConnected   = true;
                Preloader.Preload(); //Preload Report
                //Cache.Refresh();
                t.Abort();           //close splash
            }
            catch (Exception ex)
            {
                t.Abort(); //close splash
                MessageHelpers.ShowError(ex.Message);
                AppSettings.AppConnected = false;
            }
        }
Esempio n. 18
0
        public object GetConfigValue(string config)
        {
            if (string.Compare(ConfigurationKeys.GeometryFactory, config) == 0)
            {
                if (preloader != null)
                {
                    return(preloader.GeometryFactoryPath);
                }

                preloader = new Preloader(testConfig.DynamoCorePath, new[] { testConfig.RequestedLibraryVersion2 });
                preloader.Preload();

                return(preloader.GeometryFactoryPath);
            }

            if (configValues.ContainsKey(config))
            {
                return(configValues[config]);
            }

            return(null);
        }
Esempio n. 19
0
        protected void StartDynamo()
        {
            var assemblyPath = Assembly.GetExecutingAssembly().Location;

            preloader = new Preloader(Path.GetDirectoryName(assemblyPath));
            preloader.Preload();

            var model = DynamoModel.Start(
                new DynamoModel.DefaultStartConfiguration()
            {
                PathResolver        = pathResolver,
                StartInTestMode     = true,
                GeometryFactoryPath = preloader.GeometryFactoryPath
            });

            this.ViewModel = DynamoViewModel.Start(
                new DynamoViewModel.StartConfiguration()
            {
                DynamoModel = model
            });

            this.ViewModel.RequestUserSaveWorkflow += RequestUserSaveWorkflow;
        }
Esempio n. 20
0
        protected void StartDynamo()
        {
            var assemblyPath = Assembly.GetExecutingAssembly().Location;

            preloader = new Preloader(Path.GetDirectoryName(assemblyPath));
            preloader.Preload();

            var pathResolver = new TestPathResolver();

            pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");

            schedulerThread = new SampleSchedulerThread();
            dynamoModel     = DynamoModel.Start(
                new DynamoModel.DefaultStartConfiguration()
            {
                // See documentation for 'SchedulerIntegrationTests' above.
                StartInTestMode     = false,
                SchedulerThread     = schedulerThread,
                PathResolver        = pathResolver,
                GeometryFactoryPath = preloader.GeometryFactoryPath,
                ProcessMode         = TaskProcessMode.Asynchronous
            });
        }
Esempio n. 21
0
 private void _PreloadResources()
 {
     Preloader.Preload();
 }