2015-09-18 05:27:53 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows;
|
2015-03-11 20:37:51 +08:00
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using GameRes.Formats.Properties;
|
|
|
|
|
using GameRes.Formats.Selene;
|
2015-09-18 05:27:53 +08:00
|
|
|
|
using GameRes.Formats.Strings;
|
2015-03-11 20:37:51 +08:00
|
|
|
|
|
|
|
|
|
namespace GameRes.Formats.GUI
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for WidgetKCAP.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class WidgetKCAP : Grid
|
|
|
|
|
{
|
|
|
|
|
public WidgetKCAP ()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent ();
|
2015-09-18 05:27:53 +08:00
|
|
|
|
var keys = new[] { arcStrings.ArcDefault };
|
|
|
|
|
EncScheme.ItemsSource = keys.Concat (PackOpener.KnownSchemes.Keys);
|
|
|
|
|
if (-1 == EncScheme.SelectedIndex)
|
2015-03-11 20:37:51 +08:00
|
|
|
|
EncScheme.SelectedIndex = 0;
|
2015-03-11 22:51:52 +08:00
|
|
|
|
EncScheme.SelectionChanged += OnSchemeChanged;
|
2015-03-11 20:37:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnSchemeChanged (object sender, SelectionChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var widget = sender as ComboBox;
|
|
|
|
|
var pass = PackOpener.GetPassPhrase (widget.SelectedItem as string);
|
|
|
|
|
Passphrase.Text = pass;
|
|
|
|
|
Settings.Default.KCAPPassPhrase = pass;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|