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 = TaskProcessMode.Synchronous
                });

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

            //create the view
            View = new DynamoView(ViewModel);
            View.Show();

            SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
        }
Exemple #2
0
        public override void Setup()
        {
            base.Setup();

            libraryCore = new ProtoCore.Core(new Options { RootCustomPropertyFilterPathName = string.Empty });
            libraryCore.Compilers.Add(Language.kAssociative, new ProtoAssociative.Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.kImperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            var pathResolver = new TestPathResolver();
            pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");

            var pathManager = new PathManager(new PathManagerParams
            {
                PathResolver = pathResolver
            });

            libraryServices = new LibraryServices(libraryCore, pathManager);

            RegisterEvents();
        }
        public override void Setup()
        {
            base.Setup();

            libraryCore = new ProtoCore.Core(new Options());
            libraryCore.Compilers.Add(Language.Associative, new ProtoAssociative.Compiler(libraryCore));
            libraryCore.Compilers.Add(Language.Imperative, new ProtoImperative.Compiler(libraryCore));
            libraryCore.ParsingMode = ParseMode.AllowNonAssignment;

            var pathResolver = new TestPathResolver();
            pathResolver.AddPreloadLibraryPath("DSCoreNodes.dll");

            var pathManager = new PathManager(new PathManagerParams
            {
                PathResolver = pathResolver
            });

            var settings = new PreferenceSettings();

            libraryServices = new LibraryServices(libraryCore, pathManager, settings);

            RegisterEvents();
        }
        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 = Core.Threading.TaskProcessMode.Synchronous
                });

            var watch3DViewParams = new Watch3DViewModelStartupParams(model);
            this.ViewModel = DynamoViewModel.Start(
                new DynamoViewModel.StartConfiguration()
                {
                    DynamoModel = model,
                    Watch3DViewModel = new DefaultWatch3DViewModel(watch3DViewParams)
                });

            this.ViewModel.RequestUserSaveWorkflow += RequestUserSaveWorkflow;
        }
Exemple #5
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
                });
        }