In This Article

SearchViewBase Class

Provides the abstract base class for a view with editor-searching UI.

public abstract class SearchViewBase : UIControl, IUIControl, IUIElement, ILogicalTreeNode, IDisposable, INotifyPropertyChanged
Inheritance:
Object UIControl Object
Derived:
SearchOverlayPane
Implements:
IUIControl IUIElement ILogicalTreeNode IDisposable

Constructors

SearchViewBase()

Initializes an instance of the SearchViewBase class.

protected SearchViewBase()

Properties

CanToggleReplace

Gets or sets whether replace UI can be toggled visible by the end user.

public bool CanToggleReplace { get; set; }

Property Value

Boolean:

true if replace UI can be toggled visible by the end user; otherwise, false. The default value is true.

FindAllButton

Gets the find all button.

protected abstract CommandButton FindAllButton { get; }

Property Value

CommandButton:

The find all button.

FindAllCommand

Gets the ICommand that performs a find all operation.

public ICommand FindAllCommand { get; }

Property Value

ICommand:

The ICommand that performs a find all operation.

FindNextCommand

Gets the ICommand that performs a find next operation.

public ICommand FindNextCommand { get; }

Property Value

ICommand:

The ICommand that performs a find next operation.

FindWhatTextBox

Gets or sets the TextBox in the template.

protected TextBox FindWhatTextBox { get; }

Property Value

TextBox:

The TextBox in the template.

HasNoSearchResults

Gets or sets whether there are no search results for the current find text.

public bool HasNoSearchResults { get; set; }

Property Value

Boolean:

true if there are no search results for the current find text; otherwise, false. The default value is false.

Remarks

When true, some search UI may show an indicator that there is no search match.

IsFindAllButtonVisible

Gets or sets whether the find all button is visible.

public bool IsFindAllButtonVisible { get; set; }

Property Value

Boolean:

true if the find all button; otherwise, false. The default value is false.

IsOptionsPanelExpanded

Gets or sets whether the options panel is currently visible.

public bool IsOptionsPanelExpanded { get; set; }

Property Value

Boolean:

true if the options panel is currently visible; otherwise, false. The default value is false.

IsReplaceVisible

Gets or sets whether replace UI is currently visible.

public bool IsReplaceVisible { get; set; }

Property Value

Boolean:

true if replace UI is currently visible; otherwise, false. The default value is false.

MatchCaseButton

Gets the match case button.

protected abstract CommandButton MatchCaseButton { get; }

Property Value

CommandButton:

The match case button.

MatchWholeWordButton

Gets the match whole word button.

protected abstract CommandButton MatchWholeWordButton { get; }

Property Value

CommandButton:

The match whole word button.

ModeToggleButton

Gets the mode toggle button.

protected abstract CommandButton ModeToggleButton { get; }

Property Value

CommandButton:

The mode toggle button.

ReplaceAllButton

Gets the replace all button.

protected abstract CommandButton ReplaceAllButton { get; }

Property Value

CommandButton:

The replace all button.

ReplaceAllCommand

Gets the ICommand that performs a replace all operation.

public ICommand ReplaceAllCommand { get; }

Property Value

ICommand:

The ICommand that performs a replace all operation.

ReplaceNextButton

Gets the replace next button.

protected abstract CommandButton ReplaceNextButton { get; }

Property Value

CommandButton:

The replace next button.

ReplaceNextCommand

Gets the ICommand that performs a replace next operation.

public ICommand ReplaceNextCommand { get; }

Property Value

ICommand:

The ICommand that performs a replace next operation.

ReplaceWithTextBox

Gets the TextBox in the template.

protected TextBox ReplaceWithTextBox { get; }

Property Value

TextBox:

The TextBox in the template.

SearchOptions

Gets or sets the IEditorSearchOptions that specifies the search options to use.

public IEditorSearchOptions SearchOptions { get; set; }

Property Value

IEditorSearchOptions:

The IEditorSearchOptions that specifies the search options to use.

SearchPatternProviderFactory

Gets or sets the ISearchPatternProviderFactory that creates the collection of available search pattern providers.

