mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 15:44:00 +08:00
f1d66206bc
(ArchiveFormat.CanCreate): renamed to CanWrite.
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Input;
|
|
using GameRes;
|
|
using GARbro.GUI.Strings;
|
|
using Microsoft.WindowsAPICodePack.Dialogs;
|
|
|
|
namespace GARbro.GUI
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for ConvertMedia.xaml
|
|
/// </summary>
|
|
public partial class ConvertMedia : Window
|
|
{
|
|
public ConvertMedia ()
|
|
{
|
|
InitializeComponent ();
|
|
ImageConversionFormat.ItemsSource = FormatCatalog.Instance.ImageFormats.Where (f => f.CanWrite);
|
|
}
|
|
|
|
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
|
|
{
|
|
var dlg = new CommonOpenFileDialog
|
|
{
|
|
Title = guiStrings.TextChooseDestDir,
|
|
IsFolderPicker = true,
|
|
InitialDirectory = DestinationDir.Text,
|
|
|
|
AddToMostRecentlyUsedList = false,
|
|
AllowNonFileSystemItems = false,
|
|
EnsureFileExists = true,
|
|
EnsurePathExists = true,
|
|
EnsureReadOnly = false,
|
|
EnsureValidNames = true,
|
|
Multiselect = false,
|
|
ShowPlacesList = true,
|
|
};
|
|
if (dlg.ShowDialog (this) == CommonFileDialogResult.Ok)
|
|
DestinationDir.Text = dlg.FileName;
|
|
}
|
|
|
|
public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
|
|
{
|
|
e.CanExecute = true;
|
|
}
|
|
|
|
private void ConvertButton_Click (object sender, RoutedEventArgs e)
|
|
{
|
|
this.DialogResult = true;
|
|
}
|
|
}
|
|
}
|