2014-07-21 23:26:28 +04:00
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
2014-07-26 23:11:24 +04:00
|
|
|
|
using GameRes.Formats.Properties;
|
2014-07-21 23:26:28 +04:00
|
|
|
|
|
|
|
|
|
namespace GameRes.Formats.GUI
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for WidgetYPF.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class WidgetYPF : Grid
|
|
|
|
|
{
|
2014-07-26 23:11:24 +04:00
|
|
|
|
public WidgetYPF ()
|
2014-07-21 23:26:28 +04:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2014-07-26 23:11:24 +04:00
|
|
|
|
|
|
|
|
|
uint key = Settings.Default.YPFKey;
|
|
|
|
|
if (key < 0x100)
|
|
|
|
|
this.Passkey.Text = key.ToString();
|
2014-07-21 23:26:28 +04:00
|
|
|
|
else
|
|
|
|
|
this.Passkey.Text = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public uint? GetKey ()
|
|
|
|
|
{
|
|
|
|
|
uint key;
|
2014-07-26 23:11:24 +04:00
|
|
|
|
if (uint.TryParse (this.Passkey.Text, out key) && key < 0x100)
|
2014-07-21 23:26:28 +04:00
|
|
|
|
return key;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|