"Fossies" - the Fresh Open Source Software Archive

Member "PowerShell-7.2.6/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePickerItem.cs" (11 Aug 2022, 2603 Bytes) of package /linux/misc/PowerShell-7.2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AddFilterRulePickerItem.cs" see the Fossies "Dox" file reference documentation.

    1 // Copyright (c) Microsoft Corporation.
    2 // Licensed under the MIT License.
    3 
    4 using System.ComponentModel;
    5 
    6 namespace Microsoft.Management.UI.Internal
    7 {
    8     /// <summary>
    9     /// The AddFilterRulePicker class is responsible for holding state
   10     /// information needed by the AddFilterRulePicker class.
   11     /// </summary>
   12     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
   13     public class AddFilterRulePickerItem : INotifyPropertyChanged
   14     {
   15         private bool isChecked;
   16 
   17         /// <summary>
   18         /// Gets or sets a value indicating whether this item should
   19         /// be added to the FilterRulePanel.
   20         /// </summary>
   21         public bool IsChecked
   22         {
   23             get
   24             {
   25                 return this.isChecked;
   26             }
   27 
   28             set
   29             {
   30                 if (value != this.isChecked)
   31                 {
   32                     this.isChecked = value;
   33                     this.NotifyPropertyChanged("IsChecked");
   34                 }
   35             }
   36         }
   37 
   38         /// <summary>
   39         /// Gets the FilterRulePanelItem that will be added to the FilterRulePanel.
   40         /// </summary>
   41         public FilterRulePanelItem FilterRule
   42         {
   43             get;
   44             private set;
   45         }
   46 
   47         /// <summary>
   48         /// Initializes a new instance of the FilterRulePanelItem class.
   49         /// </summary>
   50         /// <param name="filterRule">
   51         /// The FilterRulePanelItem that will be added to the FilterRulePanel.
   52         /// </param>
   53         public AddFilterRulePickerItem(FilterRulePanelItem filterRule)
   54         {
   55             this.FilterRule = filterRule;
   56         }
   57 
   58         /// <summary>
   59         /// Notifies listeners that a property has changed.
   60         /// </summary>
   61         public event PropertyChangedEventHandler PropertyChanged;
   62 
   63         #region NotifyPropertyChanged
   64 
   65         /// <summary>
   66         /// Notifies listeners that a property has changed.
   67         /// </summary>
   68         /// <param name="propertyName">
   69         /// The propertyName which has changed.
   70         /// </param>
   71         protected void NotifyPropertyChanged(string propertyName)
   72         {
   73             #pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
   74             PropertyChangedEventHandler eh = this.PropertyChanged;
   75 
   76             if (eh != null)
   77             {
   78                 eh(this, new PropertyChangedEventArgs(propertyName));
   79             }
   80             #pragma warning restore IDE1005
   81         }
   82 
   83         #endregion NotifyPropertyChanged
   84     }
   85 }