From a28bf0f5af438319910182a94b8736514e528db9 Mon Sep 17 00:00:00 2001 From: robloo Date: Fri, 14 Oct 2022 20:32:12 -0400 Subject: [PATCH] Split apart AutoCompleteBox into multiple files --- .../AutoCompleteBox/AutoCompleteBox.cs | 185 ------------------ .../AutoCompleteBox/AutoCompleteFilterMode.cs | 133 +++++++++++++ .../AutoCompleteBox/PopulatedEventArgs.cs | 39 ++++ .../AutoCompleteBox/PopulatingEventArgs.cs | 39 ++++ 4 files changed, 211 insertions(+), 185 deletions(-) create mode 100644 src/Avalonia.Controls/AutoCompleteBox/AutoCompleteFilterMode.cs create mode 100644 src/Avalonia.Controls/AutoCompleteBox/PopulatedEventArgs.cs create mode 100644 src/Avalonia.Controls/AutoCompleteBox/PopulatingEventArgs.cs diff --git a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs index e7a14bf568..608d18d0d3 100644 --- a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs +++ b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteBox.cs @@ -26,65 +26,6 @@ using Avalonia.VisualTree; namespace Avalonia.Controls { - /// - /// Provides data for the - /// - /// event. - /// - public class PopulatedEventArgs : EventArgs - { - /// - /// Gets the list of possible matches added to the drop-down portion of - /// the - /// control. - /// - /// The list of possible matches added to the - /// . - public IEnumerable Data { get; private set; } - - /// - /// Initializes a new instance of the - /// . - /// - /// The list of possible matches added to the - /// drop-down portion of the - /// control. - public PopulatedEventArgs(IEnumerable data) - { - Data = data; - } - } - - /// - /// Provides data for the - /// - /// event. - /// - public class PopulatingEventArgs : CancelEventArgs - { - /// - /// Gets the text that is used to determine which items to display in - /// the - /// control. - /// - /// The text that is used to determine which items to display in - /// the . - public string? Parameter { get; private set; } - - /// - /// Initializes a new instance of the - /// . - /// - /// The value of the - /// - /// property, which is used to filter items for the - /// control. - public PopulatingEventArgs(string? parameter) - { - Parameter = parameter; - } - } - /// /// Represents the filter used by the /// control to @@ -100,132 +41,6 @@ namespace Avalonia.Controls /// be either a string or an object. public delegate bool AutoCompleteFilterPredicate(string? search, T item); - /// - /// Specifies how text in the text box portion of the - /// control is used - /// to filter items specified by the - /// - /// property for display in the drop-down. - /// - public enum AutoCompleteFilterMode - { - /// - /// Specifies that no filter is used. All items are returned. - /// - None = 0, - - /// - /// Specifies a culture-sensitive, case-insensitive filter where the - /// returned items start with the specified text. The filter uses the - /// - /// method, specifying - /// as - /// the string comparison criteria. - /// - StartsWith = 1, - - /// - /// Specifies a culture-sensitive, case-sensitive filter where the - /// returned items start with the specified text. The filter uses the - /// - /// method, specifying - /// as the string - /// comparison criteria. - /// - StartsWithCaseSensitive = 2, - - /// - /// Specifies an ordinal, case-insensitive filter where the returned - /// items start with the specified text. The filter uses the - /// - /// method, specifying - /// as the - /// string comparison criteria. - /// - StartsWithOrdinal = 3, - - /// - /// Specifies an ordinal, case-sensitive filter where the returned items - /// start with the specified text. The filter uses the - /// - /// method, specifying as - /// the string comparison criteria. - /// - StartsWithOrdinalCaseSensitive = 4, - - /// - /// Specifies a culture-sensitive, case-insensitive filter where the - /// returned items contain the specified text. - /// - Contains = 5, - - /// - /// Specifies a culture-sensitive, case-sensitive filter where the - /// returned items contain the specified text. - /// - ContainsCaseSensitive = 6, - - /// - /// Specifies an ordinal, case-insensitive filter where the returned - /// items contain the specified text. - /// - ContainsOrdinal = 7, - - /// - /// Specifies an ordinal, case-sensitive filter where the returned items - /// contain the specified text. - /// - ContainsOrdinalCaseSensitive = 8, - - /// - /// Specifies a culture-sensitive, case-insensitive filter where the - /// returned items equal the specified text. The filter uses the - /// - /// method, specifying - /// as - /// the search comparison criteria. - /// - Equals = 9, - - /// - /// Specifies a culture-sensitive, case-sensitive filter where the - /// returned items equal the specified text. The filter uses the - /// - /// method, specifying - /// as the string - /// comparison criteria. - /// - EqualsCaseSensitive = 10, - - /// - /// Specifies an ordinal, case-insensitive filter where the returned - /// items equal the specified text. The filter uses the - /// - /// method, specifying - /// as the - /// string comparison criteria. - /// - EqualsOrdinal = 11, - - /// - /// Specifies an ordinal, case-sensitive filter where the returned items - /// equal the specified text. The filter uses the - /// - /// method, specifying as - /// the string comparison criteria. - /// - EqualsOrdinalCaseSensitive = 12, - - /// - /// Specifies that a custom filter is used. This mode is used when the - /// - /// or - /// - /// properties are set. - /// - Custom = 13, - } - /// /// Represents the selector used by the /// control to diff --git a/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteFilterMode.cs b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteFilterMode.cs new file mode 100644 index 0000000000..9aea49aef3 --- /dev/null +++ b/src/Avalonia.Controls/AutoCompleteBox/AutoCompleteFilterMode.cs @@ -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 +{ + /// + /// Specifies how text in the text box portion of the + /// control is used + /// to filter items specified by the + /// + /// property for display in the drop-down. + /// + public enum AutoCompleteFilterMode + { + /// + /// Specifies that no filter is used. All items are returned. + /// + None = 0, + + /// + /// Specifies a culture-sensitive, case-insensitive filter where the + /// returned items start with the specified text. The filter uses the + /// + /// method, specifying + /// as + /// the string comparison criteria. + /// + StartsWith = 1, + + /// + /// Specifies a culture-sensitive, case-sensitive filter where the + /// returned items start with the specified text. The filter uses the + /// + /// method, specifying + /// as the string + /// comparison criteria. + /// + StartsWithCaseSensitive = 2, + + /// + /// Specifies an ordinal, case-insensitive filter where the returned + /// items start with the specified text. The filter uses the + /// + /// method, specifying + /// as the + /// string comparison criteria. + /// + StartsWithOrdinal = 3, + + /// + /// Specifies an ordinal, case-sensitive filter where the returned items + /// start with the specified text. The filter uses the + /// + /// method, specifying as + /// the string comparison criteria. + /// + StartsWithOrdinalCaseSensitive = 4, + + /// + /// Specifies a culture-sensitive, case-insensitive filter where the + /// returned items contain the specified text. + /// + Contains = 5, + + /// + /// Specifies a culture-sensitive, case-sensitive filter where the + /// returned items contain the specified text. + /// + ContainsCaseSensitive = 6, + + /// + /// Specifies an ordinal, case-insensitive filter where the returned + /// items contain the specified text. + /// + ContainsOrdinal = 7, + + /// + /// Specifies an ordinal, case-sensitive filter where the returned items + /// contain the specified text. + /// + ContainsOrdinalCaseSensitive = 8, + + /// + /// Specifies a culture-sensitive, case-insensitive filter where the + /// returned items equal the specified text. The filter uses the + /// + /// method, specifying + /// as + /// the search comparison criteria. + /// + Equals = 9, + + /// + /// Specifies a culture-sensitive, case-sensitive filter where the + /// returned items equal the specified text. The filter uses the + /// + /// method, specifying + /// as the string + /// comparison criteria. + /// + EqualsCaseSensitive = 10, + + /// + /// Specifies an ordinal, case-insensitive filter where the returned + /// items equal the specified text. The filter uses the + /// + /// method, specifying + /// as the + /// string comparison criteria. + /// + EqualsOrdinal = 11, + + /// + /// Specifies an ordinal, case-sensitive filter where the returned items + /// equal the specified text. The filter uses the + /// + /// method, specifying as + /// the string comparison criteria. + /// + EqualsOrdinalCaseSensitive = 12, + + /// + /// Specifies that a custom filter is used. This mode is used when the + /// + /// or + /// + /// properties are set. + /// + Custom = 13, + } +} diff --git a/src/Avalonia.Controls/AutoCompleteBox/PopulatedEventArgs.cs b/src/Avalonia.Controls/AutoCompleteBox/PopulatedEventArgs.cs new file mode 100644 index 0000000000..22bc1d3cab --- /dev/null +++ b/src/Avalonia.Controls/AutoCompleteBox/PopulatedEventArgs.cs @@ -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 +{ + /// + /// Provides data for the + /// + /// event. + /// + public class PopulatedEventArgs : EventArgs + { + /// + /// Gets the list of possible matches added to the drop-down portion of + /// the + /// control. + /// + /// The list of possible matches added to the + /// . + public IEnumerable Data { get; private set; } + + /// + /// Initializes a new instance of the + /// . + /// + /// The list of possible matches added to the + /// drop-down portion of the + /// control. + public PopulatedEventArgs(IEnumerable data) + { + Data = data; + } + } +} diff --git a/src/Avalonia.Controls/AutoCompleteBox/PopulatingEventArgs.cs b/src/Avalonia.Controls/AutoCompleteBox/PopulatingEventArgs.cs new file mode 100644 index 0000000000..c4941ad6fe --- /dev/null +++ b/src/Avalonia.Controls/AutoCompleteBox/PopulatingEventArgs.cs @@ -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 +{ + /// + /// Provides data for the + /// + /// event. + /// + public class PopulatingEventArgs : CancelEventArgs + { + /// + /// Gets the text that is used to determine which items to display in + /// the + /// control. + /// + /// The text that is used to determine which items to display in + /// the . + public string? Parameter { get; private set; } + + /// + /// Initializes a new instance of the + /// . + /// + /// The value of the + /// + /// property, which is used to filter items for the + /// control. + public PopulatingEventArgs(string? parameter) + { + Parameter = parameter; + } + } +}