diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml b/src/PathLengthCheckerGUI/MainWindow.xaml index 38c8515..b68bd9e 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml +++ b/src/PathLengthCheckerGUI/MainWindow.xaml @@ -5,13 +5,13 @@ xmlns:extToolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:PathLengthChecker="clr-namespace:PathLengthChecker;assembly=PathLengthChecker" - Style="{StaticResource DefaultWindowStyle}" + Style="{StaticResource ResourceKey=DefaultWindowStyle}" MinWidth="770" MinHeight="400" - Width="{local:ApplicationSettingsBinding WindowWidth}" - Height="{local:ApplicationSettingsBinding WindowHeight}" - Left="{local:ApplicationSettingsBinding WindowLeftPosition}" - Top="{local:ApplicationSettingsBinding WindowTopPosition}" - WindowState="{local:ApplicationSettingsBinding WindowState}" + Width="{local:ApplicationSettingsBinding Path=WindowWidth}" + Height="{local:ApplicationSettingsBinding Path=WindowHeight}" + Left="{local:ApplicationSettingsBinding Path=WindowLeftPosition}" + Top="{local:ApplicationSettingsBinding Path=WindowTopPosition}" + WindowState="{local:ApplicationSettingsBinding Path=WindowState}" FocusManager.FocusedElement="{Binding ElementName=txtRootDirectory}"> @@ -51,7 +51,7 @@ - + + diff --git a/src/PathLengthCheckerGUI/MainWindow.xaml.cs b/src/PathLengthCheckerGUI/MainWindow.xaml.cs index 7a94c61..c4b017a 100644 --- a/src/PathLengthCheckerGUI/MainWindow.xaml.cs +++ b/src/PathLengthCheckerGUI/MainWindow.xaml.cs @@ -47,9 +47,6 @@ public MainWindow() InitializeComponent(); this.DataContext = this; - // Set the default type for the combo boxes. - cmbTypesToInclude.SelectedValue = FileSystemTypes.All; - SetWindowTitle(); } @@ -360,5 +357,27 @@ protected internal void SetUIControlsFromSearchOptions(PathLengthSearchOptions a numMinPathLength.Value = argSearchOptions.MinimumPathLength; numMaxPathLength.Value = argSearchOptions.MaximumPathLength; } + + private void btnResetSearchOptions_Click(object sender, RoutedEventArgs e) + { + ResetAllUiSearchOptionsToDefaultValues(); + } + + private void ResetAllUiSearchOptionsToDefaultValues() + { + // Values specified here should match the default values in the Properties\Settings.settings file. + + txtRootDirectory.Text = string.Empty; + txtSearchPattern.Text = string.Empty; + + numMinPathLength.Value = 0; + numMaxPathLength.Value = PathLengthSearchOptions.MaximumPathLengthMaxValue; + + chkIncludeSubdirectories.IsChecked = true; + cmbTypesToInclude.SelectedValue = FileSystemTypes.All; + + txtReplaceRootDirectory.Text = string.Empty; + chkReplaceRootDirectory.IsChecked = false; + } } } diff --git a/src/PathLengthCheckerGUI/Properties/Settings.Designer.cs b/src/PathLengthCheckerGUI/Properties/Settings.Designer.cs index e4eb8ee..4d2f9fe 100644 --- a/src/PathLengthCheckerGUI/Properties/Settings.Designer.cs +++ b/src/PathLengthCheckerGUI/Properties/Settings.Designer.cs @@ -82,5 +82,101 @@ public string WindowState { this["WindowState"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SearchOption_RootDirectory { + get { + return ((string)(this["SearchOption_RootDirectory"])); + } + set { + this["SearchOption_RootDirectory"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SearchOption_ReplaceRootDirectory { + get { + return ((bool)(this["SearchOption_ReplaceRootDirectory"])); + } + set { + this["SearchOption_ReplaceRootDirectory"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("All")] + public global::PathLengthChecker.FileSystemTypes SearchOption_FileSystemTypesToInclude { + get { + return ((global::PathLengthChecker.FileSystemTypes)(this["SearchOption_FileSystemTypesToInclude"])); + } + set { + this["SearchOption_FileSystemTypesToInclude"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool SearchOption_IncludeSubdirectories { + get { + return ((bool)(this["SearchOption_IncludeSubdirectories"])); + } + set { + this["SearchOption_IncludeSubdirectories"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int SearchOption_MinPathLength { + get { + return ((int)(this["SearchOption_MinPathLength"])); + } + set { + this["SearchOption_MinPathLength"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("999999")] + public int SearchOption_MaxPathLength { + get { + return ((int)(this["SearchOption_MaxPathLength"])); + } + set { + this["SearchOption_MaxPathLength"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SearchOption_SearchPattern { + get { + return ((string)(this["SearchOption_SearchPattern"])); + } + set { + this["SearchOption_SearchPattern"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SearchOption_RootDirectoryReplacementText { + get { + return ((string)(this["SearchOption_RootDirectoryReplacementText"])); + } + set { + this["SearchOption_RootDirectoryReplacementText"] = value; + } + } } } diff --git a/src/PathLengthCheckerGUI/Properties/Settings.settings b/src/PathLengthCheckerGUI/Properties/Settings.settings index 1504553..7762e45 100644 --- a/src/PathLengthCheckerGUI/Properties/Settings.settings +++ b/src/PathLengthCheckerGUI/Properties/Settings.settings @@ -17,5 +17,29 @@ Normal + + + + + False + + + All + + + True + + + 0 + + + 999999 + + + + + + + \ No newline at end of file diff --git a/src/PathLengthCheckerGUI/app.config b/src/PathLengthCheckerGUI/app.config index f2c86b0..5956bb2 100644 --- a/src/PathLengthCheckerGUI/app.config +++ b/src/PathLengthCheckerGUI/app.config @@ -22,6 +22,30 @@ Normal + + + + + False + + + All + + + True + + + 0 + + + 999999 + + + + + + +