Ejemplo n.º 1
0
        void SetupSearch()
        {
            searchIndex = Program.Root.GetSearchIndex();
            indexSearch = new IndexSearcher(Program.IndexUpdateManager.IsFresh ? Program.Root.GetIndex() : null);

            searchInput = new SearchTextBox(searchBox.TextBox);
            searchInput.SearchTextChanged    += SearchCallback;
            indexSearchBox.SearchTextChanged += IndexSearchCallback;
            indexLoadingNode = new AnimatedTreeNode(indexListResults.Nodes [0]);
            indexLoadingNode.StartAnimation();
            tabContainer.Selected += (s, e) => {
                if (tabContainer.SelectedIndex == 1 && !indexPageLoaded)
                {
                    FillUpIndex();
                    indexPageLoaded = true;
                }
                if (match != null && ShowNodeInTree(match))
                {
                    docTree.SelectedNode = nodeToTreeNodeMap[match];
                    match = null;
                }
            };
            indexListResults.AfterSelect += (s, e) => {
                var entry = e.Node.Tag as IndexEntry;
                if (entry.Count == 1)
                {
                    LoadUrl(entry[0].Url);
                }
                else
                {
                    LoadMultipleMatchData(entry);
                    indexSplitContainer.Panel2Collapsed = false;
                    e.Node.EnsureVisible();
                }
            };
            multipleMatchList.AfterSelect += (s, e) => {
                var topic = e.Node.Tag as Topic;
                LoadUrl(topic.Url);
                multipleMatchList.SelectedNode = e.Node;
            };
            searchListResults.DrawNode     += CustomDrawing.DrawSearchResultNodeText;
            searchListResults.BeforeSelect += (s, e) => e.Cancel = e.Node.Tag == null;
            searchListResults.AfterSelect  += (s, e) => {
                var entry = e.Node.Tag as ResultDataEntry;
                LoadUrl(entry.ResultSet.GetUrl(entry.Index));
            };
        }
Ejemplo n.º 2
0
		void SetupSearch ()
		{
			searchIndex = Program.Root.GetSearchIndex ();
			indexSearch = new IndexSearcher (Program.IndexUpdateManager.IsFresh ? Program.Root.GetIndex () : null);

			searchInput = new SearchTextBox (searchBox.TextBox);
			searchInput.SearchTextChanged += SearchCallback;
			indexSearchBox.SearchTextChanged += IndexSearchCallback;
			indexLoadingNode = new AnimatedTreeNode (indexListResults.Nodes [0]);
			indexLoadingNode.StartAnimation ();
			tabContainer.Selected += (s, e) => {
				if (tabContainer.SelectedIndex == 1 && !indexPageLoaded) {
					FillUpIndex ();
					indexPageLoaded = true;
				}
				if (match != null && ShowNodeInTree (match)) {
					docTree.SelectedNode = nodeToTreeNodeMap[match];
					match = null;
				}
			};
			indexListResults.AfterSelect += (s, e) => {
				var entry = e.Node.Tag as IndexEntry;
				if (entry.Count == 1) {
					LoadUrl (entry[0].Url);
				} else {
					LoadMultipleMatchData (entry);
					indexSplitContainer.Panel2Collapsed = false;
					e.Node.EnsureVisible ();
				}
			};
			multipleMatchList.AfterSelect += (s, e) => {
				var topic = e.Node.Tag as Topic;
				LoadUrl (topic.Url);
				multipleMatchList.SelectedNode = e.Node;
			};
			searchListResults.DrawNode += CustomDrawing.DrawSearchResultNodeText;
			searchListResults.BeforeSelect += (s, e) => e.Cancel = e.Node.Tag == null;
			searchListResults.AfterSelect += (s, e) => {
				var entry = e.Node.Tag as ResultDataEntry;
				LoadUrl (entry.ResultSet.GetUrl (entry.Index));
			};
		}