Team Ai
Datasetpublic

MegaBites-AI/Windows-powershell

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes372downloads
SettingsDialog.xaml.cs59 linesDownload Raw Back to HelpWindow
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4namespace Microsoft.Management.UI5{6    using System.Windows;7    using Microsoft.Management.UI.Internal;8 9    /// <summary>10    /// Dialog with settings for the help dialog.11    /// </summary>12    public partial class SettingsDialog : Window13    {14        /// <summary>15        /// Initializes a new instance of the SettingsDialog class.16        /// </summary>17        public SettingsDialog()18        {19            InitializeComponent();20            this.Description.IsChecked = HelpWindowSettings.Default.HelpDescriptionDisplayed;21            this.Examples.IsChecked = HelpWindowSettings.Default.HelpExamplesDisplayed;22            this.Inputs.IsChecked = HelpWindowSettings.Default.HelpInputsDisplayed;23            this.Notes.IsChecked = HelpWindowSettings.Default.HelpNotesDisplayed;24            this.Outputs.IsChecked = HelpWindowSettings.Default.HelpOutputsDisplayed;25            this.Parameters.IsChecked = HelpWindowSettings.Default.HelpParametersDisplayed;26            this.RelatedLinks.IsChecked = HelpWindowSettings.Default.HelpRelatedLinksDisplayed;27            this.Remarks.IsChecked = HelpWindowSettings.Default.HelpRemarksDisplayed;28            this.Synopsys.IsChecked = HelpWindowSettings.Default.HelpSynopsysDisplayed;29            this.Syntax.IsChecked = HelpWindowSettings.Default.HelpSyntaxDisplayed;30            this.CaseSensitive.IsChecked = HelpWindowSettings.Default.HelpSearchMatchCase;31            this.WholeWord.IsChecked = HelpWindowSettings.Default.HelpSearchWholeWord;32        }33 34        /// <summary>35        /// Called when the OK button has been clicked.36        /// </summary>37        /// <param name="sender">Event sender.</param>38        /// <param name="e">Event arguments.</param>39        private void OK_Click(object sender, RoutedEventArgs e)40        {41            HelpWindowSettings.Default.HelpDescriptionDisplayed = this.Description.IsChecked == true;42            HelpWindowSettings.Default.HelpExamplesDisplayed = this.Examples.IsChecked == true;43            HelpWindowSettings.Default.HelpInputsDisplayed = this.Inputs.IsChecked == true;44            HelpWindowSettings.Default.HelpOutputsDisplayed = this.Outputs.IsChecked == true;45            HelpWindowSettings.Default.HelpNotesDisplayed = this.Notes.IsChecked == true;46            HelpWindowSettings.Default.HelpParametersDisplayed = this.Parameters.IsChecked == true;47            HelpWindowSettings.Default.HelpRelatedLinksDisplayed = this.RelatedLinks.IsChecked == true;48            HelpWindowSettings.Default.HelpRemarksDisplayed = this.Remarks.IsChecked == true;49            HelpWindowSettings.Default.HelpSynopsysDisplayed = this.Synopsys.IsChecked == true;50            HelpWindowSettings.Default.HelpSyntaxDisplayed = this.Syntax.IsChecked == true;51            HelpWindowSettings.Default.HelpSearchMatchCase = this.CaseSensitive.IsChecked == true;52            HelpWindowSettings.Default.HelpSearchWholeWord = this.WholeWord.IsChecked == true;53            HelpWindowSettings.Default.Save();54            this.DialogResult = true;55            this.Close();56        }57    }58}59