Ejemplo n.º 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)));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }));
        }
Ejemplo n.º 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);
            }));
        }