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