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, IDpiAwareElement, IDisposable
Inheritance:
object MarshalByRefObject Component Control ScrollableControl UIControl object
Derived:
SearchOverlayPane
Implements:
IUIControl IUIElement ILogicalTreeNode IDpiAwareElement IDisposable

Constructors

SearchViewBase()

Initializes an instance of the class.

protected SearchViewBase()

Properties

CanToggleReplace

Indicates whether replace UI can be toggled visible by the end user.

public bool CanToggleReplace { get; set; }

Property Value

bool:

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

FindAllButton

The find all button.

protected abstract CommandButton? FindAllButton { get; }

Property Value

CommandButton

FindAllCommand

The ICommand that performs a find all operation.

public ICommand FindAllCommand { get; }

Property Value

ICommand

FindNextCommand

The ICommand that performs a find next operation.

public ICommand FindNextCommand { get; }

Property Value

ICommand

FindWhatTextBox

The TextBox in the template.

protected TextBox? FindWhatTextBox { get; }

Property Value

TextBox

HasNoSearchResults

Indicates whether there are no search results for the current find text.

public bool HasNoSearchResults { get; set; }

Property Value

bool:

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

Indicates whether the find all button is visible.

public bool IsFindAllButtonVisible { get; set; }

Property Value

bool:

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

IsOptionsPanelExpanded

Indicates whether the options panel is currently visible.

public bool IsOptionsPanelExpanded { get; set; }

Property Value

bool:

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

IsReplaceVisible

Indicates whether replace UI is currently visible.

public bool IsReplaceVisible { get; set; }

Property Value

bool:

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

MatchCaseButton

The match case button.

protected abstract CommandButton? MatchCaseButton { get; }

Property Value

CommandButton

MatchWholeWordButton

The match whole word button.

protected abstract CommandButton? MatchWholeWordButton { get; }

Property Value

CommandButton

ModeToggleButton

The mode toggle button.

protected abstract CommandButton? ModeToggleButton { get; }

Property Value

CommandButton

ReplaceAllButton

The replace all button.

protected abstract CommandButton? ReplaceAllButton { get; }

Property Value

CommandButton

ReplaceAllCommand

The ICommand that performs a replace all operation.

public ICommand ReplaceAllCommand { get; }

Property Value

ICommand

ReplaceNextButton

The replace next button.

protected abstract CommandButton? ReplaceNextButton { get; }

Property Value

CommandButton

ReplaceNextCommand

The ICommand that performs a replace next operation.

public ICommand ReplaceNextCommand { get; }

Property Value

ICommand

ReplaceWithTextBox

The TextBox in the template.

protected TextBox? ReplaceWithTextBox { get; }

Property Value

TextBox

SearchOptions

The IEditorSearchOptions that specifies the search options to use.

public IEditorSearchOptions SearchOptions { get; set; }

Property Value

IEditorSearchOptions

SearchPatternProviderFactory

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

public ISearchPatternProviderFactory SearchPatternProviderFactory { get; set; }

Property Value

ISearchPatternProviderFactory

SearchPatternProviders

The read-only collection of available ISearchPatternProvider objects.

public ReadOnlyCollection<ISearchPatternProvider> SearchPatternProviders { get; }

Property Value

ReadOnlyCollection<ISearchPatternProvider>

Remarks

Change the SearchPatternProviderFactory property value to update this collection.

SearchScopeComboBox

The search scope combobox.

protected abstract ComboBox? SearchScopeComboBox { get; }

Property Value

ComboBox

SearchUpButton

The search up button.

protected abstract CommandButton? SearchUpButton { get; }

Property Value

CommandButton

TargetView

The target IEditorView in which the searching will occur.

public abstract IEditorView? TargetView { get; }

Property Value

IEditorView

ToggleMatchCaseCommand

The ICommand that toggles the match case setting.

public ICommand ToggleMatchCaseCommand { get; }

Property Value

ICommand

ToggleMatchWholeWordCommand

The ICommand that toggles the match whole word setting.

public ICommand ToggleMatchWholeWordCommand { get; }

Property Value

ICommand

ToggleModeCommand

The ICommand that toggles replace mode setting.

public ICommand ToggleModeCommand { get; }

Property Value

ICommand

ToggleOptionsPanelExpandedCommand

The ICommand that toggles if the options panel is expanded.

public ICommand ToggleOptionsPanelExpandedCommand { get; }

Property Value

ICommand

ToggleSearchUpCommand

The ICommand that toggles the search up setting.

public ICommand ToggleSearchUpCommand { get; }

Property Value

ICommand

ToggleUseRegularExpressionsCommand

The ICommand that toggles the use regular expressions setting.

public ICommand ToggleUseRegularExpressionsCommand { get; }

Property Value

ICommand

UseRegularExpressions

Indicates whether to use regular expressions for searching.

public bool UseRegularExpressions { get; set; }

Property Value

bool:

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

The use regular expressions button.

protected abstract CommandButton? UseRegularExpressionsButton { get; }

Property Value

CommandButton

Methods

ArrangeChildren()

Arranges the children.

protected abstract void ArrangeChildren()

FocusFindWhatTextBox()

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

public bool FocusFindWhatTextBox()

Returns

bool:

true if focus was set; otherwise, false.

InitializeChildren()

Initializes the children.

protected virtual void InitializeChildren()

OnCanToggleReplacePropertyChanged(bool, bool)

Occurs when the CanToggleReplace property is changed.

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

The old value.

newValue bool

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

The event data.

OnIsFindAllButtonVisiblePropertyChanged(bool, bool)

Occurs when the IsFindAllButtonVisible property is changed.

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

The old value.

newValue bool

The new value.

OnIsOptionsPanelExpandedPropertyChanged(bool, bool)

Occurs when the IsOptionsPanelExpanded property is changed.

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

The old value.

newValue bool

The new value.

OnIsReplaceVisiblePropertyChanged(bool, bool)

Occurs when the IsReplaceVisible property is changed.

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

The old value.

newValue bool

The new value.

OnPaddingChanged(EventArgs)

Raises the PaddingChanged event.

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

An EventArgs that contains the event data.

OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event.

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

The event data.

OnPropertyChanged(string?)

Raises the PropertyChanged event.

protected void OnPropertyChanged(string? propertyName = null)
Parameter Type Description
propertyName string

(Optional) The name of the property that changed.

OnReplaceWithTextBoxKeyDown(KeyEventArgs)

Occurs when a key is pressed.

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

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.

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 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()

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.

OnUseRegularExpressionsPropertyChanged(bool, bool)

Occurs when the UseRegularExpressions property is changed.

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

The old value.

newValue bool

The new value.

RaiseCanExecuteChangedForCommands()

Raise the can-execute changed events for commands.

protected virtual void RaiseCanExecuteChangedForCommands()

SetProperty<T>(ref T, T, string?)

Called from a property setter to change the backing field's value and raise PropertyChanged notification events if the new value is not equal to the current value.

protected bool SetProperty<T>(ref T field, T newValue, string? propertyName = null)
Type Parameters:
T -

The type of the property that changed.

Parameter Type Description
field T

The backing field that holds the property's value, which may be updated.

newValue T

The new property value.

propertyName string

(Optional) The name of the property that changed.

Returns

bool:

true if the property was changed; otherwise, false.

Events

PropertyChanged

Occurs when a property value changes.

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

Extension Methods