Skip to content

Commit 6075294

Browse files
committed
[Enhancement] Multi-select folder browser (fixes #16)
1 parent d924a09 commit 6075294

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ Symlink Creator uses `mklink` command to create symlinks. Symlink Creator first
2323

2424
## Why Symlink Creator needs administrative rights
2525
It has been stated before that Symlink Creator uses `mklink` command to create symlinks. `mklink` command requires administrative privilege to create symlinks. You can find more information [here](https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links).
26+
27+
## Donation
28+
If you enjoy using Symlink Creator and also want to buy me a cup of tea, you are most welcome. You can send me a gift here: [PayPal](https://paypal.me/arnobpl)
29+
30+
Thank you for using Symlink Creator and sharing feedback. Happy Symlinking!

SymlinkCreator/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
5454

55-
[assembly: AssemblyVersion("1.2.6")]
56-
[assembly: AssemblyFileVersion("1.2.6")]
55+
[assembly: AssemblyVersion("1.2.7")]
56+
[assembly: AssemblyFileVersion("1.2.7")]

SymlinkCreator/ui/mainWindow/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
<StackPanel DockPanel.Dock="Left">
7777
<Button Content="Add files" Click="AddFilesButton_OnClick" />
78-
<Button Content="Add folder" Click="AddFolderButton_OnClick" />
78+
<Button Content="Add folders" Click="AddFoldersButton_OnClick" />
7979
</StackPanel>
8080

8181
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">

SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs

+4-17
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public MainWindow()
3333

3434
#region fields
3535

36-
private string _previouslySelectedAddFolderPath = "";
3736
private string _previouslySelectedDestinationFolderPath = "";
3837

3938
#endregion
@@ -64,26 +63,24 @@ private void AddFilesButton_OnClick(object sender, RoutedEventArgs e)
6463
{
6564
Multiselect = true
6665
};
67-
bool? result = fileDialog.ShowDialog();
6866

69-
if (result == true)
67+
if (fileDialog.ShowDialog() == true)
7068
{
7169
AddToSourceFileOrFolderList(fileDialog.FileNames);
7270
}
7371
}
7472

75-
private void AddFolderButton_OnClick(object sender, RoutedEventArgs e)
73+
private void AddFoldersButton_OnClick(object sender, RoutedEventArgs e)
7674
{
7775
CommonOpenFileDialog folderBrowserDialog = new CommonOpenFileDialog
7876
{
7977
IsFolderPicker = true,
80-
InitialDirectory = _previouslySelectedAddFolderPath
78+
Multiselect = true
8179
};
8280

8381
if (folderBrowserDialog.ShowDialog() == CommonFileDialogResult.Ok)
8482
{
85-
AddToSourceFileOrFolderList(folderBrowserDialog.FileName);
86-
_previouslySelectedAddFolderPath = folderBrowserDialog.FileName;
83+
AddToSourceFileOrFolderList(folderBrowserDialog.FileNames);
8784
}
8885
}
8986

@@ -201,16 +198,6 @@ private void AddToSourceFileOrFolderList(IEnumerable<string> fileOrFolderList)
201198
}
202199
}
203200

204-
private void AddToSourceFileOrFolderList(string fileOrFolderPath)
205-
{
206-
if (!(this.DataContext is MainWindowViewModel mainWindowViewModel)) return;
207-
208-
if (!mainWindowViewModel.FileOrFolderList.Contains(fileOrFolderPath))
209-
{
210-
mainWindowViewModel.FileOrFolderList.Add(fileOrFolderPath);
211-
}
212-
}
213-
214201
private void AssignDestinationPath(string destinationPath)
215202
{
216203
if (!(this.DataContext is MainWindowViewModel mainWindowViewModel)) return;

0 commit comments

Comments
 (0)