/// <summary> /// Performs the pattern replace, using the search and replace parameters from search Control and replace Control</summary> public override void DoReplace() { if (DomNodeSearchToolStrip != null && DomNodeSearchToolStrip.QueryWithEmptyFields) { return; //Do nothing } if (DomNodeSearchToolStrip != null && DomNodeSearchToolStrip.QueryDirty) { DomNodeSearchToolStrip.DoSearch(); } base.DoReplace(); }
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(); }