Exemple #1
0
        private bool IsCustomNodeFromPackageInUse(DynamoModel dynamoModel)
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.FunctionId);

            // check if any of the custom nodes is in a workspace
            return
                (dynamoModel.Workspaces.SelectMany(ws => ws.Nodes.OfType <Function>())
                 .Any(x => guids.Contains(x.Definition.FunctionId)));
        }
Exemple #2
0
        private bool IsWorkspaceFromPackageOpen(DynamoModel dynamoModel)
        {
            // get all of the function ids from the custom nodes in this package
            var guids = new HashSet <Guid>(LoadedCustomNodes.Select(x => x.FunctionId));

            return
                (dynamoModel.Workspaces.OfType <CustomNodeWorkspaceModel>()
                 .Select(x => x.CustomNodeId)
                 .Any(guids.Contains));
        }
Exemple #3
0
        private bool IsCustomNodeFromPackageInUse(DynamoModel dynamoModel)
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.Guid);

            // check if any of the custom nodes is in a workspace
            return(dynamoModel.AllNodes.Where(x => x is Function)
                   .Cast <Function>()
                   .Any(x => guids.Contains(x.Definition.FunctionId)));
        }
Exemple #4
0
        public bool CustomNodeInWorkspace()
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.Guid);

            // check if any of the custom nodes is in a workspace
            return(dynSettings.Controller.DynamoModel.AllNodes.Where(x => x is Function)
                   .Cast <Function>()
                   .Any(x => guids.Contains(x.Definition.FunctionId)));
        }
Exemple #5
0
        public bool InUse()
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.Guid);

            // check if any of the custom nodes is in a workspace
            var customNodeInUse = dynSettings.Controller.DynamoViewModel.AllNodes.Where(x => x is dynFunction)
                                  .Cast <dynFunction>()
                                  .Any(x => guids.Contains(x.Definition.FunctionId));

            return((LoadedTypes.Any() || customNodeInUse) && Loaded);
        }
Exemple #6
0
        private bool IsWorkspaceFromPackageOpen(DynamoModel dynamoModel)
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.Guid);

            return
                (dynamoModel.Workspaces.Any(
                     x =>
            {
                var def = dynamoModel.CustomNodeManager.GetDefinitionFromWorkspace(x);
                return def != null && guids.Contains(def.FunctionId);
            }));
        }
Exemple #7
0
        public bool WorkspaceOpen()
        {
            // get all of the function ids from the custom nodes in this package
            var guids = LoadedCustomNodes.Select(x => x.Guid);

            return
                (dynSettings.Controller.DynamoModel.Workspaces.Any(
                     x =>
            {
                var def = dynSettings.CustomNodeManager.GetDefinitionFromWorkspace(x);
                return def != null && guids.Contains(def.FunctionId);
            }));
        }