forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsDialog.xaml.cs
More file actions
64 lines (61 loc) · 3.34 KB
/
Copy pathSettingsDialog.xaml.cs
File metadata and controls
64 lines (61 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//-----------------------------------------------------------------------
// <copyright file="SettingsDialog.xaml.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>
// Implements SettingsDialog.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Management.UI
{
using System.Windows;
using Microsoft.Management.UI.Internal;
/// <summary>
/// Dialog with settings for the help dialog
/// </summary>
public partial class SettingsDialog : Window
{
/// <summary>
/// Initializes a new instance of the SettingsDialog class
/// </summary>
public SettingsDialog()
{
InitializeComponent();
this.Description.IsChecked = HelpWindowSettings.Default.HelpDescriptionDisplayed;
this.Examples.IsChecked = HelpWindowSettings.Default.HelpExamplesDisplayed;
this.Inputs.IsChecked = HelpWindowSettings.Default.HelpInputsDisplayed;
this.Notes.IsChecked = HelpWindowSettings.Default.HelpNotesDisplayed;
this.Outputs.IsChecked = HelpWindowSettings.Default.HelpOutputsDisplayed;
this.Parameters.IsChecked = HelpWindowSettings.Default.HelpParametersDisplayed;
this.RelatedLinks.IsChecked = HelpWindowSettings.Default.HelpRelatedLinksDisplayed;
this.Remarks.IsChecked = HelpWindowSettings.Default.HelpRemarksDisplayed;
this.Synopsys.IsChecked = HelpWindowSettings.Default.HelpSynopsysDisplayed;
this.Syntax.IsChecked = HelpWindowSettings.Default.HelpSyntaxDisplayed;
this.CaseSensitive.IsChecked = HelpWindowSettings.Default.HelpSearchMatchCase;
this.WholeWord.IsChecked = HelpWindowSettings.Default.HelpSearchWholeWord;
}
/// <summary>
/// Called when the OK button has been clicked
/// </summary>
/// <param name="sender">event sender</param>
/// <param name="e">event arguments</param>
private void OK_Click(object sender, RoutedEventArgs e)
{
HelpWindowSettings.Default.HelpDescriptionDisplayed = this.Description.IsChecked == true;
HelpWindowSettings.Default.HelpExamplesDisplayed = this.Examples.IsChecked == true;
HelpWindowSettings.Default.HelpInputsDisplayed = this.Inputs.IsChecked == true;
HelpWindowSettings.Default.HelpOutputsDisplayed = this.Outputs.IsChecked == true;
HelpWindowSettings.Default.HelpNotesDisplayed = this.Notes.IsChecked == true;
HelpWindowSettings.Default.HelpParametersDisplayed = this.Parameters.IsChecked == true;
HelpWindowSettings.Default.HelpRelatedLinksDisplayed = this.RelatedLinks.IsChecked == true;
HelpWindowSettings.Default.HelpRemarksDisplayed = this.Remarks.IsChecked == true;
HelpWindowSettings.Default.HelpSynopsysDisplayed = this.Synopsys.IsChecked == true;
HelpWindowSettings.Default.HelpSyntaxDisplayed = this.Syntax.IsChecked == true;
HelpWindowSettings.Default.HelpSearchMatchCase = this.CaseSensitive.IsChecked == true;
HelpWindowSettings.Default.HelpSearchWholeWord = this.WholeWord.IsChecked == true;
HelpWindowSettings.Default.Save();
this.DialogResult = true;
this.Close();
}
}
}