Esempio n. 1
0
        public PackageLoader(DynamoLoader dynamoLoader, ILogger logger, string overridePackageDirectory)
        {
            this.loader = dynamoLoader;
            this.logger = logger;

            this.RootPackagesDirectory = overridePackageDirectory;
            if (!Directory.Exists(this.RootPackagesDirectory))
            {
                Directory.CreateDirectory(this.RootPackagesDirectory);
            }
        }
Esempio n. 2
0
 public PackageLoader(DynamoLoader dynamoLoader, ILogger logger)
     : this(dynamoLoader, logger, Path.Combine(DynamoPathManager.Instance.MainExecPath, DynamoPathManager.Instance.Packages))
 {
 }
Esempio n. 3
0
 private void LoadCustomNodesIntoDynamo( DynamoLoader loader)
 {
     loader.LoadCustomNodes(CustomNodeDirectory).ForEach(x => LoadedCustomNodes.Add(x));
 }
Esempio n. 4
0
        private void LoadAssembliesIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
        {
            var assemblies = LoadAssembliesInBinDirectory(logger);

            // filter the assemblies
            var zeroTouchAssemblies = new List<Assembly>();
            var nodeModelAssemblies = new List<Assembly>();

            foreach (var assem in assemblies)
            {
                if (loader.ContainsNodeModelSubType(assem))
                {
                    nodeModelAssemblies.Add(assem);
                }
                else
                {
                    zeroTouchAssemblies.Add(assem);
                }
            }

            // load the zero touch assemblies
            foreach (var zeroTouchAssem in zeroTouchAssemblies)
            {
                libraryServices.ImportLibrary(zeroTouchAssem.Location, logger);
            }

            // load the node model assemblies
            foreach (var nodeModelAssem in nodeModelAssemblies)
            {
                var nodes = loader.LoadNodesFromAssembly(nodeModelAssem);
                nodes.ForEach(x => LoadedTypes.Add(x));
            }
        }
Esempio n. 5
0
        public void LoadIntoDynamo( DynamoLoader loader, ILogger logger, LibraryServices libraryServices)
        {
            try
            {
                this.LoadAssembliesIntoDynamo(loader, logger, libraryServices);
                this.LoadCustomNodesIntoDynamo( loader );
                this.EnumerateAdditionalFiles();
                
                Loaded = true;
            }
            catch (Exception e)
            {
                logger.Log("Exception when attempting to load package " + this.Name + " from " + this.RootDirectory);
                logger.Log(e.GetType() + ": " + e.Message);
            }

        }