public ISearchPatternProviderFactory SearchPatternProviderFactory { get; set; }

Property Value

ISearchPatternProviderFactory:

The ISearchPatternProviderFactory that creates the collection of available search pattern providers.

SearchPatternProviders

Gets the read-only collection of available ISearchPatternProvider objects.

public ReadOnlyCollection<ISearchPatternProvider> SearchPatternProviders { get; }

Property Value

ReadOnlyCollection<ISearchPatternProvider>:

The read-only collection of available ISearchPatternProvider objects.

Remarks

Change the SearchPatternProviderFactory property value to update this collection.

SearchScopeComboBox

Gets the search scope combobox.

protected abstract ComboBox SearchScopeComboBox { get; }

Property Value

ComboBox:

The search scope combobox.

SearchUpButton

Gets the search up button.

protected abstract CommandButton SearchUpButton { get; }

Property Value

CommandButton:

The search up button.

TargetView

Gets the target IEditorView in which the searching will occur.

public abstract IEditorView TargetView { get; }

Property Value

IEditorView:

The target IEditorView in which the searching will occur.

ToggleMatchCaseCommand

Gets the ICommand that toggles the match case setting.

public ICommand ToggleMatchCaseCommand { get; }

Property Value

ICommand:

The ICommand that toggles the match case setting.

ToggleMatchWholeWordCommand

Gets the ICommand that toggles the match whole word setting.

public ICommand ToggleMatchWholeWordCommand { get; }

Property Value

ICommand:

The ICommand that toggles the match whole word setting.

ToggleModeCommand

Gets the ICommand that toggles replace mode setting.

public ICommand ToggleModeCommand { get; }

Property Value

ICommand:

The ICommand that toggles replace mode setting.

ToggleOptionsPanelExpandedCommand

Gets the ICommand that performs a replace next operation.

public ICommand ToggleOptionsPanelExpandedCommand { get; }

Property Value

ICommand:

The ICommand that performs a replace next operation.

ToggleSearchUpCommand

Gets the ICommand that toggles the search up setting.

public ICommand ToggleSearchUpCommand { get; }

Property Value

ICommand:

The ICommand that toggles the search up setting.

ToggleUseRegularExpressionsCommand

Gets the ICommand that toggles the use regular expressions setting.

public ICommand ToggleUseRegularExpressionsCommand { get; }

Property Value

ICommand:

The ICommand that toggles the use regular expressions setting.

UseRegularExpressions

Gets or sets whether to use regular expressions for searching.

public bool UseRegularExpressions { get; set; }

Property Value

Boolean:

true if regular expressions should be used for searching; otherwise, false. The default value is false.

Remarks

Setting this property will toggle the PatternProvider between RegularExpression and Normal.

UseRegularExpressionsButton

Gets the use regular expressions button.

protected abstract CommandButton UseRegularExpressionsButton { get; }

Property Value

CommandButton:

The use regular expressions button.

Methods

ArrangeChildren()

Arranges the children.

protected abstract void ArrangeChildren()

FocusFindWhatTextBox()

Attempts to select all and focus the find-what TextBox.

public bool FocusFindWhatTextBox()

Returns

Boolean:

true if focus was set; otherwise, false.

InitializeChildren()

Initializes the children.

protected virtual void InitializeChildren()

NotifyPropertyChanged(String)

Notifies that a property has changed.

protected void NotifyPropertyChanged(string propertyName)
Parameter Type Description
propertyName String

The name of the property that was changed.

OnCanToggleReplacePropertyChanged(Boolean, Boolean)

Occurs when the CanToggleReplace property is changed.

protected virtual void OnCanToggleReplacePropertyChanged(bool oldValue, bool newValue)
Parameter Type Description
oldValue Boolean

The old value.

newValue Boolean

The new value.

OnFindSearchOptionsChanged()

Occurs when a search option is changed that may affect find results, such as those used for search result highlighting.

protected virtual void OnFindSearchOptionsChanged()

OnFindWhatTextBoxKeyDown(KeyEventArgs)

Occurs when a key is pressed.

protected virtual void OnFindWhatTextBoxKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

