2014-07-29 11:53:05 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
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-07-25 04:20:20 +04:00
|
|
|
|
[ValueConversion (typeof (ONScripter.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-07-25 04:20:20 +04:00
|
|
|
|
switch ((ONScripter.Compression)value)
|
2014-07-29 11:53:05 +04:00
|
|
|
|
{
|
2015-07-25 04:20:20 +04:00
|
|
|
|
case ONScripter.Compression.SPB: return "SPB";
|
|
|
|
|
case ONScripter.Compression.LZSS: return "LZSS";
|
|
|
|
|
case ONScripter.Compression.NBZ: return "NBZ";
|
|
|
|
|
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-07-25 04:20:20 +04:00
|
|
|
|
return ONScripter.Compression.SPB;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
else if ("LZSS" == s)
|
2015-07-25 04:20:20 +04:00
|
|
|
|
return ONScripter.Compression.LZSS;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
else if ("NBZ" == s)
|
2015-07-25 04:20:20 +04:00
|
|
|
|
return ONScripter.Compression.NBZ;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
}
|
2015-07-25 04:20:20 +04:00
|
|
|
|
return ONScripter.Compression.None;
|
2014-07-29 11:53:05 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|