//****************************************************************************************************** // AdvancedSearchUserControl.xaml.cs - Gbtc // // Copyright © 2010, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 10/25/2012 - Stephen C. Wills // Generated original version of source code. // //****************************************************************************************************** using System.Collections.ObjectModel; using System.Windows; using System.Windows.Controls; namespace GSF.TimeSeries.UI.UserControls { /// /// Category to search by. /// public class AdvancedSearchCategory : DependencyObject { #region [ Properties ] /// /// Gets or sets the name of the category. /// public string Name { get { return (string)GetValue(NameProperty); } set { SetValue(NameProperty, value); } } /// /// Gets or sets the flag that indicates whether the category is selected. /// public bool Selected { get { return (bool)GetValue(SelectedProperty); } set { SetValue(SelectedProperty, value); } } #endregion #region [ Static ] // Static Fields /// /// Dependency property for the property. /// public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(AdvancedSearchCategory)); /// /// Dependency property for the property. /// public static readonly DependencyProperty SelectedProperty = DependencyProperty.Register("Selected", typeof(bool), typeof(AdvancedSearchCategory)); #endregion } /// /// Interaction logic for AdvancedSearchUserControl.xaml /// public partial class AdvancedSearchUserControl : UserControl { #region [ Constructors ] /// /// Creates a new instance of the . /// public AdvancedSearchUserControl() { SetValue(CategoriesPropertyKey, new ObservableCollection()); InitializeComponent(); } #endregion #region [ Properties ] /// /// Gets or sets the text by which to search. /// public string SearchText { get { return (string)GetValue(SearchTextProperty); } set { SetValue(SearchTextProperty, value); } } /// /// Gets or sets whether to ignore casing when searching. /// public bool IgnoreCase { get { return (bool)GetValue(IgnoreCaseProperty); } set { SetValue(IgnoreCaseProperty, value); } } /// /// Gets or sets whether to use wildcards in searches. /// public bool UseWildcards { get { return (bool)GetValue(UseWildcardsProperty); } set { SetValue(UseWildcardsProperty, value); } } /// /// Gets or sets whether to interpret search tokens as regular expressions. /// public bool UseRegex { get { return (bool)GetValue(UseRegexProperty); } set { SetValue(UseRegexProperty, value); } } /// /// Gets the collection of categories displayed in the second tab of the . /// public ObservableCollection Categories { get { return (ObservableCollection)GetValue(CategoriesProperty); } } #endregion #region [ Static ] // Static Fields private static readonly DependencyPropertyKey CategoriesPropertyKey = DependencyProperty.RegisterReadOnly("Categories", typeof(ObservableCollection), typeof(AdvancedSearchUserControl), new PropertyMetadata()); /// /// Dependency property for the property. /// public static readonly DependencyProperty SearchTextProperty = DependencyProperty.Register("SearchText", typeof(string), typeof(AdvancedSearchUserControl)); /// /// Dependency property for the property. /// public static readonly DependencyProperty IgnoreCaseProperty = DependencyProperty.Register("IgnoreCase", typeof(bool), typeof(AdvancedSearchUserControl)); /// /// Dependency property for the property. /// public static readonly DependencyProperty UseWildcardsProperty = DependencyProperty.Register("UseWildcards", typeof(bool), typeof(AdvancedSearchUserControl)); /// /// Dependency property for the property. /// public static readonly DependencyProperty UseRegexProperty = DependencyProperty.Register("UseRegex", typeof(bool), typeof(AdvancedSearchUserControl)); /// /// Dependency property for the property. /// public static readonly DependencyProperty CategoriesProperty = CategoriesPropertyKey.DependencyProperty; #endregion } }