A KeyEventArgs that contains the event data.

OnIsFindAllButtonVisiblePropertyChanged(Boolean, Boolean)

Occurs when the IsFindAllButtonVisible property is changed.

protected virtual void OnIsFindAllButtonVisiblePropertyChanged(bool oldValue, bool newValue)
Parameter Type Description
oldValue Boolean

The old value.

newValue Boolean

The new value.

OnIsOptionsPanelExpandedPropertyChanged(Boolean, Boolean)

Occurs when the IsOptionsPanelExpanded property is changed.

protected virtual void OnIsOptionsPanelExpandedPropertyChanged(bool oldValue, bool newValue)
Parameter Type Description
oldValue Boolean

The old value.

newValue Boolean

The new value.

OnIsReplaceVisiblePropertyChanged(Boolean, Boolean)

Occurs when the IsReplaceVisible property is changed.

protected virtual void OnIsReplaceVisiblePropertyChanged(bool oldValue, bool newValue)
Parameter Type Description
oldValue Boolean

The old value.

newValue Boolean

The new value.

OnPaddingChanged(EventArgs)

Occurs when the padding is changed.

protected override void OnPaddingChanged(EventArgs e)
Parameter Type Description
e EventArgs

The EventArgs that contains data related to the event.

OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event.

protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameter Type Description
e PropertyChangedEventArgs

The PropertyChangedEventArgs that contains the event data.

OnReplaceWithTextBoxKeyDown(KeyEventArgs)

Occurs when a key is pressed.

protected virtual void OnReplaceWithTextBoxKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

A KeyEventArgs that contains the event data.

OnResize(EventArgs)

Raises the Resize event.

protected override void OnResize(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnSearching(SearchOperationType)

Occurs before a search operation is executed by the end user.

protected virtual void OnSearching(SearchOperationType operationType)
Parameter Type Description
operationType SearchOperationType

A SearchOperationType that indicates the search operation type.

OnSearchOptionsChanged()

Occurs when the search options have changed.

protected virtual void OnSearchOptionsChanged()

OnSearchOptionsPropertyChanged(IEditorSearchOptions, IEditorSearchOptions)

Occurs when the SearchOptions property is changed.

protected virtual void OnSearchOptionsPropertyChanged(IEditorSearchOptions oldValue, IEditorSearchOptions newValue)
Parameter Type Description
oldValue IEditorSearchOptions

The old value.

newValue IEditorSearchOptions

The new value.

OnSearchOptionsPropertyChanged(PropertyChangedEventArgs)

Occurs when a property on the SearchOptions changes.

protected virtual void OnSearchOptionsPropertyChanged(PropertyChangedEventArgs e)
Parameter Type Description
e PropertyChangedEventArgs

The PropertyChangedEventArgs that contains the event data.

OnSearchPatternProviderFactoryPropertyChanged(ISearchPatternProviderFactory, ISearchPatternProviderFactory)

Occurs when the SearchPatternProviderFactory property is changed.

protected virtual void OnSearchPatternProviderFactoryPropertyChanged(ISearchPatternProviderFactory oldValue, ISearchPatternProviderFactory newValue)
Parameter Type Description
oldValue ISearchPatternProviderFactory

The old value.

newValue ISearchPatternProviderFactory

The new value.

OnSearchScopeChanged()

Occurs when the search scope has changed.

protected virtual void OnSearchScopeChanged()

OnUseRegularExpressionsPropertyChanged(Boolean, Boolean)

Occurs when the UseRegularExpressions property is changed.

protected virtual void OnUseRegularExpressionsPropertyChanged(bool oldValue, bool newValue)
Parameter Type Description
oldValue Boolean

The old value.

newValue Boolean

The new value.

RaiseCanExecuteChangedForCommands()

Raise the can-execute changed events for commands.

protected virtual void RaiseCanExecuteChangedForCommands()

Events

PropertyChanged

Occurs when a property has been changed.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler

SearchOptionsChanged

Occurs when the search options or one of its properties have changed.

public event EventHandler SearchOptionsChanged

Event Type

EventHandler

Inherited Members