Skip to content

Commit

Permalink
[Enhancement] Point to previously selected folder while clicking "Add…
Browse files Browse the repository at this point in the history
… folder" button

Issue: #5
  • Loading branch information
arnobpl committed Feb 24, 2023
1 parent f64752f commit bb74552
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 3 additions & 3 deletions SymlinkCreator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Arnob Paul")]
[assembly: AssemblyProduct("Symlink Creator")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -52,5 +52,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.2.0")]
[assembly: AssemblyFileVersion("1.2.0")]
[assembly: AssemblyVersion("1.2.1")]
[assembly: AssemblyFileVersion("1.2.1")]
15 changes: 13 additions & 2 deletions SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public MainWindow()
#endregion


#region fields

private string _previouslySelectedFolderPath = "";

#endregion


#region window event handles

private void MainWindow_Loaded(object sender, RoutedEventArgs e)
Expand All @@ -51,8 +58,10 @@ protected override void OnSourceInitialized(EventArgs eventArgs)

private void AddFilesButton_OnClick(object sender, RoutedEventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.Multiselect = true;
OpenFileDialog fileDialog = new OpenFileDialog
{
Multiselect = true
};
bool? result = fileDialog.ShowDialog();

if (result == true)
Expand All @@ -65,11 +74,13 @@ private void AddFolderButton_OnClick(object sender, RoutedEventArgs e)
{
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
{
folderBrowserDialog.SelectedPath = _previouslySelectedFolderPath;
DialogResult result = folderBrowserDialog.ShowDialog();

if (result == System.Windows.Forms.DialogResult.OK)
{
AddToSourceFileOrFolderList(folderBrowserDialog.SelectedPath);
_previouslySelectedFolderPath = folderBrowserDialog.SelectedPath;
}
}
}
Expand Down

0 comments on commit bb74552

Please sign in to comment.