2014-07-29 11:53:05 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using GameRes.Formats.Strings;
|
|
|
|
|
|
|
|
|
|
namespace GameRes.Formats.GUI
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for CreateONSWidget.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class CreateONSWidget : Grid
|
|
|
|
|
{
|
|
|
|
|
public CreateONSWidget ()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-01 03:38:04 +04:00
|
|
|
|
[ValueConversion (typeof (NScripter.Compression), typeof (string))]
|
2014-07-29 11:53:05 +04:00
|
|
|
|
class CompressionToStringConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
2015-09-01 03:38:04 +04:00
|
|
|
|
switch ((NScripter.Compression)value)
|
2014-07-29 11:53:05 +04:00
|
|
|
|
{
|
2015-09-01 03:38:04 +04:00
|
|
|
|
case NScripter.Compression.SPB: return "SPB";
|
|
|
|
|
case NScripter.Compression.LZSS: return "LZSS";
|
|
|
|
|
case NScripter.Compression.NBZ: return "NBZ";
|
2015-07-25 04:20:20 +04:00
|
|
|
|
default: return arcStrings.ONSCompressionNone;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
string s = value as string;
|
|
|
|
|
if (!string.IsNullOrEmpty (s))
|
|
|
|
|
{
|
|
|
|
|
if ("SPB" == s)
|
2015-09-01 03:38:04 +04:00
|
|
|
|
return NScripter.Compression.SPB;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
else if ("LZSS" == s)
|
2015-09-01 03:38:04 +04:00
|
|
|
|
return NScripter.Compression.LZSS;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
else if ("NBZ" == s)
|
2015-09-01 03:38:04 +04:00
|
|
|
|
return NScripter.Compression.NBZ;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
}
|
2015-09-01 03:38:04 +04:00
|
|
|
|
return NScripter.Compression.None;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|