private void UpdateView() { string query = FSearchTextBox.Text.ToLower(); FHierarchyViewer.BeginUpdate(); try { FNodeView.Dispose(); if (NodeFilter.IsGlobalSearchScope(query)) { FNodeView = FNodeFilter.UpdateFilter(query, FHDEHost.RootNode); FHierarchyViewer.ShowRoot = false; } else { FNodeView = FNodeFilter.UpdateFilter(query, FActivePatchNode); FHierarchyViewer.ShowRoot = true; } FHierarchyViewer.Input = FNodeView; } finally { FHierarchyViewer.EndUpdate(); } }
public FinderPluginNode(IHDEHost host, IPluginHost2 pluginHost, [Config("Tags")] IDiffSpread <string> tagsPin) { // The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); FHDEHost = host; FPluginHost = pluginHost; FSearchTextBox.ContextMenu = new ContextMenu(); FSearchTextBox.ContextMenu.Popup += FSearchTextBox_ContextMenu_Popup; FSearchTextBox.MouseWheel += FSearchTextBox_MouseWheel; FMappingRegistry = new MappingRegistry(); FMappingRegistry.RegisterDefaultMapping <INamed, DefaultNameProvider>(); FHierarchyViewer.Registry = FMappingRegistry; FTagsPin = tagsPin; FTagsPin.Changed += HandleTagsPinChanged; FNodeFilter = new NodeFilter(); FNodeView = FNodeFilter.UpdateFilter(string.Empty, FHDEHost.RootNode); FHDEHost.WindowSelectionChanged += HandleWindowSelectionChanged; //defer setting the active patch window as //this will trigger the initial WindowSelectionChangeCB //which will want to access this windows caption which is not yet available SynchronizationContext.Current.Post((object state) => HandleWindowSelectionChanged(FHDEHost, new WindowEventArgs(FHDEHost.ActivePatchWindow)), null); }