4 changed files with 211 additions and 185 deletions
@ -0,0 +1,133 @@ |
|||
// (c) Copyright Microsoft Corporation.
|
|||
// This source is subject to the Microsoft Public License (Ms-PL).
|
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details.
|
|||
// All other rights reserved.
|
|||
|
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Specifies how text in the text box portion of the
|
|||
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> control is used
|
|||
/// to filter items specified by the
|
|||
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.ItemsSource" />
|
|||
/// property for display in the drop-down.
|
|||
/// </summary>
|
|||
public enum AutoCompleteFilterMode |
|||
{ |
|||
/// <summary>
|
|||
/// Specifies that no filter is used. All items are returned.
|
|||
/// </summary>
|
|||
None = 0, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-insensitive filter where the
|
|||
/// returned items start with the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.StartsWith(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.CurrentCultureIgnoreCase" /> as
|
|||
/// the string comparison criteria.
|
|||
/// </summary>
|
|||
StartsWith = 1, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-sensitive filter where the
|
|||
/// returned items start with the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.StartsWith(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.CurrentCulture" /> as the string
|
|||
/// comparison criteria.
|
|||
/// </summary>
|
|||
StartsWithCaseSensitive = 2, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-insensitive filter where the returned
|
|||
/// items start with the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.StartsWith(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.OrdinalIgnoreCase" /> as the
|
|||
/// string comparison criteria.
|
|||
/// </summary>
|
|||
StartsWithOrdinal = 3, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-sensitive filter where the returned items
|
|||
/// start with the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.StartsWith(System.String,System.StringComparison)" />
|
|||
/// method, specifying <see cref="P:System.StringComparer.Ordinal" /> as
|
|||
/// the string comparison criteria.
|
|||
/// </summary>
|
|||
StartsWithOrdinalCaseSensitive = 4, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-insensitive filter where the
|
|||
/// returned items contain the specified text.
|
|||
/// </summary>
|
|||
Contains = 5, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-sensitive filter where the
|
|||
/// returned items contain the specified text.
|
|||
/// </summary>
|
|||
ContainsCaseSensitive = 6, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-insensitive filter where the returned
|
|||
/// items contain the specified text.
|
|||
/// </summary>
|
|||
ContainsOrdinal = 7, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-sensitive filter where the returned items
|
|||
/// contain the specified text.
|
|||
/// </summary>
|
|||
ContainsOrdinalCaseSensitive = 8, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-insensitive filter where the
|
|||
/// returned items equal the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.Equals(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.CurrentCultureIgnoreCase" /> as
|
|||
/// the search comparison criteria.
|
|||
/// </summary>
|
|||
Equals = 9, |
|||
|
|||
/// <summary>
|
|||
/// Specifies a culture-sensitive, case-sensitive filter where the
|
|||
/// returned items equal the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.Equals(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.CurrentCulture" /> as the string
|
|||
/// comparison criteria.
|
|||
/// </summary>
|
|||
EqualsCaseSensitive = 10, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-insensitive filter where the returned
|
|||
/// items equal the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.Equals(System.String,System.StringComparison)" />
|
|||
/// method, specifying
|
|||
/// <see cref="P:System.StringComparer.OrdinalIgnoreCase" /> as the
|
|||
/// string comparison criteria.
|
|||
/// </summary>
|
|||
EqualsOrdinal = 11, |
|||
|
|||
/// <summary>
|
|||
/// Specifies an ordinal, case-sensitive filter where the returned items
|
|||
/// equal the specified text. The filter uses the
|
|||
/// <see cref="M:System.String.Equals(System.String,System.StringComparison)" />
|
|||
/// method, specifying <see cref="P:System.StringComparer.Ordinal" /> as
|
|||
/// the string comparison criteria.
|
|||
/// </summary>
|
|||
EqualsOrdinalCaseSensitive = 12, |
|||
|
|||
/// <summary>
|
|||
/// Specifies that a custom filter is used. This mode is used when the
|
|||
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.TextFilter" />
|
|||
/// or
|
|||
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.ItemFilter" />
|
|||
/// properties are set.
|
|||
/// </summary>
|
|||
Custom = 13, |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
// (c) Copyright Microsoft Corporation.
|
|||
// This source is subject to the Microsoft Public License (Ms-PL).
|
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details.
|
|||
// All other rights reserved.
|
|||
|
|||
using System; |
|||
using System.Collections; |
|||
|
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Provides data for the
|
|||
/// <see cref="E:Avalonia.Controls.AutoCompleteBox.Populated" />
|
|||
/// event.
|
|||
/// </summary>
|
|||
public class PopulatedEventArgs : EventArgs |
|||
{ |
|||
/// <summary>
|
|||
/// Gets the list of possible matches added to the drop-down portion of
|
|||
/// the <see cref="T:Avalonia.Controls.AutoCompleteBox" />
|
|||
/// control.
|
|||
/// </summary>
|
|||
/// <value>The list of possible matches added to the
|
|||
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" />.</value>
|
|||
public IEnumerable Data { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the
|
|||
/// <see cref="T:Avalonia.Controls.PopulatedEventArgs" />.
|
|||
/// </summary>
|
|||
/// <param name="data">The list of possible matches added to the
|
|||
/// drop-down portion of the
|
|||
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> control.</param>
|
|||
public PopulatedEventArgs(IEnumerable data) |
|||
{ |
|||
Data = data; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
// (c) Copyright Microsoft Corporation.
|
|||
// This source is subject to the Microsoft Public License (Ms-PL).
|
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details.
|
|||
// All other rights reserved.
|
|||
|
|||
using System.ComponentModel; |
|||
|
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Provides data for the
|
|||
/// <see cref="E:Avalonia.Controls.AutoCompleteBox.Populating" />
|
|||
/// event.
|
|||
/// </summary>
|
|||
public class PopulatingEventArgs : CancelEventArgs |
|||
{ |
|||
/// <summary>
|
|||
/// Gets the text that is used to determine which items to display in
|
|||
/// the <see cref="T:Avalonia.Controls.AutoCompleteBox" />
|
|||
/// control.
|
|||
/// </summary>
|
|||
/// <value>The text that is used to determine which items to display in
|
|||
/// the <see cref="T:Avalonia.Controls.AutoCompleteBox" />.</value>
|
|||
public string? Parameter { get; private set; } |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the
|
|||
/// <see cref="T:Avalonia.Controls.PopulatingEventArgs" />.
|
|||
/// </summary>
|
|||
/// <param name="parameter">The value of the
|
|||
/// <see cref="P:Avalonia.Controls.AutoCompleteBox.SearchText" />
|
|||
/// property, which is used to filter items for the
|
|||
/// <see cref="T:Avalonia.Controls.AutoCompleteBox" /> control.</param>
|
|||
public PopulatingEventArgs(string? parameter) |
|||
{ |
|||
Parameter = parameter; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue