public DomNodePropertySearchService( IContextRegistry contextRegistry, IControlHostService controlHostService) { m_contextRegistry = contextRegistry; m_controlHostService = controlHostService; // define root control m_rootControl = new UserControl(); m_rootControl.Name = "Search and Replace"; m_rootControl.SuspendLayout(); m_rootControl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; // Create and add the search input control var domNodeSearchToolStrip = new DomNodeSearchToolStrip(); SearchUI = domNodeSearchToolStrip; SearchUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(SearchUI.Control); SearchUI.UIChanged += UIElement_Changed; _clearButton = new Button() { Text = "Clear" }; _clearButton.Click += (object sender, EventArgs args) => { m_contextRegistry.GetActiveContext <IQueryableContext>().Query(null); }; _clearButton.Dock = DockStyle.None; _clearButton.AutoSize = true; _clearButton.FlatStyle = FlatStyle.Flat; _clearButton.FlatAppearance.BorderSize = 0; m_rootControl.Controls.Add(_clearButton); // Create and add the replace input control var domNodeReplaceToolStrip = new DomNodeReplaceToolStrip(); // hack -- we can't set this property, because it's marked as "internal" in the // ATF library // domNodeReplaceToolStrip.DomNodeSearchToolStrip = domNodeSearchToolStrip; ReplaceUI = domNodeReplaceToolStrip; ReplaceUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(ReplaceUI.Control); ReplaceUI.UIChanged += UIElement_Changed; // Create and add the results output control ResultsUI = new DomNodeSearchResultsListView(m_contextRegistry); ResultsUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(ResultsUI.Control); ResultsUI.UIChanged += UIElement_Changed; m_rootControl.Layout += controls_Layout; m_rootControl.ResumeLayout(); }
public DomNodePropertySearchService( IContextRegistry contextRegistry, IControlHostService controlHostService) { m_contextRegistry = contextRegistry; m_controlHostService = controlHostService; // define root control m_rootControl = new UserControl(); m_rootControl.Name = "Search and Replace"; m_rootControl.SuspendLayout(); m_rootControl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; // Create and add the search input control var domNodeSearchToolStrip = new DomNodeSearchToolStrip(); SearchUI = domNodeSearchToolStrip; SearchUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(SearchUI.Control); SearchUI.UIChanged += UIElement_Changed; // Create and add the replace input control var domNodeReplaceToolStrip = new DomNodeReplaceToolStrip(); domNodeReplaceToolStrip.DomNodeSearchToolStrip = domNodeSearchToolStrip; ReplaceUI = domNodeReplaceToolStrip; ReplaceUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(ReplaceUI.Control); ReplaceUI.UIChanged += UIElement_Changed; // Create and add the results output control ResultsUI = new DomNodeSearchResultsListView(m_contextRegistry); ResultsUI.Control.Dock = DockStyle.None; m_rootControl.Controls.Add(ResultsUI.Control); ResultsUI.UIChanged += UIElement_Changed; m_rootControl.Layout += controls_Layout; m_rootControl.ResumeLayout(); }