Skip to content

Commit

Permalink
Improved folder browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Exactol committed Jan 5, 2020
1 parent f98f228 commit d8087bd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
10 changes: 9 additions & 1 deletion CompilePalX/CompilePalX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,21 @@
<Reference Include="MahApps.Metro.IconPacks, Version=2.3.0.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.IconPacks.2.3.0\lib\net45\MahApps.Metro.IconPacks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
Expand Down
16 changes: 8 additions & 8 deletions CompilePalX/FileInput.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.WindowsAPICodePack.Dialogs;
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
using UserControl = System.Windows.Controls.UserControl;

Expand Down Expand Up @@ -97,16 +97,16 @@ private void FileBrowse_OnClick(object sender, RoutedEventArgs e)
if (IsFolder)
{
// create new folder dialog
// TODO look for a Nuget package for a folder browser that doesnt suck
using (var folderDialog = new FolderBrowserDialog()
using (var folderDialog = new CommonOpenFileDialog()
{
Description = "Select Folder",
SelectedPath = GameConfigurationManager.GameConfiguration.GameFolder
Title = "Select Folder",
IsFolderPicker = true,
InitialDirectory = GameConfigurationManager.GameConfiguration.GameFolder,
})
{
var folderPath = "";
folderDialog.ShowDialog();
folderPath = folderDialog.SelectedPath;
folderPath = folderDialog.FileName;

if (String.IsNullOrWhiteSpace(folderPath))
return;
Expand All @@ -122,8 +122,8 @@ private void FileBrowse_OnClick(object sender, RoutedEventArgs e)
Multiselect = false,
Filter = FileFilter,
CheckFileExists = false,
Title = FileDialogTitle
};
Title = FileDialogTitle,
};

var filePath = "";
fileDialog.ShowDialog();
Expand Down
2 changes: 2 additions & 0 deletions CompilePalX/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
<package id="Fody" version="5.0.6" targetFramework="net45" developmentDependency="true" />
<package id="MahApps.Metro" version="1.4.3" targetFramework="net45" />
<package id="MahApps.Metro.IconPacks" version="2.3.0" targetFramework="net45" />
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net45" />
<package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
</packages>

0 comments on commit d8087bd

Please sign in to comment.