Beispiel #1
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, Guid functionId)
        {
            if (name == "Home")
                return;

            // create the workspace in search
            var workspaceEle = new WorkspaceSearchElement(name, "Navigate to workspace called " + name);
            workspaceEle.Guid = functionId;

            if (!NodeCategories.ContainsKey(category))
            {
                NodeCategories.Add(category, new CategorySearchElement(category));
            }

            NodeCategories[category].NumElements++;

            SearchDictionary.Add(workspaceEle, workspaceEle.Name);

            // create the node in search
            var nodeEle = new LocalSearchElement(name, functionId);
            SearchDictionary.Add(nodeEle, nodeEle.Name);
            SearchDictionary.Add(nodeEle, category + "." + nodeEle.Name);
        }
Beispiel #2
0
        /// <summary>
        ///     Adds a Workspace object with a given Name
        /// </summary>
        /// <param name="workspace">A dynWorkspace to add</param>
        /// <param name="name">The name to use</param>
        public void Add(dynWorkspace workspace, string name)
        {
            if (name == "Home")
                return;

            // create the workspace in search
            var searchEle = new WorkspaceSearchElement(name, "Go to " + name );
            var funcDef = dynSettings.Controller.CustomNodeLoader.GetDefinitionFromWorkspace(workspace);
            searchEle.Guid = funcDef.FunctionId;

            if (searchEle.Guid == Guid.Empty)
                return;

            SearchDictionary.Add(searchEle, searchEle.Name);

            // create the node in search
            var nodeEle = new LocalSearchElement(funcDef);
            SearchDictionary.Add(nodeEle, name);

            // update search
            SearchAndUpdateResultsSync(SearchText);
        }