Exemple #1
0
        public bool Add(CustomNodeInfo nodeInfo)
        {
            var nodeEle = new CustomNodeSearchElement(nodeInfo);

            nodeEle.Executed += this.OnExecuted;

            if (SearchDictionary.Contains(nodeEle))
            {
                return(this.Refactor(nodeInfo));
            }

            SearchDictionary.Add(nodeEle, nodeEle.Name);
            SearchDictionary.Add(nodeEle, nodeInfo.Category + "." + nodeEle.Name);

            TryAddCategoryAndItem(nodeInfo.Category, nodeEle);

            return(true);
        }
Exemple #2
0
        /// <summary>
        ///     Add a custom node to search.
        /// </summary>
        /// <param name="workspace">A dynWorkspace to add</param>
        /// <param name="name">The name to use</param>
        public void Add(string name, string category, string description, Guid functionId)
        {
            if (name == "Home")
            {
                return;
            }

            // create the node in search
            var nodeEle = new NodeSearchElement(name, description, functionId);

            if (SearchDictionary.Contains(nodeEle))
            {
                return;
            }

            SearchDictionary.Add(nodeEle, nodeEle.Name);
            SearchDictionary.Add(nodeEle, category + "." + nodeEle.Name);

            TryAddCategoryAndItem(category, nodeEle);

            NodeCategories[category].NumElements++;
        }