moved GUI project to a subdirectory.

This commit is contained in:
morkt 2016-01-07 19:06:08 +04:00
parent f85cf12fcd
commit 01153ad1a8
60 changed files with 7334 additions and 7340 deletions

View File

@ -16,7 +16,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArcFormats", "ArcFormats\Ar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameRes", "GameRes\GameRes.csproj", "{453C087F-E416-4AE9-8C03-D8760DA0574B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GARbro.GUI", "GARbro.GUI.csproj", "{2935BE57-C4E0-43E7-86DE-C1848C820B19}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GARbro.GUI", "GUI\GARbro.GUI.csproj", "{2935BE57-C4E0-43E7-86DE-C1848C820B19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Image.Convert", "Image.Convert\Image.Convert.csproj", "{757EB8B1-F62C-4690-AC3D-DAE4A5576B3E}"
ProjectSection(ProjectDependencies) = postProject

View File

@ -1,144 +1,144 @@
<!-- Game Resource browser
Copyright (C) 2014-2015 by morkt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
<w:ModalWindow x:Class="GARbro.GUI.AboutBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GARbro.GUI"
xmlns:w="clr-namespace:Rnd.Windows"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:gr="clr-namespace:GameRes;assembly=GameRes"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
Title="{x:Static s:guiStrings.TextAboutTitle}" Height="306" Width="550" ResizeMode="NoResize"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Window.Resources>
<local:BooleanToVisibiltyConverter x:Key="guiBoolToVisibilityConverter" />
<local:CanCreateConverter x:Key="guiCanCreateConverter"/>
<CollectionViewSource x:Key="ArcFormatsSource" Source="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ArcFormats, Mode=OneWay}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Tag" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<CollectionViewSource x:Key="ImageFormatsSource" Source="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ImageFormats, Mode=OneWay}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="IsBuiltin" Direction="Descending"/>
<scm:SortDescription PropertyName="Tag" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<Style x:Key="HiddenHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
<Style x:Key="DisableSelectionStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Focusable" Value="false"/>
<Setter Property="Margin" Value="-5,-1,-5,-1"/>
<Setter Property="Padding" Value="0"/>
</Style>
</Window.Resources>
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:AboutBox}}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="10">
<TextBox Text="{Binding Path=AssemblyTitle, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=VersionString, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=AssemblyCopyright, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" />
</StackPanel>
<Button Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsDefault="true"
Content="{x:Static s:guiStrings.ButtonOK}" Margin="10,0,0,10" Width="70" Height="25" Click="Button_Click" IsCancel="True"/>
<Grid Grid.Column="1" Margin="10">
<TabControl>
<TabItem Header="{x:Static s:guiStrings.TextAboutArchives}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ListView Name="ArchiveFormats" ItemsSource="{Binding Source={StaticResource ArcFormatsSource}}"
ItemContainerStyle="{StaticResource DisableSelectionStyle}" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="False">
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StaticResource HiddenHeaderStyle}">
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Tag}" Margin="0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=CanCreate, Converter={StaticResource guiCanCreateConverter}}" Margin="-6,0,-6,0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}" Margin="0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutImages}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ScrollViewer VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0" Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}">
<ItemsControl Name="ImageFormats" ItemsSource="{Binding Source={StaticResource ImageFormatsSource}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Tag}" Margin="3,0,5,0" />
<TextBlock Text="{x:Static s:guiStrings.TextAboutBuiltin}" Margin="0,0,5,0" Visibility="{Binding IsBuiltin, Converter={StaticResource guiBoolToVisibilityConverter}}"/>
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutAudio}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ScrollViewer VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0" Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}">
<ItemsControl Name="AudioFormats" ItemsSource="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=AudioFormats, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Tag}" Margin="3,0,7,0" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutLicense}">
<ScrollViewer>
<RichTextBox Name="LicenseTabText" IsReadOnly="True"/>
</ScrollViewer>
</TabItem>
</TabControl>
</Grid>
</Grid>
</w:ModalWindow>
<!-- Game Resource browser
Copyright (C) 2014-2015 by morkt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
<w:ModalWindow x:Class="GARbro.GUI.AboutBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GARbro.GUI"
xmlns:w="clr-namespace:Rnd.Windows"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:gr="clr-namespace:GameRes;assembly=GameRes"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
Title="{x:Static s:guiStrings.TextAboutTitle}" Height="306" Width="550" ResizeMode="NoResize"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Window.Resources>
<local:BooleanToVisibiltyConverter x:Key="guiBoolToVisibilityConverter" />
<local:CanCreateConverter x:Key="guiCanCreateConverter"/>
<CollectionViewSource x:Key="ArcFormatsSource" Source="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ArcFormats, Mode=OneWay}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Tag" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<CollectionViewSource x:Key="ImageFormatsSource" Source="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ImageFormats, Mode=OneWay}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="IsBuiltin" Direction="Descending"/>
<scm:SortDescription PropertyName="Tag" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<Style x:Key="HiddenHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
<Style x:Key="DisableSelectionStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Focusable" Value="false"/>
<Setter Property="Margin" Value="-5,-1,-5,-1"/>
<Setter Property="Padding" Value="0"/>
</Style>
</Window.Resources>
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:AboutBox}}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="10">
<TextBox Text="{Binding Path=AssemblyTitle, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=VersionString, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" Margin="0,0,0,10" />
<TextBox Text="{Binding Path=AssemblyCopyright, Mode=OneWay}" IsReadOnly="True" Background="Transparent" BorderThickness="0" />
</StackPanel>
<Button Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsDefault="true"
Content="{x:Static s:guiStrings.ButtonOK}" Margin="10,0,0,10" Width="70" Height="25" Click="Button_Click" IsCancel="True"/>
<Grid Grid.Column="1" Margin="10">
<TabControl>
<TabItem Header="{x:Static s:guiStrings.TextAboutArchives}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ListView Name="ArchiveFormats" ItemsSource="{Binding Source={StaticResource ArcFormatsSource}}"
ItemContainerStyle="{StaticResource DisableSelectionStyle}" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="False">
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StaticResource HiddenHeaderStyle}">
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Tag}" Margin="0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=CanCreate, Converter={StaticResource guiCanCreateConverter}}" Margin="-6,0,-6,0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}" Margin="0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutImages}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ScrollViewer VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0" Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}">
<ItemsControl Name="ImageFormats" ItemsSource="{Binding Source={StaticResource ImageFormatsSource}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Tag}" Margin="3,0,5,0" />
<TextBlock Text="{x:Static s:guiStrings.TextAboutBuiltin}" Margin="0,0,5,0" Visibility="{Binding IsBuiltin, Converter={StaticResource guiBoolToVisibilityConverter}}"/>
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutAudio}">
<Border BorderThickness="1" BorderBrush="Black" VerticalAlignment="Stretch" Margin="0" SnapsToDevicePixels="True">
<ScrollViewer VerticalAlignment="Stretch" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Margin="0" Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}">
<ItemsControl Name="AudioFormats" ItemsSource="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=AudioFormats, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Tag}" Margin="3,0,7,0" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Border>
</TabItem>
<TabItem Header="{x:Static s:guiStrings.TextAboutLicense}">
<ScrollViewer>
<RichTextBox Name="LicenseTabText" IsReadOnly="True"/>
</ScrollViewer>
</TabItem>
</TabControl>
</Grid>
</Grid>
</w:ModalWindow>

View File

@ -1,277 +1,277 @@
/// Game Resource browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for AboutBox.xaml
/// </summary>
public partial class AboutBox : Rnd.Windows.ModalWindow
{
public AboutBox()
{
InitializeComponent();
LicenseTabText.Document = GetResourceDoc ("GARbro.GUI.LICENSE");
}
private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
#region License text backend
static FlowDocument GetResourceDoc (string resource)
{
var assembly = Assembly.GetExecutingAssembly();
using (var stream = assembly.GetManifestResourceStream (resource))
{
if (null == stream)
return new FlowDocument();
return ReadPlainText (stream);
}
}
/// <summary>
/// Read plain text from stream and return it as FlowDocument.
/// </summary>
static FlowDocument ReadPlainText (Stream stream)
{
using (var reader = new StreamReader (stream))
{
var doc = new FlowDocument();
var para = new Paragraph();
for (;;)
{
var line = reader.ReadLine();
if (null == line)
break;
if (line.Length > 0)
{
if (para.Inlines.Count > 0)
para.Inlines.Add (" ");
para.Inlines.Add (line);
}
else
{
if (0 == para.Inlines.Count)
para.Inlines.Add (new LineBreak());
doc.Blocks.Add (para);
para = new Paragraph();
}
}
if (para.Inlines.Count > 0)
doc.Blocks.Add (para);
return doc;
}
}
#endregion
#region Assembly Attribute Accessors
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string VersionString
{
get
{
return string.Format (guiStrings.MsgVersion, AssemblyVersion);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
}
public class BooleanToVisibiltyConverter : IValueConverter
{
/// <summary>Convert a boolean value to a Visibility value</summary>
public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool isVisible = (bool)value;
// If visibility is inverted by the converter parameter, then invert our value
if (IsVisibilityInverted (parameter))
isVisible = !isVisible;
return (isVisible ? Visibility.Visible : Visibility.Collapsed);
}
/// <summary>
/// Determine the visibility mode based on a converter parameter. This parameter is
/// of type Visibility, and specifies what visibility value to return when the boolean
/// value is true.
/// </summary>
private static Visibility GetVisibilityMode(object parameter)
{
// Default to Visible
Visibility mode = Visibility.Visible;
// If a parameter is specified, then we'll try to understand it as a Visibility value
if (parameter != null)
{
// If it's already a Visibility value, then just use it
if (parameter is Visibility)
{
mode = (Visibility)parameter;
}
else
{
// Let's try to parse the parameter as a Visibility value, throwing an exception when the parsing fails
try
{
mode = (Visibility)Enum.Parse(typeof(Visibility), parameter.ToString(), true);
}
catch (FormatException e)
{
throw new FormatException("Invalid Visibility specified as the ConverterParameter. Use Visible or Collapsed.", e);
}
}
}
// Return the detected mode
return mode;
}
/// <summary>
/// Determine whether or not visibility is inverted based on a converter parameter.
/// When the parameter is specified as Collapsed, that means that when the boolean value
/// is true, we should return Collapsed, which is inverted.
/// </summary>
private static bool IsVisibilityInverted(object parameter)
{
return (GetVisibilityMode(parameter) == Visibility.Collapsed);
}
/// <summary>
/// Support 2-way databinding of the VisibilityConverter, converting Visibility to a boolean
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool isVisible = ((Visibility)value == Visibility.Visible);
// If visibility is inverted by the converter parameter, then invert our value
if (IsVisibilityInverted(parameter))
isVisible = !isVisible;
return isVisible;
}
}
[ValueConversion(typeof(bool), typeof(string))]
class CanCreateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (bool)value ? "[r/w]" : "[r]";
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return false;
}
}
}
/// Game Resource browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for AboutBox.xaml
/// </summary>
public partial class AboutBox : Rnd.Windows.ModalWindow
{
public AboutBox()
{
InitializeComponent();
LicenseTabText.Document = GetResourceDoc ("GARbro.GUI.LICENSE");
}
private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
#region License text backend
static FlowDocument GetResourceDoc (string resource)
{
var assembly = Assembly.GetExecutingAssembly();
using (var stream = assembly.GetManifestResourceStream (resource))
{
if (null == stream)
return new FlowDocument();
return ReadPlainText (stream);
}
}
/// <summary>
/// Read plain text from stream and return it as FlowDocument.
/// </summary>
static FlowDocument ReadPlainText (Stream stream)
{
using (var reader = new StreamReader (stream))
{
var doc = new FlowDocument();
var para = new Paragraph();
for (;;)
{
var line = reader.ReadLine();
if (null == line)
break;
if (line.Length > 0)
{
if (para.Inlines.Count > 0)
para.Inlines.Add (" ");
para.Inlines.Add (line);
}
else
{
if (0 == para.Inlines.Count)
para.Inlines.Add (new LineBreak());
doc.Blocks.Add (para);
para = new Paragraph();
}
}
if (para.Inlines.Count > 0)
doc.Blocks.Add (para);
return doc;
}
}
#endregion
#region Assembly Attribute Accessors
public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
public string VersionString
{
get
{
return string.Format (guiStrings.MsgVersion, AssemblyVersion);
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}
public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}
public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}
public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion
}
public class BooleanToVisibiltyConverter : IValueConverter
{
/// <summary>Convert a boolean value to a Visibility value</summary>
public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool isVisible = (bool)value;
// If visibility is inverted by the converter parameter, then invert our value
if (IsVisibilityInverted (parameter))
isVisible = !isVisible;
return (isVisible ? Visibility.Visible : Visibility.Collapsed);
}
/// <summary>
/// Determine the visibility mode based on a converter parameter. This parameter is
/// of type Visibility, and specifies what visibility value to return when the boolean
/// value is true.
/// </summary>
private static Visibility GetVisibilityMode(object parameter)
{
// Default to Visible
Visibility mode = Visibility.Visible;
// If a parameter is specified, then we'll try to understand it as a Visibility value
if (parameter != null)
{
// If it's already a Visibility value, then just use it
if (parameter is Visibility)
{
mode = (Visibility)parameter;
}
else
{
// Let's try to parse the parameter as a Visibility value, throwing an exception when the parsing fails
try
{
mode = (Visibility)Enum.Parse(typeof(Visibility), parameter.ToString(), true);
}
catch (FormatException e)
{
throw new FormatException("Invalid Visibility specified as the ConverterParameter. Use Visible or Collapsed.", e);
}
}
}
// Return the detected mode
return mode;
}
/// <summary>
/// Determine whether or not visibility is inverted based on a converter parameter.
/// When the parameter is specified as Collapsed, that means that when the boolean value
/// is true, we should return Collapsed, which is inverted.
/// </summary>
private static bool IsVisibilityInverted(object parameter)
{
return (GetVisibilityMode(parameter) == Visibility.Collapsed);
}
/// <summary>
/// Support 2-way databinding of the VisibilityConverter, converting Visibility to a boolean
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool isVisible = ((Visibility)value == Visibility.Visible);
// If visibility is inverted by the converter parameter, then invert our value
if (IsVisibilityInverted(parameter))
isVisible = !isVisible;
return isVisible;
}
}
[ValueConversion(typeof(bool), typeof(string))]
class CanCreateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (bool)value ? "[r/w]" : "[r]";
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return false;
}
}
}

View File

@ -1,96 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="GARbro.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<GARbro.GUI.Properties.Settings>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="winTop" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="winLeft" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="winWidth" serializeAs="String">
<value>1024</value>
</setting>
<setting name="winHeight" serializeAs="String">
<value>600</value>
</setting>
<setting name="winState" serializeAs="String">
<value>Normal</value>
</setting>
<setting name="lvNameColumnWidth" serializeAs="String">
<value>265</value>
</setting>
<setting name="lvTypeColumnWidth" serializeAs="String">
<value>75</value>
</setting>
<setting name="lvSizeColumnWidth" serializeAs="String">
<value>75</value>
</setting>
<setting name="lvSortColumn" serializeAs="String">
<value>Name</value>
</setting>
<setting name="lvSortDirection" serializeAs="String">
<value>Ascending</value>
</setting>
<setting name="lvPanelWidth" serializeAs="String">
<value>448</value>
</setting>
<setting name="appExtractImages" serializeAs="String">
<value>True</value>
</setting>
<setting name="appExtractText" serializeAs="String">
<value>True</value>
</setting>
<setting name="appImageFormat" serializeAs="String">
<value />
</setting>
<setting name="appTextEncoding" serializeAs="String">
<value>65001</value>
</setting>
<setting name="appLastDirectory" serializeAs="String">
<value />
</setting>
<setting name="appArchiveFormat" serializeAs="String">
<value />
</setting>
<setting name="appLastCreatedArchive" serializeAs="String">
<value />
</setting>
<setting name="winMenuBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="winToolBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="winStatusBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="appLastImageFormat" serializeAs="String">
<value>PNG</value>
</setting>
<setting name="appConvertAudio" serializeAs="String">
<value>False</value>
</setting>
<setting name="appExtractAudio" serializeAs="String">
<value>True</value>
</setting>
<setting name="appIgnoreConversionErrors" serializeAs="String">
<value>False</value>
</setting>
<setting name="appLastDestination" serializeAs="String">
<value />
</setting>
</GARbro.GUI.Properties.Settings>
</userSettings>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="GARbro.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<GARbro.GUI.Properties.Settings>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="winTop" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="winLeft" serializeAs="String">
<value>NaN</value>
</setting>
<setting name="winWidth" serializeAs="String">
<value>1024</value>
</setting>
<setting name="winHeight" serializeAs="String">
<value>600</value>
</setting>
<setting name="winState" serializeAs="String">
<value>Normal</value>
</setting>
<setting name="lvNameColumnWidth" serializeAs="String">
<value>265</value>
</setting>
<setting name="lvTypeColumnWidth" serializeAs="String">
<value>75</value>
</setting>
<setting name="lvSizeColumnWidth" serializeAs="String">
<value>75</value>
</setting>
<setting name="lvSortColumn" serializeAs="String">
<value>Name</value>
</setting>
<setting name="lvSortDirection" serializeAs="String">
<value>Ascending</value>
</setting>
<setting name="lvPanelWidth" serializeAs="String">
<value>448</value>
</setting>
<setting name="appExtractImages" serializeAs="String">
<value>True</value>
</setting>
<setting name="appExtractText" serializeAs="String">
<value>True</value>
</setting>
<setting name="appImageFormat" serializeAs="String">
<value />
</setting>
<setting name="appTextEncoding" serializeAs="String">
<value>65001</value>
</setting>
<setting name="appLastDirectory" serializeAs="String">
<value />
</setting>
<setting name="appArchiveFormat" serializeAs="String">
<value />
</setting>
<setting name="appLastCreatedArchive" serializeAs="String">
<value />
</setting>
<setting name="winMenuBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="winToolBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="winStatusBarVisibility" serializeAs="String">
<value>Visible</value>
</setting>
<setting name="appLastImageFormat" serializeAs="String">
<value>PNG</value>
</setting>
<setting name="appConvertAudio" serializeAs="String">
<value>False</value>
</setting>
<setting name="appExtractAudio" serializeAs="String">
<value>True</value>
</setting>
<setting name="appIgnoreConversionErrors" serializeAs="String">
<value>False</value>
</setting>
<setting name="appLastDestination" serializeAs="String">
<value />
</setting>
</GARbro.GUI.Properties.Settings>
</userSettings>
</configuration>

View File

@ -1,9 +1,9 @@
<Application x:Class="GARbro.GUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" Startup="ApplicationStartup"
ShutdownMode="OnMainWindowClose" Exit="ApplicationExit">
<Application.Resources>
<BitmapImage x:Key="IconSearch" UriSource="pack://application:,,,/Images/search4files.ico" />
</Application.Resources>
</Application>
<Application x:Class="GARbro.GUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" Startup="ApplicationStartup"
ShutdownMode="OnMainWindowClose" Exit="ApplicationExit">
<Application.Resources>
<BitmapImage x:Key="IconSearch" UriSource="pack://application:,,,/Images/search4files.ico" />
</Application.Resources>
</Application>

View File

@ -1,112 +1,112 @@
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Windows;
using System.Diagnostics;
using GARbro.GUI.Properties;
using GameRes;
using GameRes.Compression;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
const StringComparison StringIgnoreCase = StringComparison.OrdinalIgnoreCase;
public static string Name { get { return "GARbro"; } }
/// <summary>
/// Initial browsing directory.
/// </summary>
public string InitPath { get; private set; }
void ApplicationStartup (object sender, StartupEventArgs e)
{
string exe_dir = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
#if DEBUG
Trace.Listeners.Add (new TextWriterTraceListener (Path.Combine (exe_dir, "trace.log")));
Trace.AutoFlush = true;
#endif
Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App");
this.DispatcherUnhandledException += (s, args) =>
{
Trace.WriteLine (string.Format ("Unhandled exception caught: {0}", args.Exception.Message),
"GARbro.GUI.App");
Trace.WriteLine (args.Exception.StackTrace, "Stack trace");
};
try
{
if (0 != e.Args.Length)
{
InitPath = Path.GetFullPath (e.Args[0]);
}
else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory))
{
string last_dir = Settings.Default.appLastDirectory;
Directory.SetCurrentDirectory (last_dir);
InitPath = last_dir;
}
}
catch { }
if (string.IsNullOrEmpty (InitPath))
InitPath = Directory.GetCurrentDirectory();
string scheme_file = Path.Combine (exe_dir, "Formats.dat");
try
{
using (var file = File.OpenRead (scheme_file))
DeserializeScheme (file);
}
catch (Exception X)
{
Trace.WriteLine (X.Message, "scheme deserialization failed");
}
}
void ApplicationExit (object sender, ExitEventArgs e)
{
Settings.Default.Save();
}
void DeserializeScheme (Stream file)
{
using (var reader = new BinaryReader (file))
{
var scheme_id = FormatCatalog.Instance.SchemeID;
var header = reader.ReadChars (scheme_id.Length);
if (!header.SequenceEqual (scheme_id))
throw new FormatException ("Invalid serialization file");
int version = reader.ReadInt32();
using (var zs = new ZLibStream (file, CompressionMode.Decompress))
FormatCatalog.Instance.DeserializeScheme (zs);
}
}
}
}
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Windows;
using System.Diagnostics;
using GARbro.GUI.Properties;
using GameRes;
using GameRes.Compression;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
const StringComparison StringIgnoreCase = StringComparison.OrdinalIgnoreCase;
public static string Name { get { return "GARbro"; } }
/// <summary>
/// Initial browsing directory.
/// </summary>
public string InitPath { get; private set; }
void ApplicationStartup (object sender, StartupEventArgs e)
{
string exe_dir = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly().Location);
#if DEBUG
Trace.Listeners.Add (new TextWriterTraceListener (Path.Combine (exe_dir, "trace.log")));
Trace.AutoFlush = true;
#endif
Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App");
this.DispatcherUnhandledException += (s, args) =>
{
Trace.WriteLine (string.Format ("Unhandled exception caught: {0}", args.Exception.Message),
"GARbro.GUI.App");
Trace.WriteLine (args.Exception.StackTrace, "Stack trace");
};
try
{
if (0 != e.Args.Length)
{
InitPath = Path.GetFullPath (e.Args[0]);
}
else if (!string.IsNullOrEmpty (Settings.Default.appLastDirectory))
{
string last_dir = Settings.Default.appLastDirectory;
Directory.SetCurrentDirectory (last_dir);
InitPath = last_dir;
}
}
catch { }
if (string.IsNullOrEmpty (InitPath))
InitPath = Directory.GetCurrentDirectory();
string scheme_file = Path.Combine (exe_dir, "Formats.dat");
try
{
using (var file = File.OpenRead (scheme_file))
DeserializeScheme (file);
}
catch (Exception X)
{
Trace.WriteLine (X.Message, "scheme deserialization failed");
}
}
void ApplicationExit (object sender, ExitEventArgs e)
{
Settings.Default.Save();
}
void DeserializeScheme (Stream file)
{
using (var reader = new BinaryReader (file))
{
var scheme_id = FormatCatalog.Instance.SchemeID;
var header = reader.ReadChars (scheme_id.Length);
if (!header.SequenceEqual (scheme_id))
throw new FormatException ("Invalid serialization file");
int version = reader.ReadInt32();
using (var zs = new ZLibStream (file, CompressionMode.Decompress))
FormatCatalog.Instance.DeserializeScheme (zs);
}
}
}
}

View File

@ -1,24 +1,24 @@
<Window x:Class="GARbro.GUI.ArcParametersDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextParametersTitle}" SizeToContent="WidthAndHeight"
UseLayoutRounding="True" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<Window.Resources>
<BitmapImage x:Key="Icon64x64Info" UriSource="Images/64x64/info.png"/>
</Window.Resources>
<StackPanel Orientation="Horizontal">
<Image Width="64" Height="64" Source="Images/64x64/info.png"
SnapsToDevicePixels="True" VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="HighQuality" Margin="10,10,0,0"/>
<DockPanel Name="WidgetPane" VerticalAlignment="Top" Margin="10">
<TextBlock Name="Notice" DockPanel.Dock="Top" TextWrapping="WrapWithOverflow" Margin="0,0,0,10"/>
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="20,20,0,0">
<Button Content="{x:Static s:guiStrings.ButtonOK}" Click="Button_Click" IsDefault="True" Width="70" Height="25" Margin="0,0,10,0"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" IsCancel="True" Width="70" Height="25" Margin="10,0,0,0"/>
</StackPanel>
</DockPanel>
</StackPanel>
</Window>
<Window x:Class="GARbro.GUI.ArcParametersDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextParametersTitle}" SizeToContent="WidthAndHeight"
UseLayoutRounding="True" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<Window.Resources>
<BitmapImage x:Key="Icon64x64Info" UriSource="Images/64x64/info.png"/>
</Window.Resources>
<StackPanel Orientation="Horizontal">
<Image Width="64" Height="64" Source="Images/64x64/info.png"
SnapsToDevicePixels="True" VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="HighQuality" Margin="10,10,0,0"/>
<DockPanel Name="WidgetPane" VerticalAlignment="Top" Margin="10">
<TextBlock Name="Notice" DockPanel.Dock="Top" TextWrapping="WrapWithOverflow" Margin="0,0,0,10"/>
<StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" Margin="20,20,0,0">
<Button Content="{x:Static s:guiStrings.ButtonOK}" Click="Button_Click" IsDefault="True" Width="70" Height="25" Margin="0,0,10,0"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" IsCancel="True" Width="70" Height="25" Margin="10,0,0,0"/>
</StackPanel>
</DockPanel>
</StackPanel>
</Window>

View File

@ -1,22 +1,22 @@
using System.Windows;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ArcParameters.xaml
/// </summary>
public partial class ArcParametersDialog : Window
{
public ArcParametersDialog (UIElement widget, string notice)
{
InitializeComponent();
this.WidgetPane.Children.Add (widget);
this.Notice.Text = notice;
}
private void Button_Click (object sender, RoutedEventArgs e)
{
DialogResult = true;
}
}
}
using System.Windows;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ArcParameters.xaml
/// </summary>
public partial class ArcParametersDialog : Window
{
public ArcParametersDialog (UIElement widget, string notice)
{
InitializeComponent();
this.WidgetPane.Children.Add (widget);
this.Notice.Text = notice;
}
private void Button_Click (object sender, RoutedEventArgs e)
{
DialogResult = true;
}
}
}

View File

@ -1,166 +1,166 @@
//! \file DragScroll.cs
//! \date Sun Jul 06 10:47:20 2014
//! \brief Scroll control contents by dragging.
//
// http://matthamilton.net/touchscrolling-for-scrollviewer
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Diagnostics;
namespace GARbro.GUI
{
public class TouchScrolling : DependencyObject
{
public static bool GetIsEnabled(DependencyObject obj)
{
return (bool)obj.GetValue(IsEnabledProperty);
}
public static void SetIsEnabled(DependencyObject obj, bool value)
{
obj.SetValue(IsEnabledProperty, value);
}
public bool IsEnabled
{
get { return (bool)GetValue(IsEnabledProperty); }
set { SetValue(IsEnabledProperty, value); }
}
public static readonly DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(TouchScrolling), new UIPropertyMetadata(false, IsEnabledChanged));
static Dictionary<object, MouseCapture> _captures = new Dictionary<object, MouseCapture>();
static void IsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var target = d as FrameworkElement;
if (target == null) return;
if ((bool)e.NewValue)
{
target.Loaded += target_Loaded;
}
else
{
target_Unloaded(target, new RoutedEventArgs());
}
}
static void target_Unloaded(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Target Unloaded");
var target = sender as FrameworkElement;
if (null == target)
return;
_captures.Remove(sender);
target.Loaded -= target_Loaded;
target.Unloaded -= target_Unloaded;
target.PreviewMouseLeftButtonDown -= target_PreviewMouseLeftButtonDown;
target.PreviewMouseMove -= target_PreviewMouseMove;
target.PreviewMouseLeftButtonUp -= target_PreviewMouseLeftButtonUp;
}
static void target_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var target = sender as FrameworkElement;
if (null == target)
return;
var scroller = FindVisualParent<ScrollViewer> (target);
if (null == scroller)
{
Trace.WriteLine ("Control should be placed inside ScrollViewer for drag scrolling to work");
return;
}
_captures[sender] = new MouseCapture
{
HorizontalOffset = scroller.HorizontalOffset,
VerticalOffset = scroller.VerticalOffset,
Point = e.GetPosition(scroller),
};
}
static void target_Loaded(object sender, RoutedEventArgs e)
{
var target = sender as FrameworkElement;
if (target == null) return;
// Debug.WriteLine("DragScroll target Loaded", sender);
target.Unloaded += target_Unloaded;
target.PreviewMouseLeftButtonDown += target_PreviewMouseLeftButtonDown;
target.PreviewMouseMove += target_PreviewMouseMove;
target.PreviewMouseLeftButtonUp += target_PreviewMouseLeftButtonUp;
}
static void target_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var target = sender as FrameworkElement;
if (target == null) return;
target.ReleaseMouseCapture();
target.Cursor = Cursors.Arrow;
}
static void target_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (!_captures.ContainsKey(sender)) return;
if (e.LeftButton != MouseButtonState.Pressed)
{
_captures.Remove(sender);
return;
}
var target = sender as FrameworkElement;
if (null == target)
return;
var scroller = FindVisualParent<ScrollViewer> (target);
if (null == scroller)
return;
var capture = _captures[sender];
var point = e.GetPosition (scroller);
var dx = point.X - capture.Point.X;
var dy = point.Y - capture.Point.Y;
if (System.Math.Abs(dy) > 5 || System.Math.Abs(dx) > 5)
{
target.CaptureMouse();
target.Cursor = Cursors.SizeAll;
}
scroller.ScrollToHorizontalOffset(capture.HorizontalOffset - dx);
scroller.ScrollToVerticalOffset(capture.VerticalOffset - dy);
}
static parentItem FindVisualParent<parentItem> (DependencyObject obj) where parentItem : DependencyObject
{
if (null == obj)
return null;
DependencyObject parent = VisualTreeHelper.GetParent (obj);
while (parent != null && !(parent is parentItem))
{
parent = VisualTreeHelper.GetParent (parent);
}
return parent as parentItem;
}
internal class MouseCapture
{
public double HorizontalOffset { get; set; }
public double VerticalOffset { get; set; }
public Point Point { get; set; }
}
}
}
//! \file DragScroll.cs
//! \date Sun Jul 06 10:47:20 2014
//! \brief Scroll control contents by dragging.
//
// http://matthamilton.net/touchscrolling-for-scrollviewer
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Diagnostics;
namespace GARbro.GUI
{
public class TouchScrolling : DependencyObject
{
public static bool GetIsEnabled(DependencyObject obj)
{
return (bool)obj.GetValue(IsEnabledProperty);
}
public static void SetIsEnabled(DependencyObject obj, bool value)
{
obj.SetValue(IsEnabledProperty, value);
}
public bool IsEnabled
{
get { return (bool)GetValue(IsEnabledProperty); }
set { SetValue(IsEnabledProperty, value); }
}
public static readonly DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(TouchScrolling), new UIPropertyMetadata(false, IsEnabledChanged));
static Dictionary<object, MouseCapture> _captures = new Dictionary<object, MouseCapture>();
static void IsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var target = d as FrameworkElement;
if (target == null) return;
if ((bool)e.NewValue)
{
target.Loaded += target_Loaded;
}
else
{
target_Unloaded(target, new RoutedEventArgs());
}
}
static void target_Unloaded(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Target Unloaded");
var target = sender as FrameworkElement;
if (null == target)
return;
_captures.Remove(sender);
target.Loaded -= target_Loaded;
target.Unloaded -= target_Unloaded;
target.PreviewMouseLeftButtonDown -= target_PreviewMouseLeftButtonDown;
target.PreviewMouseMove -= target_PreviewMouseMove;
target.PreviewMouseLeftButtonUp -= target_PreviewMouseLeftButtonUp;
}
static void target_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var target = sender as FrameworkElement;
if (null == target)
return;
var scroller = FindVisualParent<ScrollViewer> (target);
if (null == scroller)
{
Trace.WriteLine ("Control should be placed inside ScrollViewer for drag scrolling to work");
return;
}
_captures[sender] = new MouseCapture
{
HorizontalOffset = scroller.HorizontalOffset,
VerticalOffset = scroller.VerticalOffset,
Point = e.GetPosition(scroller),
};
}
static void target_Loaded(object sender, RoutedEventArgs e)
{
var target = sender as FrameworkElement;
if (target == null) return;
// Debug.WriteLine("DragScroll target Loaded", sender);
target.Unloaded += target_Unloaded;
target.PreviewMouseLeftButtonDown += target_PreviewMouseLeftButtonDown;
target.PreviewMouseMove += target_PreviewMouseMove;
target.PreviewMouseLeftButtonUp += target_PreviewMouseLeftButtonUp;
}
static void target_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var target = sender as FrameworkElement;
if (target == null) return;
target.ReleaseMouseCapture();
target.Cursor = Cursors.Arrow;
}
static void target_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (!_captures.ContainsKey(sender)) return;
if (e.LeftButton != MouseButtonState.Pressed)
{
_captures.Remove(sender);
return;
}
var target = sender as FrameworkElement;
if (null == target)
return;
var scroller = FindVisualParent<ScrollViewer> (target);
if (null == scroller)
return;
var capture = _captures[sender];
var point = e.GetPosition (scroller);
var dx = point.X - capture.Point.X;
var dy = point.Y - capture.Point.Y;
if (System.Math.Abs(dy) > 5 || System.Math.Abs(dx) > 5)
{
target.CaptureMouse();
target.Cursor = Cursors.SizeAll;
}
scroller.ScrollToHorizontalOffset(capture.HorizontalOffset - dx);
scroller.ScrollToVerticalOffset(capture.VerticalOffset - dy);
}
static parentItem FindVisualParent<parentItem> (DependencyObject obj) where parentItem : DependencyObject
{
if (null == obj)
return null;
DependencyObject parent = VisualTreeHelper.GetParent (obj);
while (parent != null && !(parent is parentItem))
{
parent = VisualTreeHelper.GetParent (parent);
}
return parent as parentItem;
}
internal class MouseCapture
{
public double HorizontalOffset { get; set; }
public double VerticalOffset { get; set; }
public Point Point { get; set; }
}
}
}

View File

@ -1,72 +1,72 @@
<local:ExtractDialog x:Class="GARbro.GUI.ExtractArchiveDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextExtractTitle}" SizeToContent="WidthAndHeight"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<!-- Binding to application settings causes Visual Studio designer to crash.
Replace {Settings} bindings with "True" for designer to work.
WPF is awesome. -->
<StackPanel Orientation="Vertical">
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractAllTo}" Margin="10,10,10,0" VerticalAlignment="Top" Height="15"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,0,10,10" VerticalAlignment="Bottom" Width="370" Grid.Row="0" Grid.Column="0"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}" Height="23"/>
<Button Margin="0,0,10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1"
Command="{x:Static local:Commands.Browse}" Height="22" Width="22">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<CheckBox Name="ExtractImages" Content="{x:Static s:guiStrings.TextExtractImages}" HorizontalAlignment="Left" Margin="10,6,0,7.383" Grid.Row="0" Grid.Column="0"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractImages, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" Margin="0,0,10,0" HorizontalAlignment="Right">
<Border BorderBrush="{x:Null}" Height="28" Width="115" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" >
<TextBlock Text="{x:Static s:guiStrings.TextSaveImagesAs}" TextWrapping="Wrap" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</Border>
<ComboBox Name="ImageConversionFormat" DisplayMemberPath="Tag" Margin="10,3,0,0" VerticalAlignment="Top" Height="21" HorizontalAlignment="Right" Width="75"/>
</StackPanel>
<CheckBox Grid.Row="2" Grid.Column="0" x:Name="ExtractText" Content="{x:Static s:guiStrings.TextExtractText}" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="10,6,0,0" Visibility="Collapsed"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractText, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<StackPanel Grid.Row="2" Grid.Column="1" Visibility="Collapsed" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock Text="{x:Static s:guiStrings.TextEncoding}" TextAlignment="Right" VerticalAlignment="Top" Height="15" HorizontalAlignment="Right"/>
<ComboBox x:Name="TextEncoding" VerticalAlignment="Top" Margin="10,3,0,0" Height="21" HorizontalAlignment="Right" Width="76"/>
</StackPanel>
<CheckBox x:Name="ExtractAudio" Content="{x:Static s:guiStrings.TextExtractAudio}" HorizontalAlignment="Left" VerticalAlignment="Top"
Grid.Row="1" Grid.Column="0" Margin="10,6,10,0"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractAudio, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<CheckBox Grid.Row="1" Grid.Column="1" x:Name="AudioConversion" Content="{x:Static s:guiStrings.TextConvertAudio}"
Margin="0,6,10,0" HorizontalAlignment="Right" ToolTip="{x:Static s:guiStrings.TooltipAudioFormats}" VerticalAlignment="Top"
IsEnabled="{Binding ElementName=ExtractAudio, Path=IsChecked}"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appConvertAudio, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
</Grid>
<Separator Height="1" Margin="0,10,0,0"/>
<StackPanel Orientation="Horizontal" Margin="0,10,10,10" HorizontalAlignment="Right" VerticalAlignment="Bottom">
<Button Content="{x:Static s:guiStrings.ButtonExtract}" Margin="0" Click="ExtractButton_Click" Grid.Row="2" Width="75" Height="25" VerticalAlignment="Bottom" IsDefault="True"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" Margin="20,0,0,0" Height="25" VerticalAlignment="Bottom" IsCancel="True" Width="75"/>
</StackPanel>
</StackPanel>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.Browse}" Executed="BrowseExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</local:ExtractDialog>
<local:ExtractDialog x:Class="GARbro.GUI.ExtractArchiveDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextExtractTitle}" SizeToContent="WidthAndHeight"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<!-- Binding to application settings causes Visual Studio designer to crash.
Replace {Settings} bindings with "True" for designer to work.
WPF is awesome. -->
<StackPanel Orientation="Vertical">
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractAllTo}" Margin="10,10,10,0" VerticalAlignment="Top" Height="15"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,0,10,10" VerticalAlignment="Bottom" Width="370" Grid.Row="0" Grid.Column="0"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}" Height="23"/>
<Button Margin="0,0,10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Row="0" Grid.Column="1"
Command="{x:Static local:Commands.Browse}" Height="22" Width="22">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<CheckBox Name="ExtractImages" Content="{x:Static s:guiStrings.TextExtractImages}" HorizontalAlignment="Left" Margin="10,6,0,7.383" Grid.Row="0" Grid.Column="0"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractImages, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" Margin="0,0,10,0" HorizontalAlignment="Right">
<Border BorderBrush="{x:Null}" Height="28" Width="115" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" >
<TextBlock Text="{x:Static s:guiStrings.TextSaveImagesAs}" TextWrapping="Wrap" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</Border>
<ComboBox Name="ImageConversionFormat" DisplayMemberPath="Tag" Margin="10,3,0,0" VerticalAlignment="Top" Height="21" HorizontalAlignment="Right" Width="75"/>
</StackPanel>
<CheckBox Grid.Row="2" Grid.Column="0" x:Name="ExtractText" Content="{x:Static s:guiStrings.TextExtractText}" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="10,6,0,0" Visibility="Collapsed"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractText, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<StackPanel Grid.Row="2" Grid.Column="1" Visibility="Collapsed" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock Text="{x:Static s:guiStrings.TextEncoding}" TextAlignment="Right" VerticalAlignment="Top" Height="15" HorizontalAlignment="Right"/>
<ComboBox x:Name="TextEncoding" VerticalAlignment="Top" Margin="10,3,0,0" Height="21" HorizontalAlignment="Right" Width="76"/>
</StackPanel>
<CheckBox x:Name="ExtractAudio" Content="{x:Static s:guiStrings.TextExtractAudio}" HorizontalAlignment="Left" VerticalAlignment="Top"
Grid.Row="1" Grid.Column="0" Margin="10,6,10,0"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appExtractAudio, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
<CheckBox Grid.Row="1" Grid.Column="1" x:Name="AudioConversion" Content="{x:Static s:guiStrings.TextConvertAudio}"
Margin="0,6,10,0" HorizontalAlignment="Right" ToolTip="{x:Static s:guiStrings.TooltipAudioFormats}" VerticalAlignment="Top"
IsEnabled="{Binding ElementName=ExtractAudio, Path=IsChecked}"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appConvertAudio, Mode=TwoWay}"/>
<!-- IsChecked="True"/>-->
</Grid>
<Separator Height="1" Margin="0,10,0,0"/>
<StackPanel Orientation="Horizontal" Margin="0,10,10,10" HorizontalAlignment="Right" VerticalAlignment="Bottom">
<Button Content="{x:Static s:guiStrings.ButtonExtract}" Margin="0" Click="ExtractButton_Click" Grid.Row="2" Width="75" Height="25" VerticalAlignment="Bottom" IsDefault="True"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" Margin="20,0,0,0" Height="25" VerticalAlignment="Bottom" IsCancel="True" Width="75"/>
</StackPanel>
</StackPanel>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.Browse}" Executed="BrowseExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</local:ExtractDialog>

View File

@ -1,71 +1,71 @@
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Diagnostics;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
using GameRes;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ExtractArchive.xaml
/// </summary>
public partial class ExtractArchiveDialog : ExtractDialog
{
public ExtractArchiveDialog (string filename, string destination)
{
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
ExtractText.IsEnabled = false;
TextEncoding.IsEnabled = false;
InitImageFormats (ImageConversionFormat);
}
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
{
string folder = ChooseFolder (guiStrings.TextChooseDestDir, DestinationDir.Text);
if (null != folder)
DestinationDir.Text = folder;
}
void ExtractButton_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
ExportImageFormat (ImageConversionFormat);
}
}
}
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Diagnostics;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
using GameRes;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ExtractArchive.xaml
/// </summary>
public partial class ExtractArchiveDialog : ExtractDialog
{
public ExtractArchiveDialog (string filename, string destination)
{
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
ExtractText.IsEnabled = false;
TextEncoding.IsEnabled = false;
InitImageFormats (ImageConversionFormat);
}
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
{
string folder = ChooseFolder (guiStrings.TextChooseDestDir, DestinationDir.Text);
if (null != folder)
DestinationDir.Text = folder;
}
void ExtractButton_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
ExportImageFormat (ImageConversionFormat);
}
}
}

View File

@ -1,111 +1,111 @@
//! \file ExtractDialog.cs
//! \date Wed Jul 09 11:26:08 2014
//! \brief Extract dialog window.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
using GameRes;
using System.Windows.Input;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
namespace GARbro.GUI
{
public partial class ExtractDialog : Window
{
public string Destination { get; set; }
public void InitImageFormats (ComboBox image_format)
{
var default_format = Settings.Default.appImageFormat;
var formats = FormatCatalog.Instance.ImageFormats.Where (f => f.IsBuiltin);
ImageFormatModel[] default_model = { new ImageFormatModel() };
var models = default_model.Concat (formats.Select (f => new ImageFormatModel (f))).ToList();
var selected = models.FirstOrDefault (f => f.Tag.Equals (default_format));
image_format.ItemsSource = models;
if (null != selected)
image_format.SelectedItem = selected;
else if (models.Any())
image_format.SelectedIndex = 0;
}
public ImageFormat GetImageFormat (ComboBox image_format)
{
var selected = image_format.SelectedItem as ImageFormatModel;
if (null != selected)
return selected.Source;
else
return null;
}
public void ExportImageFormat (ComboBox image_format)
{
var format = GetImageFormat (image_format);
if (null != format)
Settings.Default.appImageFormat = format.Tag;
else
Settings.Default.appImageFormat = "";
}
public string ChooseFolder (string title, string initial)
{
var dlg = new CommonOpenFileDialog();
dlg.Title = title;
dlg.IsFolderPicker = true;
dlg.InitialDirectory = initial;
dlg.AddToMostRecentlyUsedList = false;
dlg.AllowNonFileSystemItems = false;
dlg.EnsureFileExists = true;
dlg.EnsurePathExists = true;
dlg.EnsureReadOnly = false;
dlg.EnsureValidNames = true;
dlg.Multiselect = false;
dlg.ShowPlacesList = true;
if (dlg.ShowDialog (this) == CommonFileDialogResult.Ok)
return dlg.FileName;
else
return null;
}
protected void acb_OnEnterKeyDown (object sender, KeyEventArgs e)
{
string path = (sender as AutoCompleteBox).Text;
if (!string.IsNullOrEmpty (path))
this.DialogResult = true;
}
public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
}
}
//! \file ExtractDialog.cs
//! \date Wed Jul 09 11:26:08 2014
//! \brief Extract dialog window.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
using GameRes;
using System.Windows.Input;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
namespace GARbro.GUI
{
public partial class ExtractDialog : Window
{
public string Destination { get; set; }
public void InitImageFormats (ComboBox image_format)
{
var default_format = Settings.Default.appImageFormat;
var formats = FormatCatalog.Instance.ImageFormats.Where (f => f.IsBuiltin);
ImageFormatModel[] default_model = { new ImageFormatModel() };
var models = default_model.Concat (formats.Select (f => new ImageFormatModel (f))).ToList();
var selected = models.FirstOrDefault (f => f.Tag.Equals (default_format));
image_format.ItemsSource = models;
if (null != selected)
image_format.SelectedItem = selected;
else if (models.Any())
image_format.SelectedIndex = 0;
}
public ImageFormat GetImageFormat (ComboBox image_format)
{
var selected = image_format.SelectedItem as ImageFormatModel;
if (null != selected)
return selected.Source;
else
return null;
}
public void ExportImageFormat (ComboBox image_format)
{
var format = GetImageFormat (image_format);
if (null != format)
Settings.Default.appImageFormat = format.Tag;
else
Settings.Default.appImageFormat = "";
}
public string ChooseFolder (string title, string initial)
{
var dlg = new CommonOpenFileDialog();
dlg.Title = title;
dlg.IsFolderPicker = true;
dlg.InitialDirectory = initial;
dlg.AddToMostRecentlyUsedList = false;
dlg.AllowNonFileSystemItems = false;
dlg.EnsureFileExists = true;
dlg.EnsurePathExists = true;
dlg.EnsureReadOnly = false;
dlg.EnsureValidNames = true;
dlg.Multiselect = false;
dlg.ShowPlacesList = true;
if (dlg.ShowDialog (this) == CommonFileDialogResult.Ok)
return dlg.FileName;
else
return null;
}
protected void acb_OnEnterKeyDown (object sender, KeyEventArgs e)
{
string path = (sender as AutoCompleteBox).Text;
if (!string.IsNullOrEmpty (path))
this.DialogResult = true;
}
public void CanExecuteAlways (object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
}
}

View File

@ -1,40 +1,40 @@
<local:ExtractDialog x:Class="GARbro.GUI.ExtractFile"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextExtractTitle}" Height="165.774" Width="400.861"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractFileTo}" Margin="10,10,9.157,0" VerticalAlignment="Top" Height="15"/>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,28,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="337"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}"/>
<Button Margin="0,28,10,0" VerticalAlignment="Top" HorizontalAlignment="Right"
Command="{x:Static local:Commands.Browse}">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Grid Name="ConversionTypePanel" Margin="10,60,0,0" Height="25" Width="300" VerticalAlignment="Top" HorizontalAlignment="Left">
<StackPanel x:Name="ImageConversionOptions" Visibility="Visible" Orientation="Horizontal">
<TextBlock Text="{x:Static s:guiStrings.TextSaveAs}" Margin="0,0,7,0" TextWrapping="Wrap" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<ComboBox x:Name="ImageConversionFormat" DisplayMemberPath="Tag" Margin="0" VerticalAlignment="Center" Height="21" Width="76"/>
</StackPanel>
<StackPanel x:Name="AudioConversionOptions" Visibility="Collapsed" Orientation="Horizontal">
<CheckBox x:Name="AudioConversion" Content="{x:Static s:guiStrings.TextConvertAudio}" ToolTip="{x:Static s:guiStrings.TooltipAudioFormats}" Margin="0,0,7,0" VerticalAlignment="Center" Height="21" HorizontalAlignment="Left"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appConvertAudio, Mode=TwoWay}"/>
</StackPanel>
<StackPanel x:Name="TextConversionOptions" Visibility="Collapsed" Orientation="Horizontal">
<TextBlock Text="{x:Static s:guiStrings.TextEncoding}" Margin="0,0,7,0" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<ComboBox x:Name="TextEncoding" Margin="0" VerticalAlignment="Center" Height="21" HorizontalAlignment="Right" Width="76"/>
</StackPanel>
</Grid>
<Button Content="{x:Static s:guiStrings.ButtonExtract}" Click="ExtractButton_Click" HorizontalAlignment="Right" Margin="0,0,102.157,10" Width="75" IsDefault="True" Height="25" VerticalAlignment="Bottom" VerticalContentAlignment="Center"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" Margin="0,0,10.157,10" IsCancel="True" HorizontalAlignment="Right" Width="75" Height="25" VerticalAlignment="Bottom" VerticalContentAlignment="Center"/>
</Grid>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.Browse}" Executed="BrowseExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</local:ExtractDialog>
<local:ExtractDialog x:Class="GARbro.GUI.ExtractFile"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
xmlns:local="clr-namespace:GARbro.GUI"
Title="{x:Static s:guiStrings.TextExtractTitle}" Height="165.774" Width="400.861"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractFileTo}" Margin="10,10,9.157,0" VerticalAlignment="Top" Height="15"/>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,28,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="337"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}"/>
<Button Margin="0,28,10,0" VerticalAlignment="Top" HorizontalAlignment="Right"
Command="{x:Static local:Commands.Browse}">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Grid Name="ConversionTypePanel" Margin="10,60,0,0" Height="25" Width="300" VerticalAlignment="Top" HorizontalAlignment="Left">
<StackPanel x:Name="ImageConversionOptions" Visibility="Visible" Orientation="Horizontal">
<TextBlock Text="{x:Static s:guiStrings.TextSaveAs}" Margin="0,0,7,0" TextWrapping="Wrap" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<ComboBox x:Name="ImageConversionFormat" DisplayMemberPath="Tag" Margin="0" VerticalAlignment="Center" Height="21" Width="76"/>
</StackPanel>
<StackPanel x:Name="AudioConversionOptions" Visibility="Collapsed" Orientation="Horizontal">
<CheckBox x:Name="AudioConversion" Content="{x:Static s:guiStrings.TextConvertAudio}" ToolTip="{x:Static s:guiStrings.TooltipAudioFormats}" Margin="0,0,7,0" VerticalAlignment="Center" Height="21" HorizontalAlignment="Left"
IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=appConvertAudio, Mode=TwoWay}"/>
</StackPanel>
<StackPanel x:Name="TextConversionOptions" Visibility="Collapsed" Orientation="Horizontal">
<TextBlock Text="{x:Static s:guiStrings.TextEncoding}" Margin="0,0,7,0" TextAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<ComboBox x:Name="TextEncoding" Margin="0" VerticalAlignment="Center" Height="21" HorizontalAlignment="Right" Width="76"/>
</StackPanel>
</Grid>
<Button Content="{x:Static s:guiStrings.ButtonExtract}" Click="ExtractButton_Click" HorizontalAlignment="Right" Margin="0,0,102.157,10" Width="75" IsDefault="True" Height="25" VerticalAlignment="Bottom" VerticalContentAlignment="Center"/>
<Button Content="{x:Static s:guiStrings.ButtonCancel}" Margin="0,0,10.157,10" IsCancel="True" HorizontalAlignment="Right" Width="75" Height="25" VerticalAlignment="Bottom" VerticalContentAlignment="Center"/>
</Grid>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.Browse}" Executed="BrowseExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</local:ExtractDialog>

View File

@ -1,102 +1,102 @@
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ExtractFile.xaml
/// </summary>
public partial class ExtractFile : ExtractDialog
{
public ExtractFile (EntryViewModel entry, string destination)
{
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractFileTo, entry.Name);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
if ("image" == entry.Type)
{
ActiveOption = ImageConversionOptions;
InitImageFormats (ImageConversionFormat);
}
else if ("script" == entry.Type)
{
ActiveOption = TextConversionOptions;
TextEncoding.IsEnabled = false;
}
else if ("audio" == entry.Type)
{
ActiveOption = AudioConversionOptions;
}
else
{
ActiveOption = null;
}
}
private UIElement m_active_option;
public UIElement ActiveOption
{
get { return m_active_option; }
set
{
m_active_option = value;
if (null != m_active_option)
m_active_option.Visibility = Visibility.Visible;
foreach (var c in ConversionTypePanel.Children.Cast<UIElement>())
{
if (c != m_active_option)
c.Visibility = Visibility.Collapsed;
}
}
}
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
{
string folder = ChooseFolder (guiStrings.TextChooseDestDir, DestinationDir.Text);
if (null != folder)
DestinationDir.Text = folder;
}
void ExtractButton_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
if (ImageConversionOptions == ActiveOption)
{
ExportImageFormat (ImageConversionFormat);
}
}
}
}
// Game Resource Browser
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.WindowsAPICodePack.Dialogs;
using GARbro.GUI.Properties;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for ExtractFile.xaml
/// </summary>
public partial class ExtractFile : ExtractDialog
{
public ExtractFile (EntryViewModel entry, string destination)
{
InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractFileTo, entry.Name);
Destination = destination;
DestinationDir.EnterKeyDown += acb_OnEnterKeyDown;
if ("image" == entry.Type)
{
ActiveOption = ImageConversionOptions;
InitImageFormats (ImageConversionFormat);
}
else if ("script" == entry.Type)
{
ActiveOption = TextConversionOptions;
TextEncoding.IsEnabled = false;
}
else if ("audio" == entry.Type)
{
ActiveOption = AudioConversionOptions;
}
else
{
ActiveOption = null;
}
}
private UIElement m_active_option;
public UIElement ActiveOption
{
get { return m_active_option; }
set
{
m_active_option = value;
if (null != m_active_option)
m_active_option.Visibility = Visibility.Visible;
foreach (var c in ConversionTypePanel.Children.Cast<UIElement>())
{
if (c != m_active_option)
c.Visibility = Visibility.Collapsed;
}
}
}
private void BrowseExec (object sender, ExecutedRoutedEventArgs e)
{
string folder = ChooseFolder (guiStrings.TextChooseDestDir, DestinationDir.Text);
if (null != folder)
DestinationDir.Text = folder;
}
void ExtractButton_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
if (ImageConversionOptions == ActiveOption)
{
ExportImageFormat (ImageConversionFormat);
}
}
}
}

View File

@ -1,306 +1,306 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2935BE57-C4E0-43E7-86DE-C1848C820B19}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GARbro.GUI</RootNamespace>
<AssemblyName>GARbro.GUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Images\sample.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>751F4A9FD4F4CC3D99D70509FF1F9D9CC9E49516</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>GARbro.GUI_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WindowsAPICodePack-Core.1.1.1\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ookii.Dialogs.Wpf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c15020868fd6249, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Ookii.Dialogs.1.0\lib\net35\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WPFToolkit.3.5.50211.1\lib\System.Windows.Controls.Input.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WPFToolkit.3.5.50211.1\lib\WPFToolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AboutBox.xaml.cs">
<DependentUpon>AboutBox.xaml</DependentUpon>
</Compile>
<Compile Include="ArcParameters.xaml.cs">
<DependentUpon>ArcParameters.xaml</DependentUpon>
</Compile>
<Compile Include="AutoComplete.cs" />
<Compile Include="ConvertMedia.xaml.cs">
<DependentUpon>ConvertMedia.xaml</DependentUpon>
</Compile>
<Compile Include="CreateArchive.xaml.cs">
<DependentUpon>CreateArchive.xaml</DependentUpon>
</Compile>
<Compile Include="DragScroll.cs" />
<Compile Include="EnterMaskDialog.xaml.cs">
<DependentUpon>EnterMaskDialog.xaml</DependentUpon>
</Compile>
<Compile Include="ExtractArchive.xaml.cs">
<DependentUpon>ExtractArchive.xaml</DependentUpon>
</Compile>
<Compile Include="ExtractDialog.cs" />
<Compile Include="ExtractFile.xaml.cs">
<DependentUpon>ExtractFile.xaml</DependentUpon>
</Compile>
<Compile Include="GarConvert.cs" />
<Compile Include="GarCreate.cs" />
<Compile Include="GarExtract.cs" />
<Compile Include="HistoryStack.cs" />
<Compile Include="ImagePreview.cs" />
<Compile Include="ListViewEx.cs" />
<Compile Include="ModalWindow.cs" />
<Compile Include="NAudio.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Shell.cs" />
<Compile Include="Strings\guiStrings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>guiStrings.resx</DependentUpon>
</Compile>
<Compile Include="TextViewer.xaml.cs">
<DependentUpon>TextViewer.xaml</DependentUpon>
</Compile>
<Compile Include="Utility.cs" />
<Compile Include="ViewModel.cs" />
<Page Include="AboutBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ArcParameters.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConvertMedia.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CreateArchive.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EnterMaskDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ExtractArchive.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ExtractFile.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="TextViewer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Strings\guiStrings.ko-KR.resx" />
<EmbeddedResource Include="Strings\guiStrings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>guiStrings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Strings\guiStrings.ru-RU.resx" />
<EmbeddedResource Include="LICENSE" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<None Include="Resources\Formats.dat" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\32x32\back button.png" />
<Resource Include="Images\32x32\forward button.png" />
<Resource Include="Images\32x32\help.png" />
<Resource Include="Images\64x64\info.png" />
<Resource Include="Images\sample.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\48x48\refresh.png" />
<SplashScreen Include="Images\splashscreen.png" />
<Resource Include="Images\search4files.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="ArcFormats\ArcFormats.csproj">
<Project>{a8865685-27cc-427b-ac38-e48d2ad05df4}</Project>
<Name>ArcFormats</Name>
</ProjectReference>
<ProjectReference Include="GameRes\GameRes.csproj">
<Project>{453c087f-e416-4ae9-8c03-d8760da0574b}</Project>
<Name>GameRes</Name>
<EmbedInteropTypes>False</EmbedInteropTypes>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>perl "$(SolutionDir)inc-revision.pl" "$(ProjectPath)" $(ConfigurationName)
exit 0</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)\Resources\Formats.dat" "$(TargetDir)" /D /Y &gt;NUL</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2935BE57-C4E0-43E7-86DE-C1848C820B19}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GARbro.GUI</RootNamespace>
<AssemblyName>GARbro.GUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Images\sample.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>751F4A9FD4F4CC3D99D70509FF1F9D9CC9E49516</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>GARbro.GUI_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WindowsAPICodePack-Core.1.1.1\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ookii.Dialogs.Wpf, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0c15020868fd6249, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\Ookii.Dialogs.1.0\lib\net35\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Controls.Input.Toolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WPFToolkit.3.5.50211.1\lib\System.Windows.Controls.Input.Toolkit.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>packages\WPFToolkit.3.5.50211.1\lib\WPFToolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AboutBox.xaml.cs">
<DependentUpon>AboutBox.xaml</DependentUpon>
</Compile>
<Compile Include="ArcParameters.xaml.cs">
<DependentUpon>ArcParameters.xaml</DependentUpon>
</Compile>
<Compile Include="AutoComplete.cs" />
<Compile Include="ConvertMedia.xaml.cs">
<DependentUpon>ConvertMedia.xaml</DependentUpon>
</Compile>
<Compile Include="CreateArchive.xaml.cs">
<DependentUpon>CreateArchive.xaml</DependentUpon>
</Compile>
<Compile Include="DragScroll.cs" />
<Compile Include="EnterMaskDialog.xaml.cs">
<DependentUpon>EnterMaskDialog.xaml</DependentUpon>
</Compile>
<Compile Include="ExtractArchive.xaml.cs">
<DependentUpon>ExtractArchive.xaml</DependentUpon>
</Compile>
<Compile Include="ExtractDialog.cs" />
<Compile Include="ExtractFile.xaml.cs">
<DependentUpon>ExtractFile.xaml</DependentUpon>
</Compile>
<Compile Include="GarConvert.cs" />
<Compile Include="GarCreate.cs" />
<Compile Include="GarExtract.cs" />
<Compile Include="HistoryStack.cs" />
<Compile Include="ImagePreview.cs" />
<Compile Include="ListViewEx.cs" />
<Compile Include="ModalWindow.cs" />
<Compile Include="NAudio.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Shell.cs" />
<Compile Include="Strings\guiStrings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>guiStrings.resx</DependentUpon>
</Compile>
<Compile Include="TextViewer.xaml.cs">
<DependentUpon>TextViewer.xaml</DependentUpon>
</Compile>
<Compile Include="Utility.cs" />
<Compile Include="ViewModel.cs" />
<Page Include="AboutBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ArcParameters.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConvertMedia.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CreateArchive.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EnterMaskDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ExtractArchive.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ExtractFile.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="TextViewer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Strings\guiStrings.ko-KR.resx" />
<EmbeddedResource Include="Strings\guiStrings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>guiStrings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Strings\guiStrings.ru-RU.resx" />
<EmbeddedResource Include="..\LICENSE" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<None Include="Resources\Formats.dat" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\32x32\back button.png" />
<Resource Include="Images\32x32\forward button.png" />
<Resource Include="Images\32x32\help.png" />
<Resource Include="Images\64x64\info.png" />
<Resource Include="Images\sample.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\48x48\refresh.png" />
<SplashScreen Include="Images\splashscreen.png" />
<Resource Include="Images\search4files.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ArcFormats\ArcFormats.csproj">
<Project>{a8865685-27cc-427b-ac38-e48d2ad05df4}</Project>
<Name>ArcFormats</Name>
</ProjectReference>
<ProjectReference Include="..\GameRes\GameRes.csproj">
<Project>{453c087f-e416-4ae9-8c03-d8760da0574b}</Project>
<Name>GameRes</Name>
<EmbedInteropTypes>False</EmbedInteropTypes>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>perl "$(SolutionDir)inc-revision.pl" "$(ProjectPath)" $(ConfigurationName)
exit 0</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)\Resources\Formats.dat" "$(TargetDir)" /D /Y &gt;NUL</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>
</StartArguments>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>
</StartArguments>
</PropertyGroup>
</Project>

View File

@ -1,109 +1,109 @@
//! \file HistoryStack.cs
//! \date Sun Aug 21 01:06:53 2011
//! \brief action history stack interface (undo/redo).
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Rnd.Windows
{
public class HistoryStack<State>
{
private List<State> m_back = new List<State>();
private Stack<State> m_forward = new Stack<State>();
public int Limit { get; set; }
public IEnumerable<State> UndoStack { get { return m_back; } }
public IEnumerable<State> RedoStack { get { return m_forward; } }
public HistoryStack (int limit = 50)
{
Limit = limit;
}
public State Undo (State current)
{
if (!CanUndo())
return default(State);
m_forward.Push (current);
current = m_back.Last();
m_back.RemoveAt (m_back.Count - 1);
OnStateChanged();
return current;
}
public State Redo (State current)
{
if (!CanRedo())
return default(State);
m_back.Add (current);
current = m_forward.Pop();
OnStateChanged();
return current;
}
public bool CanUndo ()
{
return m_back.Any();
}
public bool CanRedo ()
{
return m_forward.Any();
}
public void Push (State current)
{
m_back.Add (current);
if (m_back.Count > Limit)
m_back.RemoveRange (0, m_back.Count - Limit);
m_forward.Clear();
OnStateChanged();
}
public void Clear ()
{
if (m_back.Any() || m_forward.Any())
{
m_back.Clear();
m_forward.Clear();
OnStateChanged();
}
}
public event EventHandler StateChanged;
private void OnStateChanged ()
{
if (StateChanged != null)
StateChanged (this, EventArgs.Empty);
}
}
}
//! \file HistoryStack.cs
//! \date Sun Aug 21 01:06:53 2011
//! \brief action history stack interface (undo/redo).
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Rnd.Windows
{
public class HistoryStack<State>
{
private List<State> m_back = new List<State>();
private Stack<State> m_forward = new Stack<State>();
public int Limit { get; set; }
public IEnumerable<State> UndoStack { get { return m_back; } }
public IEnumerable<State> RedoStack { get { return m_forward; } }
public HistoryStack (int limit = 50)
{
Limit = limit;
}
public State Undo (State current)
{
if (!CanUndo())
return default(State);
m_forward.Push (current);
current = m_back.Last();
m_back.RemoveAt (m_back.Count - 1);
OnStateChanged();
return current;
}
public State Redo (State current)
{
if (!CanRedo())
return default(State);
m_back.Add (current);
current = m_forward.Pop();
OnStateChanged();
return current;
}
public bool CanUndo ()
{
return m_back.Any();
}
public bool CanRedo ()
{
return m_forward.Any();
}
public void Push (State current)
{
m_back.Add (current);
if (m_back.Count > Limit)
m_back.RemoveRange (0, m_back.Count - Limit);
m_forward.Clear();
OnStateChanged();
}
public void Clear ()
{
if (m_back.Any() || m_forward.Any())
{
m_back.Clear();
m_forward.Clear();
OnStateChanged();
}
}
public event EventHandler StateChanged;
private void OnStateChanged ()
{
if (StateChanged != null)
StateChanged (this, EventArgs.Empty);
}
}
}

View File

@ -1,298 +1,298 @@
//! \file ImagePreview.cs
//! \date Sun Jul 06 06:34:56 2014
//! \brief preview images.
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using GARbro.GUI.Strings;
using GARbro.GUI.Properties;
using GameRes;
using System.Text;
using System.Windows.Documents;
using System.Windows.Media;
using System.Globalization;
namespace GARbro.GUI
{
public partial class MainWindow : Window
{
private readonly BackgroundWorker m_preview_worker = new BackgroundWorker();
private PreviewFile m_current_preview = new PreviewFile();
private bool m_preview_pending = false;
private UIElement m_active_viewer;
public UIElement ActiveViewer
{
get { return m_active_viewer; }
set
{
if (value == m_active_viewer)
return;
m_active_viewer = value;
m_active_viewer.Visibility = Visibility.Visible;
bool exists = false;
foreach (var c in PreviewPane.Children.Cast<UIElement>())
{
if (c != m_active_viewer)
c.Visibility = Visibility.Collapsed;
else
exists = true;
}
if (!exists)
PreviewPane.Children.Add (m_active_viewer);
}
}
class PreviewFile
{
public IEnumerable<string> Path { get; set; }
public string Name { get; set; }
public Entry Entry { get; set; }
public bool IsEqual (IEnumerable<string> path, string name)
{
return Path != null && path.SequenceEqual (Path) && name.Equals (Name);
}
}
private void InitPreviewPane ()
{
m_preview_worker.DoWork += (s, e) => LoadPreviewImage (e.Argument as PreviewFile);
m_preview_worker.RunWorkerCompleted += (s, e) => {
if (m_preview_pending)
RefreshPreviewPane();
};
ActiveViewer = ImageView;
TextView.IsWordWrapEnabled = true;
}
private IEnumerable<Encoding> m_encoding_list = GetEncodingList();
public IEnumerable<Encoding> TextEncodings { get { return m_encoding_list; } }
private static IEnumerable<Encoding> GetEncodingList ()
{
var list = new HashSet<Encoding>();
list.Add (Encoding.Default);
var oem = CultureInfo.CurrentCulture.TextInfo.OEMCodePage;
list.Add (Encoding.GetEncoding (oem));
list.Add (Encoding.GetEncoding (932));
list.Add (Encoding.UTF8);
list.Add (Encoding.Unicode);
list.Add (Encoding.BigEndianUnicode);
return list;
}
private void OnEncodingSelect (object sender, SelectionChangedEventArgs e)
{
var enc = this.EncodingChoice.SelectedItem as Encoding;
if (null == enc || null == CurrentTextInput)
return;
TextView.CurrentEncoding = enc;
}
/// <summary>
/// Display entry in preview panel
/// </summary>
private void PreviewEntry (Entry entry)
{
if (m_current_preview.IsEqual (ViewModel.Path, entry.Name))
return;
UpdatePreviewPane (entry);
}
void RefreshPreviewPane ()
{
m_preview_pending = false;
var current = CurrentDirectory.SelectedItem as EntryViewModel;
if (null != current)
UpdatePreviewPane (current.Source);
else
ResetPreviewPane();
}
void ResetPreviewPane ()
{
ActiveViewer = ImageView;
ImageCanvas.Source = null;
TextView.Clear();
CurrentTextInput = null;
}
bool IsPreviewPossible (Entry entry)
{
return "image" == entry.Type || "script" == entry.Type
|| (string.IsNullOrEmpty (entry.Type) && entry.Size < 0x100000);
}
void UpdatePreviewPane (Entry entry)
{
SetStatusText ("");
var vm = ViewModel;
m_current_preview = new PreviewFile { Path = vm.Path, Name = entry.Name, Entry = entry };
ImageCanvas.Source = null;
TextView.Clear();
if (!IsPreviewPossible (entry))
{
ActiveViewer = ImageView;
return;
}
if ("image" != entry.Type)
LoadPreviewText (m_current_preview);
else if (!m_preview_worker.IsBusy)
m_preview_worker.RunWorkerAsync (m_current_preview);
else
m_preview_pending = true;
}
private Stream m_current_text;
private Stream CurrentTextInput
{
get { return m_current_text; }
set
{
if (value == m_current_text)
return;
if (null != m_current_text)
m_current_text.Dispose();
m_current_text = value;
}
}
Stream OpenPreviewStream (PreviewFile preview)
{
return VFS.OpenSeekableStream (preview.Entry);
}
void LoadPreviewText (PreviewFile preview)
{
Stream file = null;
try
{
file = OpenPreviewStream (preview);
if (!TextView.IsTextFile (file))
{
ResetPreviewPane();
return;
}
var enc = EncodingChoice.SelectedItem as Encoding;
if (null == enc)
{
enc = TextView.GuessEncoding (file);
EncodingChoice.SelectedItem = enc;
}
TextView.DisplayStream (file, enc);
ActiveViewer = TextView;
CurrentTextInput = file;
file = null;
}
catch (Exception X)
{
SetStatusText (X.Message);
}
finally
{
if (file != null)
file.Dispose();
}
}
void LoadPreviewImage (PreviewFile preview)
{
try
{
using (var file = OpenPreviewStream (preview))
{
var data = ImageFormat.Read (preview.Name, file);
if (null != data)
SetPreviewImage (preview, data.Bitmap);
else
Trace.WriteLine ("Cannot parse image format", preview.Name);
}
}
catch (Exception X)
{
SetStatusText (X.Message);
}
}
void SetPreviewImage (PreviewFile preview, BitmapSource bitmap)
{
if (bitmap.DpiX != Desktop.DpiX || bitmap.DpiY != Desktop.DpiY)
{
int stride = bitmap.PixelWidth * ((bitmap.Format.BitsPerPixel + 7) / 8);
var pixels = new byte[stride*bitmap.PixelHeight];
bitmap.CopyPixels (pixels, stride, 0);
var fixed_bitmap = BitmapSource.Create (bitmap.PixelWidth, bitmap.PixelHeight,
Desktop.DpiX, Desktop.DpiY, bitmap.Format, bitmap.Palette, pixels, stride);
bitmap = fixed_bitmap;
}
if (!bitmap.IsFrozen)
bitmap.Freeze();
Dispatcher.Invoke (() =>
{
if (m_current_preview == preview) // compare by reference
{
ActiveViewer = ImageView;
ImageCanvas.Source = bitmap;
SetStatusText (string.Format (guiStrings.MsgImageSize, bitmap.PixelWidth,
bitmap.PixelHeight, bitmap.Format.BitsPerPixel));
}
});
}
/// <summary>
/// Fit window size to image.
/// </summary>
private void FitWindowExec (object sender, ExecutedRoutedEventArgs e)
{
var image = ImageCanvas.Source;
if (null == image)
return;
var width = image.Width + Settings.Default.lvPanelWidth.Value + 1;
var height = image.Height;
width = Math.Max (ContentGrid.ActualWidth, width);
height = Math.Max (ContentGrid.ActualHeight, height);
if (width > ContentGrid.ActualWidth || height > ContentGrid.ActualHeight)
{
ContentGrid.Width = width;
ContentGrid.Height = height;
this.SizeToContent = SizeToContent.WidthAndHeight;
Dispatcher.InvokeAsync (() => {
this.SizeToContent = SizeToContent.Manual;
ContentGrid.Width = double.NaN;
ContentGrid.Height = double.NaN;
}, DispatcherPriority.ContextIdle);
}
}
}
}
//! \file ImagePreview.cs
//! \date Sun Jul 06 06:34:56 2014
//! \brief preview images.
//
// Copyright (C) 2014-2015 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using GARbro.GUI.Strings;
using GARbro.GUI.Properties;
using GameRes;
using System.Text;
using System.Windows.Documents;
using System.Windows.Media;
using System.Globalization;
namespace GARbro.GUI
{
public partial class MainWindow : Window
{
private readonly BackgroundWorker m_preview_worker = new BackgroundWorker();
private PreviewFile m_current_preview = new PreviewFile();
private bool m_preview_pending = false;
private UIElement m_active_viewer;
public UIElement ActiveViewer
{
get { return m_active_viewer; }
set
{
if (value == m_active_viewer)
return;
m_active_viewer = value;
m_active_viewer.Visibility = Visibility.Visible;
bool exists = false;
foreach (var c in PreviewPane.Children.Cast<UIElement>())
{
if (c != m_active_viewer)
c.Visibility = Visibility.Collapsed;
else
exists = true;
}
if (!exists)
PreviewPane.Children.Add (m_active_viewer);
}
}
class PreviewFile
{
public IEnumerable<string> Path { get; set; }
public string Name { get; set; }
public Entry Entry { get; set; }
public bool IsEqual (IEnumerable<string> path, string name)
{
return Path != null && path.SequenceEqual (Path) && name.Equals (Name);
}
}
private void InitPreviewPane ()
{
m_preview_worker.DoWork += (s, e) => LoadPreviewImage (e.Argument as PreviewFile);
m_preview_worker.RunWorkerCompleted += (s, e) => {
if (m_preview_pending)
RefreshPreviewPane();
};
ActiveViewer = ImageView;
TextView.IsWordWrapEnabled = true;
}
private IEnumerable<Encoding> m_encoding_list = GetEncodingList();
public IEnumerable<Encoding> TextEncodings { get { return m_encoding_list; } }
private static IEnumerable<Encoding> GetEncodingList ()
{
var list = new HashSet<Encoding>();
list.Add (Encoding.Default);
var oem = CultureInfo.CurrentCulture.TextInfo.OEMCodePage;
list.Add (Encoding.GetEncoding (oem));
list.Add (Encoding.GetEncoding (932));
list.Add (Encoding.UTF8);
list.Add (Encoding.Unicode);
list.Add (Encoding.BigEndianUnicode);
return list;
}
private void OnEncodingSelect (object sender, SelectionChangedEventArgs e)
{
var enc = this.EncodingChoice.SelectedItem as Encoding;
if (null == enc || null == CurrentTextInput)
return;
TextView.CurrentEncoding = enc;
}
/// <summary>
/// Display entry in preview panel
/// </summary>
private void PreviewEntry (Entry entry)
{
if (m_current_preview.IsEqual (ViewModel.Path, entry.Name))
return;
UpdatePreviewPane (entry);
}
void RefreshPreviewPane ()
{
m_preview_pending = false;
var current = CurrentDirectory.SelectedItem as EntryViewModel;
if (null != current)
UpdatePreviewPane (current.Source);
else
ResetPreviewPane();
}
void ResetPreviewPane ()
{
ActiveViewer = ImageView;
ImageCanvas.Source = null;
TextView.Clear();
CurrentTextInput = null;
}
bool IsPreviewPossible (Entry entry)
{
return "image" == entry.Type || "script" == entry.Type
|| (string.IsNullOrEmpty (entry.Type) && entry.Size < 0x100000);
}
void UpdatePreviewPane (Entry entry)
{
SetStatusText ("");
var vm = ViewModel;
m_current_preview = new PreviewFile { Path = vm.Path, Name = entry.Name, Entry = entry };
ImageCanvas.Source = null;
TextView.Clear();
if (!IsPreviewPossible (entry))
{
ActiveViewer = ImageView;
return;
}
if ("image" != entry.Type)
LoadPreviewText (m_current_preview);
else if (!m_preview_worker.IsBusy)
m_preview_worker.RunWorkerAsync (m_current_preview);
else
m_preview_pending = true;
}
private Stream m_current_text;
private Stream CurrentTextInput
{
get { return m_current_text; }
set
{
if (value == m_current_text)
return;
if (null != m_current_text)
m_current_text.Dispose();
m_current_text = value;
}
}
Stream OpenPreviewStream (PreviewFile preview)
{
return VFS.OpenSeekableStream (preview.Entry);
}
void LoadPreviewText (PreviewFile preview)
{
Stream file = null;
try
{
file = OpenPreviewStream (preview);
if (!TextView.IsTextFile (file))
{
ResetPreviewPane();
return;
}
var enc = EncodingChoice.SelectedItem as Encoding;
if (null == enc)
{
enc = TextView.GuessEncoding (file);
EncodingChoice.SelectedItem = enc;
}
TextView.DisplayStream (file, enc);
ActiveViewer = TextView;
CurrentTextInput = file;
file = null;
}
catch (Exception X)
{
SetStatusText (X.Message);
}
finally
{
if (file != null)
file.Dispose();
}
}
void LoadPreviewImage (PreviewFile preview)
{
try
{
using (var file = OpenPreviewStream (preview))
{
var data = ImageFormat.Read (preview.Name, file);
if (null != data)
SetPreviewImage (preview, data.Bitmap);
else
Trace.WriteLine ("Cannot parse image format", preview.Name);
}
}
catch (Exception X)
{
SetStatusText (X.Message);
}
}
void SetPreviewImage (PreviewFile preview, BitmapSource bitmap)
{
if (bitmap.DpiX != Desktop.DpiX || bitmap.DpiY != Desktop.DpiY)
{
int stride = bitmap.PixelWidth * ((bitmap.Format.BitsPerPixel + 7) / 8);
var pixels = new byte[stride*bitmap.PixelHeight];
bitmap.CopyPixels (pixels, stride, 0);
var fixed_bitmap = BitmapSource.Create (bitmap.PixelWidth, bitmap.PixelHeight,
Desktop.DpiX, Desktop.DpiY, bitmap.Format, bitmap.Palette, pixels, stride);
bitmap = fixed_bitmap;
}
if (!bitmap.IsFrozen)
bitmap.Freeze();
Dispatcher.Invoke (() =>
{
if (m_current_preview == preview) // compare by reference
{
ActiveViewer = ImageView;
ImageCanvas.Source = bitmap;
SetStatusText (string.Format (guiStrings.MsgImageSize, bitmap.PixelWidth,
bitmap.PixelHeight, bitmap.Format.BitsPerPixel));
}
});
}
/// <summary>
/// Fit window size to image.
/// </summary>
private void FitWindowExec (object sender, ExecutedRoutedEventArgs e)
{
var image = ImageCanvas.Source;
if (null == image)
return;
var width = image.Width + Settings.Default.lvPanelWidth.Value + 1;
var height = image.Height;
width = Math.Max (ContentGrid.ActualWidth, width);
height = Math.Max (ContentGrid.ActualHeight, height);
if (width > ContentGrid.ActualWidth || height > ContentGrid.ActualHeight)
{
ContentGrid.Width = width;
ContentGrid.Height = height;
this.SizeToContent = SizeToContent.WidthAndHeight;
Dispatcher.InvokeAsync (() => {
this.SizeToContent = SizeToContent.Manual;
ContentGrid.Width = double.NaN;
ContentGrid.Height = double.NaN;
}, DispatcherPriority.ContextIdle);
}
}
}
}

View File

@ -1,400 +1,400 @@
<Window x:Class="GARbro.GUI.MainWindow" x:Name="AppWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GARbro.GUI"
xmlns:jv="clr-namespace:JustView"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
Title="GARbro" MinHeight="250" ResizeMode="CanResizeWithGrip"
Loaded="WindowLoaded"
KeyDown="WindowKeyDown"
Top="{Binding Source={x:Static p:Settings.Default}, Path=winTop, Mode=TwoWay}"
Left="{Binding Source={x:Static p:Settings.Default}, Path=winLeft, Mode=TwoWay}"
Height="{Binding Source={x:Static p:Settings.Default}, Path=winHeight, Mode=TwoWay}"
Width="{Binding Source={x:Static p:Settings.Default}, Path=winWidth, Mode=TwoWay}"
WindowState="{Binding Source={x:Static p:Settings.Default}, Path=winState, Mode=TwoWay}">
<Window.Resources>
<!-- alternate colors for directory view -->
<SolidColorBrush x:Key="AlternateColor1" Color="#f2f5f9" />
<SolidColorBrush x:Key="AlternateColor2" Color="White" />
<SolidColorBrush x:Key="InactiveInputBackground" Color="#ebf5fe" />
<!-- toolbar icons -->
<BitmapImage x:Key="Icon32x32Back" UriSource="Images/32x32/back button.png"/>
<BitmapImage x:Key="Icon32x32Forward" UriSource="Images/32x32/forward button.png"/>
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
<BitmapImage x:Key="Icon48x48Refresh" UriSource="Images/48x48/refresh.png"/>
<!-- directory view internals -->
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
<local:EntryTypeConverter x:Key="entryTypeConverter"/>
<local:SortModeToBooleanConverter x:Key="sortModeToBooleanConverter" />
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
</Style>
<DataTemplate x:Key="SortArrowUp">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,5 15,5 10,0 5,5" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowDown">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,0 10,5 15,0 5,0" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowNone">
<TextBlock Margin="5,0,5,0" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="DefaultMenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="FontWeight" Value="Bold" />
</Style>
<!-- Sort-by submenu -->
<MenuItem x:Key="sortByMenu" Header="{x:Static s:guiStrings.CtxMenuSortBy}">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByName}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Name}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Name"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByType}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Type}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Type"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortBySize}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Size}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Size"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuUnsorted}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}}"
Command="{x:Static local:Commands.SortBy}"/>
</MenuItem>
<!-- Default listview context menu -->
<ContextMenu x:Key="lvDirContextMenu">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuOpen}" InputGestureText="Enter"
Style="{StaticResource DefaultMenuItemStyle}"
Command="{x:Static local:Commands.OpenItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExtract}" InputGestureText="F4"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ExtractItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuFileType}">
<MenuItem DataContext="image" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="audio" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="script" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem Header="{x:Static s:guiStrings.Type_NONE}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter=""/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExplorer}" InputGestureText="Ctrl+E"
Command="{x:Static local:Commands.ExploreItem}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuDelete}" InputGestureText="Del"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.DeleteItem}"/>
<Separator/>
<!--
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRename}" InputGestureText="F2"
Command="{x:Static local:Commands.RenameItem}"/>
-->
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ConvertMedia}" />
</ContextMenu>
</Window.Resources>
<DockPanel LastChildFill="True">
<StackPanel x:Name="MainMenuBar" DockPanel.Dock="Top" Orientation="Vertical"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winMenuBarVisibility, Mode=TwoWay}">
<Menu IsMainMenu="True" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
<MenuItem Header="{x:Static s:guiStrings.MenuFile}">
<MenuItem Header="{x:Static s:guiStrings.MenuOpen}" Command="{x:Static local:Commands.OpenFile}" InputGestureText="Ctrl+O"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Command="{x:Static local:Commands.ConvertMedia}" />
<MenuItem Header="{x:Static s:guiStrings.MenuRecent}" x:Name="RecentFilesMenu">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Header" Value="{Binding Path=Item2}"/>
<Setter Property="Command" Value="{x:Static local:Commands.OpenRecent}"/>
<Setter Property="CommandParameter" Value="{Binding Path=Item1}"/>
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuExit}" Command="{x:Static local:Commands.Exit}" InputGestureText="Ctrl+Q"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuView}">
<MenuItem Header="{x:Static s:guiStrings.MenuFitWindow}" InputGestureText="Ctrl+H"
Command="{x:Static local:Commands.FitWindow}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleToolBar}" InputGestureText="Alt+Shift+T"
Command="{x:Static local:Commands.HideToolBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleMenuBar}" InputGestureText="Alt+Shift+M"
Command="{x:Static local:Commands.HideMenuBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleStatusBar}" InputGestureText="Alt+Shift+S"
Command="{x:Static local:Commands.HideStatusBar}"/>
<Separator/>
<StaticResource ResourceKey="sortByMenu"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuHelp}">
<MenuItem Header="{x:Static s:guiStrings.MenuAbout}" Command="{x:Static local:Commands.About}"/>
</MenuItem>
</Menu>
<Separator Height="1" Margin="0"/>
</StackPanel>
<Menu Visibility="Collapsed" x:Name="HelperMenuBar"/>
<DockPanel x:Name="MainToolBar" Background="{Binding Path=Background, ElementName=HelperMenuBar}"
HorizontalAlignment="Stretch" DockPanel.Dock="Top"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winToolBarVisibility, Mode=TwoWay}">
<DockPanel.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="1,2,1,2"/>
</Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="2,2,2,2"/>
</Style>
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- Path input textbox mouseover highlight -->
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsTextBoxFocused" Value="False"/>
<Condition Property="IsMouseOver" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Image}">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<!--
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Width}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Height}"/>
<Setter Property="Stretch" Value="None"/>
-->
<Setter Property="Width" Value="24"/>
<Setter Property="Height" Value="24"/>
<Setter Property="Stretch" Value="Uniform"/>
<!-- hack to make images within disabled toolbar buttons appear 'grayed out'.
This doesn't gray them at all, but lowers their opacity so the (usually gray)
background of the button shows through. If WPF had a built-in facility for
grayscaling images in disabled buttons, this kind of icky kludgery wouldn't be
necessary -->
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Opacity" Value="0.33"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Resources>
<Separator DockPanel.Dock="Bottom" Height="1" Margin="0"/>
<Button x:Name="ButtonBack" ToolTip="{x:Static s:guiStrings.TooltipBack}" Margin="5,2,0,2"
Command="{x:Static local:Commands.GoBack}">
<Image Source="{StaticResource Icon32x32Back}"/>
</Button>
<Button x:Name="ButtonForward" ToolTip="{x:Static s:guiStrings.TooltipForward}"
Command="{x:Static local:Commands.GoForward}">
<Image Source="{StaticResource Icon32x32Forward}"/>
</Button>
<Separator/>
<StackPanel Orientation="Horizontal" x:Name="PathWidget">
<local:ExtAutoCompleteBox x:Name="pathLine" Height="22" Width="100" Margin="0" BorderThickness="1,1,0,1"/>
<Button ToolTip="{x:Static s:guiStrings.CtxMenuRefresh}" Height="22" Width="22" Margin="0"
Background="{Binding ElementName=pathLine, Path=Background}"
BorderBrush="{Binding ElementName=pathLine, Path=BorderBrush}" BorderThickness="1">
<Image Source="Images/48x48/refresh.png" Height="16" Width="16"/>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" x:Name="EncodingWidget" Visibility="{Binding ElementName=TextView, Path=Visibility}">
<Separator/>
<TextBlock Text="{x:Static s:guiStrings.LabelEncoding}" VerticalAlignment="Center" Margin="5,0,5,0"/>
<ComboBox x:Name="EncodingChoice" IsEditable="False" Height="22" DisplayMemberPath="EncodingName"
ItemsSource="{Binding ElementName=AppWindow, Path=TextEncodings}"
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appTextEncoding, Mode=TwoWay}"
SelectedValuePath="CodePage" SelectionChanged="OnEncodingSelect"/>
<Separator/>
</StackPanel>
<Button ToolTip="{x:Static s:guiStrings.MenuAbout}" DockPanel.Dock="Right" Margin="0,2,10,2"
Command="{x:Static local:Commands.About}">
<Image Source="{StaticResource Icon32x32Help}"/>
</Button>
<TextBlock Visibility="Hidden"/>
</DockPanel>
<StackPanel DockPanel.Dock="Bottom" x:Name="AppStatusBar"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winStatusBarVisibility, Mode=TwoWay}">
<Separator Height="1" Margin="0"/>
<StatusBar>
<StatusBarItem Width="{Binding ElementName=CurrentDirectory, Path=ActualWidth}">
<TextBlock x:Name="appStatusText"/>
</StatusBarItem>
<Separator Width="1"/>
<StatusBarItem>
<TextBlock x:Name="appResourceText"/>
</StatusBarItem>
</StatusBar>
</StackPanel>
<Grid x:Name="ContentGrid" DockPanel.Dock="Left" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Source={x:Static p:Settings.Default}, Path=lvPanelWidth, Mode=TwoWay}" MinWidth="200" />
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="*" MinWidth="100"/>
</Grid.ColumnDefinitions>
<local:ListViewEx x:Name="CurrentDirectory" Grid.Column="0" BorderThickness="0"
ItemsSource="{Binding Source={StaticResource ListViewSource}}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
BorderBrush="Transparent" SelectedValuePath="Name"
SelectionMode="Extended" Foreground="Black" AlternationCount="2"
ContextMenu="{StaticResource lvDirContextMenu}"
PreviewTextInput="lv_TextInput" IsSynchronizedWithCurrentItem="True"
PreviewKeyDown="lv_KeyDown"
SelectionChanged="lv_SelectionChanged"
GridViewColumnHeader.Click="lv_ColumnHeaderClicked">
<ListView.Resources>
<SolidColorBrush x:Key="ItemInactiveBackground" Color="#ffcbcbcb" />
</ListView.Resources>
<ListView.InputBindings>
<KeyBinding Key="Enter" Command="{x:Static local:Commands.OpenItem}"/>
<KeyBinding Gesture="Ctrl+E" Command="{x:Static local:Commands.ExploreItem}"/>
<KeyBinding Gesture="F2" Command="{x:Static local:Commands.RenameItem}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
<MouseBinding Gesture="LeftDoubleClick" Command="{x:Static local:Commands.OpenItem}" />
</ListView.InputBindings>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<EventSetter Event="ListViewItem.MouseDoubleClick" Handler="lvi_DoubleClick" />
<Style.Triggers>
<!-- BEGIN alternate row color -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="0"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor1}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="1"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor2}"/>
</MultiTrigger>
<!-- END alternate row color -->
<!-- BEGIN context menu trigger -->
<!--
<DataTrigger Binding="{Binding Path=IsArchive}" Value="True">
<Setter Property="ContextMenu" Value="{StaticResource lvArcContextMenu}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsArchive}" Value="False">
<Setter Property="ContextMenu" Value="{StaticResource lvDirContextMenu}"/>
</DataTrigger>
-->
<!-- END context menu trigger -->
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvNameColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Name" Content="{x:Static s:guiStrings.HeaderName}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvTypeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}" DisplayMemberBinding="{Binding Path=Type, Mode=OneWay, Converter={StaticResource entryTypeConverter}}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvSizeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Size" Content="{x:Static s:guiStrings.HeaderSize}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock Text="{Binding Path=Size}" TextAlignment="Right"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</local:ListViewEx>
<Grid Grid.Column="2" Name="PreviewPane" SnapsToDevicePixels="True">
<ScrollViewer Name="ImageView" Background="LightGray" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Image Name="ImageCanvas" Stretch="None" UseLayoutRounding="True" SnapsToDevicePixels="True"
local:TouchScrolling.IsEnabled="True" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
</ScrollViewer>
<jv:TextViewer x:Name="TextView" Visibility="Collapsed" BorderThickness="1,0,0,0" BorderBrush="Black"/>
</Grid>
<!-- Margin and BorderThickness help to react early on mouse pointer -->
<GridSplitter Grid.Column="1" Background="Black" ShowsPreview="False" Focusable="False"
Margin="-3,0" BorderThickness="3,0" BorderBrush="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Stretch" />
</Grid>
</DockPanel>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+O" Command="{x:Static local:Commands.OpenFile}"/>
<KeyBinding Gesture="Ctrl+Q" Command="{x:Static local:Commands.Exit}"/>
<KeyBinding Gesture="Ctrl+H" Command="{x:Static local:Commands.FitWindow}"/>
<KeyBinding Gesture="Ctrl+A" Command="{x:Static local:Commands.SelectAll}"/>
<KeyBinding Gesture="Backspace" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Left" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Right" Command="{x:Static local:Commands.GoForward}"/>
<KeyBinding Gesture="Alt+Shift+M" Command="{x:Static local:Commands.HideMenuBar}"/>
<KeyBinding Gesture="Alt+Shift+T" Command="{x:Static local:Commands.HideToolBar}"/>
<KeyBinding Gesture="Alt+Shift+S" Command="{x:Static local:Commands.HideStatusBar}"/>
<KeyBinding Gesture="F3" Command="{x:Static local:Commands.CreateArchive}"/>
<KeyBinding Gesture="F4" Command="{x:Static local:Commands.ExtractItem}"/>
<KeyBinding Gesture="F5" Command="{x:Static local:Commands.Refresh}"/>
<KeyBinding Gesture="F6" Command="{x:Static local:Commands.ConvertMedia}"/>
<KeyBinding Gesture="Delete" Command="{x:Static local:Commands.DeleteItem}"/>
<KeyBinding Gesture="Add" Command="{x:Static local:Commands.AddSelection}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.OpenItem}" Executed="OpenItemExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.OpenFile}" Executed="OpenFileExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.OpenRecent}" Executed="OpenRecentExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.AddSelection}" Executed="AddSelectionExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SelectAll}" Executed="SelectAllExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.NextItem}" Executed="NextItemExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.ExtractItem}" Executed="ExtractItemExec" CanExecute="CanExecuteExtract"/>
<CommandBinding Command="{x:Static local:Commands.CreateArchive}" Executed="CreateArchiveExec" CanExecute="CanExecuteCreateArchive"/>
<CommandBinding Command="{x:Static local:Commands.DeleteItem}" Executed="DeleteItemExec" CanExecute="CanExecuteOnPhysicalFile" />
<CommandBinding Command="{x:Static local:Commands.RenameItem}" Executed="RenameItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ExploreItem}" Executed="ExploreItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ConvertMedia}" Executed="ConvertMediaExec" CanExecute="CanExecuteConvertMedia" />
<CommandBinding Command="{x:Static local:Commands.SortBy}" Executed="SortByExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SetFileType}" Executed="SetFileTypeExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.GoBack}" Executed="GoBackExec" CanExecute="CanExecuteGoBack"/>
<CommandBinding Command="{x:Static local:Commands.GoForward}" Executed="GoForwardExec" CanExecute="CanExecuteGoForward"/>
<CommandBinding Command="{x:Static local:Commands.Refresh}" Executed="RefreshExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.FitWindow}" Executed="FitWindowExec" CanExecute="CanExecuteFitWindow"/>
<CommandBinding Command="{x:Static local:Commands.HideStatusBar}" Executed="HideStatusBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideMenuBar}" Executed="HideMenuBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideToolBar}" Executed="HideToolBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.About}" Executed="AboutExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.Exit}" Executed="ExitExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</Window>
<Window x:Class="GARbro.GUI.MainWindow" x:Name="AppWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GARbro.GUI"
xmlns:jv="clr-namespace:JustView"
xmlns:s="clr-namespace:GARbro.GUI.Strings"
xmlns:p="clr-namespace:GARbro.GUI.Properties"
Title="GARbro" MinHeight="250" ResizeMode="CanResizeWithGrip"
Loaded="WindowLoaded"
KeyDown="WindowKeyDown"
Top="{Binding Source={x:Static p:Settings.Default}, Path=winTop, Mode=TwoWay}"
Left="{Binding Source={x:Static p:Settings.Default}, Path=winLeft, Mode=TwoWay}"
Height="{Binding Source={x:Static p:Settings.Default}, Path=winHeight, Mode=TwoWay}"
Width="{Binding Source={x:Static p:Settings.Default}, Path=winWidth, Mode=TwoWay}"
WindowState="{Binding Source={x:Static p:Settings.Default}, Path=winState, Mode=TwoWay}">
<Window.Resources>
<!-- alternate colors for directory view -->
<SolidColorBrush x:Key="AlternateColor1" Color="#f2f5f9" />
<SolidColorBrush x:Key="AlternateColor2" Color="White" />
<SolidColorBrush x:Key="InactiveInputBackground" Color="#ebf5fe" />
<!-- toolbar icons -->
<BitmapImage x:Key="Icon32x32Back" UriSource="Images/32x32/back button.png"/>
<BitmapImage x:Key="Icon32x32Forward" UriSource="Images/32x32/forward button.png"/>
<BitmapImage x:Key="Icon32x32Help" UriSource="Images/32x32/help.png"/>
<BitmapImage x:Key="Icon48x48Refresh" UriSource="Images/48x48/refresh.png"/>
<!-- directory view internals -->
<CollectionViewSource x:Key="ListViewSource" Source="{Binding}"/>
<local:BooleanToCollapsedVisibilityConverter x:Key="booleanToCollapsedVisibilityConverter" />
<local:EntryTypeConverter x:Key="entryTypeConverter"/>
<local:SortModeToBooleanConverter x:Key="sortModeToBooleanConverter" />
<Style x:Key="HeaderLeftAlign" TargetType="{x:Type GridViewColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Left"></Setter>
</Style>
<DataTemplate x:Key="SortArrowUp">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,5 15,5 10,0 5,5" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowDown">
<DockPanel>
<TextBlock Margin="5,0,5,0" Text="{Binding}" />
<Path VerticalAlignment="Center" Fill="Gray" Data="M 5,0 10,5 15,0 5,0" />
</DockPanel>
</DataTemplate>
<DataTemplate x:Key="SortArrowNone">
<TextBlock Margin="5,0,5,0" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="DefaultMenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="FontWeight" Value="Bold" />
</Style>
<!-- Sort-by submenu -->
<MenuItem x:Key="sortByMenu" Header="{x:Static s:guiStrings.CtxMenuSortBy}">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByName}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Name}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Name"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortByType}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Type}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Type"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuSortBySize}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}, ConverterParameter=Size}"
Command="{x:Static local:Commands.SortBy}" CommandParameter="Size"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuUnsorted}" IsCheckable="True"
IsChecked="{Binding ElementName=AppWindow, Path=SortMode, Mode=OneWay, Converter={StaticResource sortModeToBooleanConverter}}"
Command="{x:Static local:Commands.SortBy}"/>
</MenuItem>
<!-- Default listview context menu -->
<ContextMenu x:Key="lvDirContextMenu">
<MenuItem Header="{x:Static s:guiStrings.CtxMenuOpen}" InputGestureText="Enter"
Style="{StaticResource DefaultMenuItemStyle}"
Command="{x:Static local:Commands.OpenItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExtract}" InputGestureText="F4"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ExtractItem}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuFileType}">
<MenuItem DataContext="image" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="audio" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem DataContext="script" Header="{Binding Converter={StaticResource entryTypeConverter}}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter="{Binding}"/>
<MenuItem Header="{x:Static s:guiStrings.Type_NONE}"
Command="{x:Static local:Commands.SetFileType}" CommandParameter=""/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuExplorer}" InputGestureText="Ctrl+E"
Command="{x:Static local:Commands.ExploreItem}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuDelete}" InputGestureText="Del"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.DeleteItem}"/>
<Separator/>
<!--
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRename}" InputGestureText="F2"
Command="{x:Static local:Commands.RenameItem}"/>
-->
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource booleanToCollapsedVisibilityConverter}}"
Command="{x:Static local:Commands.ConvertMedia}" />
</ContextMenu>
</Window.Resources>
<DockPanel LastChildFill="True">
<StackPanel x:Name="MainMenuBar" DockPanel.Dock="Top" Orientation="Vertical"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winMenuBarVisibility, Mode=TwoWay}">
<Menu IsMainMenu="True" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
<MenuItem Header="{x:Static s:guiStrings.MenuFile}">
<MenuItem Header="{x:Static s:guiStrings.MenuOpen}" Command="{x:Static local:Commands.OpenFile}" InputGestureText="Ctrl+O"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuCreate}" InputGestureText="F3"
Command="{x:Static local:Commands.CreateArchive}" />
<MenuItem Header="{x:Static s:guiStrings.CtxMenuConvert}" InputGestureText="F6"
Command="{x:Static local:Commands.ConvertMedia}" />
<MenuItem Header="{x:Static s:guiStrings.MenuRecent}" x:Name="RecentFilesMenu">
<MenuItem.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Header" Value="{Binding Path=Item2}"/>
<Setter Property="Command" Value="{x:Static local:Commands.OpenRecent}"/>
<Setter Property="CommandParameter" Value="{Binding Path=Item1}"/>
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuExit}" Command="{x:Static local:Commands.Exit}" InputGestureText="Ctrl+Q"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuView}">
<MenuItem Header="{x:Static s:guiStrings.MenuFitWindow}" InputGestureText="Ctrl+H"
Command="{x:Static local:Commands.FitWindow}"/>
<MenuItem Header="{x:Static s:guiStrings.CtxMenuRefresh}" InputGestureText="F5"
Command="{x:Static local:Commands.Refresh}"/>
<Separator/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleToolBar}" InputGestureText="Alt+Shift+T"
Command="{x:Static local:Commands.HideToolBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleMenuBar}" InputGestureText="Alt+Shift+M"
Command="{x:Static local:Commands.HideMenuBar}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuToggleStatusBar}" InputGestureText="Alt+Shift+S"
Command="{x:Static local:Commands.HideStatusBar}"/>
<Separator/>
<StaticResource ResourceKey="sortByMenu"/>
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuHelp}">
<MenuItem Header="{x:Static s:guiStrings.MenuAbout}" Command="{x:Static local:Commands.About}"/>
</MenuItem>
</Menu>
<Separator Height="1" Margin="0"/>
</StackPanel>
<Menu Visibility="Collapsed" x:Name="HelperMenuBar"/>
<DockPanel x:Name="MainToolBar" Background="{Binding Path=Background, ElementName=HelperMenuBar}"
HorizontalAlignment="Stretch" DockPanel.Dock="Top"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winToolBarVisibility, Mode=TwoWay}">
<DockPanel.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="1,2,1,2"/>
</Style>
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Margin" Value="2,2,2,2"/>
</Style>
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- Path input textbox mouseover highlight -->
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsTextBoxFocused" Value="False"/>
<Condition Property="IsMouseOver" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Image}">
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<!--
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Width}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self}, Path=Source.Height}"/>
<Setter Property="Stretch" Value="None"/>
-->
<Setter Property="Width" Value="24"/>
<Setter Property="Height" Value="24"/>
<Setter Property="Stretch" Value="Uniform"/>
<!-- hack to make images within disabled toolbar buttons appear 'grayed out'.
This doesn't gray them at all, but lowers their opacity so the (usually gray)
background of the button shows through. If WPF had a built-in facility for
grayscaling images in disabled buttons, this kind of icky kludgery wouldn't be
necessary -->
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Opacity" Value="0.33"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Resources>
<Separator DockPanel.Dock="Bottom" Height="1" Margin="0"/>
<Button x:Name="ButtonBack" ToolTip="{x:Static s:guiStrings.TooltipBack}" Margin="5,2,0,2"
Command="{x:Static local:Commands.GoBack}">
<Image Source="{StaticResource Icon32x32Back}"/>
</Button>
<Button x:Name="ButtonForward" ToolTip="{x:Static s:guiStrings.TooltipForward}"
Command="{x:Static local:Commands.GoForward}">
<Image Source="{StaticResource Icon32x32Forward}"/>
</Button>
<Separator/>
<StackPanel Orientation="Horizontal" x:Name="PathWidget">
<local:ExtAutoCompleteBox x:Name="pathLine" Height="22" Width="100" Margin="0" BorderThickness="1,1,0,1"/>
<Button ToolTip="{x:Static s:guiStrings.CtxMenuRefresh}" Height="22" Width="22" Margin="0"
Background="{Binding ElementName=pathLine, Path=Background}"
BorderBrush="{Binding ElementName=pathLine, Path=BorderBrush}" BorderThickness="1">
<Image Source="Images/48x48/refresh.png" Height="16" Width="16"/>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" x:Name="EncodingWidget" Visibility="{Binding ElementName=TextView, Path=Visibility}">
<Separator/>
<TextBlock Text="{x:Static s:guiStrings.LabelEncoding}" VerticalAlignment="Center" Margin="5,0,5,0"/>
<ComboBox x:Name="EncodingChoice" IsEditable="False" Height="22" DisplayMemberPath="EncodingName"
ItemsSource="{Binding ElementName=AppWindow, Path=TextEncodings}"
SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appTextEncoding, Mode=TwoWay}"
SelectedValuePath="CodePage" SelectionChanged="OnEncodingSelect"/>
<Separator/>
</StackPanel>
<Button ToolTip="{x:Static s:guiStrings.MenuAbout}" DockPanel.Dock="Right" Margin="0,2,10,2"
Command="{x:Static local:Commands.About}">
<Image Source="{StaticResource Icon32x32Help}"/>
</Button>
<TextBlock Visibility="Hidden"/>
</DockPanel>
<StackPanel DockPanel.Dock="Bottom" x:Name="AppStatusBar"
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winStatusBarVisibility, Mode=TwoWay}">
<Separator Height="1" Margin="0"/>
<StatusBar>
<StatusBarItem Width="{Binding ElementName=CurrentDirectory, Path=ActualWidth}">
<TextBlock x:Name="appStatusText"/>
</StatusBarItem>
<Separator Width="1"/>
<StatusBarItem>
<TextBlock x:Name="appResourceText"/>
</StatusBarItem>
</StatusBar>
</StackPanel>
<Grid x:Name="ContentGrid" DockPanel.Dock="Left" VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Source={x:Static p:Settings.Default}, Path=lvPanelWidth, Mode=TwoWay}" MinWidth="200" />
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="*" MinWidth="100"/>
</Grid.ColumnDefinitions>
<local:ListViewEx x:Name="CurrentDirectory" Grid.Column="0" BorderThickness="0"
ItemsSource="{Binding Source={StaticResource ListViewSource}}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
BorderBrush="Transparent" SelectedValuePath="Name"
SelectionMode="Extended" Foreground="Black" AlternationCount="2"
ContextMenu="{StaticResource lvDirContextMenu}"
PreviewTextInput="lv_TextInput" IsSynchronizedWithCurrentItem="True"
PreviewKeyDown="lv_KeyDown"
SelectionChanged="lv_SelectionChanged"
GridViewColumnHeader.Click="lv_ColumnHeaderClicked">
<ListView.Resources>
<SolidColorBrush x:Key="ItemInactiveBackground" Color="#ffcbcbcb" />
</ListView.Resources>
<ListView.InputBindings>
<KeyBinding Key="Enter" Command="{x:Static local:Commands.OpenItem}"/>
<KeyBinding Gesture="Ctrl+E" Command="{x:Static local:Commands.ExploreItem}"/>
<KeyBinding Gesture="F2" Command="{x:Static local:Commands.RenameItem}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
<MouseBinding Gesture="LeftDoubleClick" Command="{x:Static local:Commands.OpenItem}" />
</ListView.InputBindings>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<EventSetter Event="ListViewItem.MouseDoubleClick" Handler="lvi_DoubleClick" />
<Style.Triggers>
<!-- BEGIN alternate row color -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="0"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor1}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="ItemsControl.AlternationIndex" Value="1"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{StaticResource AlternateColor2}"/>
</MultiTrigger>
<!-- END alternate row color -->
<!-- BEGIN context menu trigger -->
<!--
<DataTrigger Binding="{Binding Path=IsArchive}" Value="True">
<Setter Property="ContextMenu" Value="{StaticResource lvArcContextMenu}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsArchive}" Value="False">
<Setter Property="ContextMenu" Value="{StaticResource lvDirContextMenu}"/>
</DataTrigger>
-->
<!-- END context menu trigger -->
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvNameColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Name" Content="{x:Static s:guiStrings.HeaderName}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock x:Name="item_Name" Text="{Binding Path=Name}"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvTypeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}" DisplayMemberBinding="{Binding Path=Type, Mode=OneWay, Converter={StaticResource entryTypeConverter}}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Type" Content="{x:Static s:guiStrings.HeaderType}"/>
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn HeaderContainerStyle="{StaticResource HeaderLeftAlign}" Width="{Binding Source={x:Static p:Settings.Default}, Path=lvSizeColumnWidth, Mode=TwoWay}" HeaderTemplate="{StaticResource SortArrowNone}">
<GridViewColumn.Header>
<GridViewColumnHeader Tag="Size" Content="{x:Static s:guiStrings.HeaderSize}"/>
</GridViewColumn.Header>
<GridViewColumn.CellTemplate>
<DataTemplate><TextBlock Text="{Binding Path=Size}" TextAlignment="Right"/></DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</local:ListViewEx>
<Grid Grid.Column="2" Name="PreviewPane" SnapsToDevicePixels="True">
<ScrollViewer Name="ImageView" Background="LightGray" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Image Name="ImageCanvas" Stretch="None" UseLayoutRounding="True" SnapsToDevicePixels="True"
local:TouchScrolling.IsEnabled="True" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
</ScrollViewer>
<jv:TextViewer x:Name="TextView" Visibility="Collapsed" BorderThickness="1,0,0,0" BorderBrush="Black"/>
</Grid>
<!-- Margin and BorderThickness help to react early on mouse pointer -->
<GridSplitter Grid.Column="1" Background="Black" ShowsPreview="False" Focusable="False"
Margin="-3,0" BorderThickness="3,0" BorderBrush="Transparent"
HorizontalAlignment="Center" VerticalAlignment="Stretch" />
</Grid>
</DockPanel>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+O" Command="{x:Static local:Commands.OpenFile}"/>
<KeyBinding Gesture="Ctrl+Q" Command="{x:Static local:Commands.Exit}"/>
<KeyBinding Gesture="Ctrl+H" Command="{x:Static local:Commands.FitWindow}"/>
<KeyBinding Gesture="Ctrl+A" Command="{x:Static local:Commands.SelectAll}"/>
<KeyBinding Gesture="Backspace" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Left" Command="{x:Static local:Commands.GoBack}"/>
<KeyBinding Gesture="Alt+Right" Command="{x:Static local:Commands.GoForward}"/>
<KeyBinding Gesture="Alt+Shift+M" Command="{x:Static local:Commands.HideMenuBar}"/>
<KeyBinding Gesture="Alt+Shift+T" Command="{x:Static local:Commands.HideToolBar}"/>
<KeyBinding Gesture="Alt+Shift+S" Command="{x:Static local:Commands.HideStatusBar}"/>
<KeyBinding Gesture="F3" Command="{x:Static local:Commands.CreateArchive}"/>
<KeyBinding Gesture="F4" Command="{x:Static local:Commands.ExtractItem}"/>
<KeyBinding Gesture="F5" Command="{x:Static local:Commands.Refresh}"/>
<KeyBinding Gesture="F6" Command="{x:Static local:Commands.ConvertMedia}"/>
<KeyBinding Gesture="Delete" Command="{x:Static local:Commands.DeleteItem}"/>
<KeyBinding Gesture="Add" Command="{x:Static local:Commands.AddSelection}"/>
<KeyBinding Gesture="Space" Command="{x:Static local:Commands.NextItem}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{x:Static local:Commands.OpenItem}" Executed="OpenItemExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.OpenFile}" Executed="OpenFileExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.OpenRecent}" Executed="OpenRecentExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.AddSelection}" Executed="AddSelectionExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SelectAll}" Executed="SelectAllExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.NextItem}" Executed="NextItemExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.ExtractItem}" Executed="ExtractItemExec" CanExecute="CanExecuteExtract"/>
<CommandBinding Command="{x:Static local:Commands.CreateArchive}" Executed="CreateArchiveExec" CanExecute="CanExecuteCreateArchive"/>
<CommandBinding Command="{x:Static local:Commands.DeleteItem}" Executed="DeleteItemExec" CanExecute="CanExecuteOnPhysicalFile" />
<CommandBinding Command="{x:Static local:Commands.RenameItem}" Executed="RenameItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ExploreItem}" Executed="ExploreItemExec" CanExecute="CanExecuteInDirectory" />
<CommandBinding Command="{x:Static local:Commands.ConvertMedia}" Executed="ConvertMediaExec" CanExecute="CanExecuteConvertMedia" />
<CommandBinding Command="{x:Static local:Commands.SortBy}" Executed="SortByExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.SetFileType}" Executed="SetFileTypeExec" CanExecute="CanExecuteOnSelected"/>
<CommandBinding Command="{x:Static local:Commands.GoBack}" Executed="GoBackExec" CanExecute="CanExecuteGoBack"/>
<CommandBinding Command="{x:Static local:Commands.GoForward}" Executed="GoForwardExec" CanExecute="CanExecuteGoForward"/>
<CommandBinding Command="{x:Static local:Commands.Refresh}" Executed="RefreshExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.FitWindow}" Executed="FitWindowExec" CanExecute="CanExecuteFitWindow"/>
<CommandBinding Command="{x:Static local:Commands.HideStatusBar}" Executed="HideStatusBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideMenuBar}" Executed="HideMenuBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.HideToolBar}" Executed="HideToolBarExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.About}" Executed="AboutExec" CanExecute="CanExecuteAlways"/>
<CommandBinding Command="{x:Static local:Commands.Exit}" Executed="ExitExec" CanExecute="CanExecuteAlways"/>
</Window.CommandBindings>
</Window>

File diff suppressed because it is too large Load Diff

View File

@ -1,88 +1,88 @@
//! \file ModalWindow.cs
//! \date Tue Aug 02 10:20:50 2011
//! \brief Window without an icon.
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Windows;
using System.Windows.Interop;
using System.Runtime.InteropServices;
namespace Rnd.Windows
{
/// <summary>
/// Window without an icon.
/// </summary>
public class ModalWindow : Window
{
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HideIcon (this);
}
internal class NativeMethods
{
[DllImport ("user32.dll")]
internal static extern int GetWindowLong (IntPtr hwnd, int index);
[DllImport ("user32.dll")]
internal static extern int SetWindowLong (IntPtr hwnd, int index, int newStyle);
[DllImport ("user32.dll")]
internal static extern bool SetWindowPos (IntPtr hwnd, IntPtr hwndInsertAfter, int x, int y, int width, int height, uint flags);
[DllImport ("user32.dll")]
internal static extern IntPtr SendMessage (IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
}
const int GWL_EXSTYLE = -20;
const int WS_EX_DLGMODALFRAME = 0x0001;
const int SWP_NOSIZE = 0x0001;
const int SWP_NOMOVE = 0x0002;
const int SWP_NOZORDER = 0x0004;
const int SWP_FRAMECHANGED = 0x0020;
const uint WM_SETICON = 0x0080;
/// <summary>
/// Win32 mumbo-jumbo to hide window icon and its menu.
/// </summary>
public static void HideIcon (Window window)
{
// Get this window's handle
IntPtr hwnd = new WindowInteropHelper (window).Handle;
// Change the extended window style to not show a window icon
int extendedStyle = NativeMethods.GetWindowLong (hwnd, GWL_EXSTYLE);
NativeMethods.SetWindowLong (hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_DLGMODALFRAME);
NativeMethods.SendMessage (hwnd, WM_SETICON, IntPtr.Zero, IntPtr.Zero);
NativeMethods.SendMessage (hwnd, WM_SETICON, new IntPtr (1), IntPtr.Zero);
// Update the window's non-client area to reflect the changes
NativeMethods.SetWindowPos (hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
}
}
//! \file ModalWindow.cs
//! \date Tue Aug 02 10:20:50 2011
//! \brief Window without an icon.
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Windows;
using System.Windows.Interop;
using System.Runtime.InteropServices;
namespace Rnd.Windows
{
/// <summary>
/// Window without an icon.
/// </summary>
public class ModalWindow : Window
{
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HideIcon (this);
}
internal class NativeMethods
{
[DllImport ("user32.dll")]
internal static extern int GetWindowLong (IntPtr hwnd, int index);
[DllImport ("user32.dll")]
internal static extern int SetWindowLong (IntPtr hwnd, int index, int newStyle);
[DllImport ("user32.dll")]
internal static extern bool SetWindowPos (IntPtr hwnd, IntPtr hwndInsertAfter, int x, int y, int width, int height, uint flags);
[DllImport ("user32.dll")]
internal static extern IntPtr SendMessage (IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
}
const int GWL_EXSTYLE = -20;
const int WS_EX_DLGMODALFRAME = 0x0001;
const int SWP_NOSIZE = 0x0001;
const int SWP_NOMOVE = 0x0002;
const int SWP_NOZORDER = 0x0004;
const int SWP_FRAMECHANGED = 0x0020;
const uint WM_SETICON = 0x0080;
/// <summary>
/// Win32 mumbo-jumbo to hide window icon and its menu.
/// </summary>
public static void HideIcon (Window window)
{
// Get this window's handle
IntPtr hwnd = new WindowInteropHelper (window).Handle;
// Change the extended window style to not show a window icon
int extendedStyle = NativeMethods.GetWindowLong (hwnd, GWL_EXSTYLE);
NativeMethods.SetWindowLong (hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_DLGMODALFRAME);
NativeMethods.SendMessage (hwnd, WM_SETICON, IntPtr.Zero, IntPtr.Zero);
NativeMethods.SendMessage (hwnd, WM_SETICON, new IntPtr (1), IntPtr.Zero);
// Update the window's non-client area to reflect the changes
NativeMethods.SetWindowPos (hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
}
}

View File

@ -1,55 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Game Resource browser")]
[assembly: AssemblyDescription("Game Resource browser")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany ("mørkt")]
[assembly: AssemblyProduct("GARbro.GUI")]
[assembly: AssemblyCopyright ("Copyright © 2014-2015 mørkt")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("1.2.12.953")]
[assembly: AssemblyFileVersion ("1.2.12.953")]
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Game Resource browser")]
[assembly: AssemblyDescription("Game Resource browser")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany ("mørkt")]
[assembly: AssemblyProduct("GARbro.GUI")]
[assembly: AssemblyCopyright ("Copyright © 2014-2015 mørkt")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("1.2.12.0")]
[assembly: AssemblyFileVersion ("1.2.12.0")]

View File

@ -1,63 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GARbro.GUI.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GARbro.GUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GARbro.GUI.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GARbro.GUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,361 +1,361 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GARbro.GUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool UpgradeRequired {
get {
return ((bool)(this["UpgradeRequired"]));
}
set {
this["UpgradeRequired"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double winTop {
get {
return ((double)(this["winTop"]));
}
set {
this["winTop"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double winLeft {
get {
return ((double)(this["winLeft"]));
}
set {
this["winLeft"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1024")]
public double winWidth {
get {
return ((double)(this["winWidth"]));
}
set {
this["winWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("600")]
public double winHeight {
get {
return ((double)(this["winHeight"]));
}
set {
this["winHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Normal")]
public global::System.Windows.WindowState winState {
get {
return ((global::System.Windows.WindowState)(this["winState"]));
}
set {
this["winState"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("265")]
public double lvNameColumnWidth {
get {
return ((double)(this["lvNameColumnWidth"]));
}
set {
this["lvNameColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("75")]
public double lvTypeColumnWidth {
get {
return ((double)(this["lvTypeColumnWidth"]));
}
set {
this["lvTypeColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("75")]
public double lvSizeColumnWidth {
get {
return ((double)(this["lvSizeColumnWidth"]));
}
set {
this["lvSizeColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Name")]
public string lvSortColumn {
get {
return ((string)(this["lvSortColumn"]));
}
set {
this["lvSortColumn"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Ascending")]
public global::System.ComponentModel.ListSortDirection lvSortDirection {
get {
return ((global::System.ComponentModel.ListSortDirection)(this["lvSortDirection"]));
}
set {
this["lvSortDirection"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("448")]
public global::System.Windows.GridLength lvPanelWidth {
get {
return ((global::System.Windows.GridLength)(this["lvPanelWidth"]));
}
set {
this["lvPanelWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractImages {
get {
return ((bool)(this["appExtractImages"]));
}
set {
this["appExtractImages"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractText {
get {
return ((bool)(this["appExtractText"]));
}
set {
this["appExtractText"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appImageFormat {
get {
return ((string)(this["appImageFormat"]));
}
set {
this["appImageFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("65001")]
public int appTextEncoding {
get {
return ((int)(this["appTextEncoding"]));
}
set {
this["appTextEncoding"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastDirectory {
get {
return ((string)(this["appLastDirectory"]));
}
set {
this["appLastDirectory"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appArchiveFormat {
get {
return ((string)(this["appArchiveFormat"]));
}
set {
this["appArchiveFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection appRecentFiles {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["appRecentFiles"]));
}
set {
this["appRecentFiles"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastCreatedArchive {
get {
return ((string)(this["appLastCreatedArchive"]));
}
set {
this["appLastCreatedArchive"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winMenuBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winMenuBarVisibility"]));
}
set {
this["winMenuBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winToolBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winToolBarVisibility"]));
}
set {
this["winToolBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winStatusBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winStatusBarVisibility"]));
}
set {
this["winStatusBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("PNG")]
public string appLastImageFormat {
get {
return ((string)(this["appLastImageFormat"]));
}
set {
this["appLastImageFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool appConvertAudio {
get {
return ((bool)(this["appConvertAudio"]));
}
set {
this["appConvertAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractAudio {
get {
return ((bool)(this["appExtractAudio"]));
}
set {
this["appExtractAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool appIgnoreConversionErrors {
get {
return ((bool)(this["appIgnoreConversionErrors"]));
}
set {
this["appIgnoreConversionErrors"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastDestination {
get {
return ((string)(this["appLastDestination"]));
}
set {
this["appLastDestination"] = value;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GARbro.GUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool UpgradeRequired {
get {
return ((bool)(this["UpgradeRequired"]));
}
set {
this["UpgradeRequired"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double winTop {
get {
return ((double)(this["winTop"]));
}
set {
this["winTop"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NaN")]
public double winLeft {
get {
return ((double)(this["winLeft"]));
}
set {
this["winLeft"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1024")]
public double winWidth {
get {
return ((double)(this["winWidth"]));
}
set {
this["winWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("600")]
public double winHeight {
get {
return ((double)(this["winHeight"]));
}
set {
this["winHeight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Normal")]
public global::System.Windows.WindowState winState {
get {
return ((global::System.Windows.WindowState)(this["winState"]));
}
set {
this["winState"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("265")]
public double lvNameColumnWidth {
get {
return ((double)(this["lvNameColumnWidth"]));
}
set {
this["lvNameColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("75")]
public double lvTypeColumnWidth {
get {
return ((double)(this["lvTypeColumnWidth"]));
}
set {
this["lvTypeColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("75")]
public double lvSizeColumnWidth {
get {
return ((double)(this["lvSizeColumnWidth"]));
}
set {
this["lvSizeColumnWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Name")]
public string lvSortColumn {
get {
return ((string)(this["lvSortColumn"]));
}
set {
this["lvSortColumn"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Ascending")]
public global::System.ComponentModel.ListSortDirection lvSortDirection {
get {
return ((global::System.ComponentModel.ListSortDirection)(this["lvSortDirection"]));
}
set {
this["lvSortDirection"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("448")]
public global::System.Windows.GridLength lvPanelWidth {
get {
return ((global::System.Windows.GridLength)(this["lvPanelWidth"]));
}
set {
this["lvPanelWidth"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractImages {
get {
return ((bool)(this["appExtractImages"]));
}
set {
this["appExtractImages"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractText {
get {
return ((bool)(this["appExtractText"]));
}
set {
this["appExtractText"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appImageFormat {
get {
return ((string)(this["appImageFormat"]));
}
set {
this["appImageFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("65001")]
public int appTextEncoding {
get {
return ((int)(this["appTextEncoding"]));
}
set {
this["appTextEncoding"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastDirectory {
get {
return ((string)(this["appLastDirectory"]));
}
set {
this["appLastDirectory"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appArchiveFormat {
get {
return ((string)(this["appArchiveFormat"]));
}
set {
this["appArchiveFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Collections.Specialized.StringCollection appRecentFiles {
get {
return ((global::System.Collections.Specialized.StringCollection)(this["appRecentFiles"]));
}
set {
this["appRecentFiles"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastCreatedArchive {
get {
return ((string)(this["appLastCreatedArchive"]));
}
set {
this["appLastCreatedArchive"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winMenuBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winMenuBarVisibility"]));
}
set {
this["winMenuBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winToolBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winToolBarVisibility"]));
}
set {
this["winToolBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Visible")]
public global::System.Windows.Visibility winStatusBarVisibility {
get {
return ((global::System.Windows.Visibility)(this["winStatusBarVisibility"]));
}
set {
this["winStatusBarVisibility"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("PNG")]
public string appLastImageFormat {
get {
return ((string)(this["appLastImageFormat"]));
}
set {
this["appLastImageFormat"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool appConvertAudio {
get {
return ((bool)(this["appConvertAudio"]));
}
set {
this["appConvertAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool appExtractAudio {
get {
return ((bool)(this["appExtractAudio"]));
}
set {
this["appExtractAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool appIgnoreConversionErrors {
get {
return ((bool)(this["appIgnoreConversionErrors"]));
}
set {
this["appIgnoreConversionErrors"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string appLastDestination {
get {
return ((string)(this["appLastDestination"]));
}
set {
this["appLastDestination"] = value;
}
}
}
}

View File

@ -1,90 +1,90 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="GARbro.GUI.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="winTop" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="winLeft" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="winWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">1024</Value>
</Setting>
<Setting Name="winHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">600</Value>
</Setting>
<Setting Name="winState" Type="System.Windows.WindowState" Scope="User">
<Value Profile="(Default)">Normal</Value>
</Setting>
<Setting Name="lvNameColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">265</Value>
</Setting>
<Setting Name="lvTypeColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">75</Value>
</Setting>
<Setting Name="lvSizeColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">75</Value>
</Setting>
<Setting Name="lvSortColumn" Type="System.String" Scope="User">
<Value Profile="(Default)">Name</Value>
</Setting>
<Setting Name="lvSortDirection" Type="System.ComponentModel.ListSortDirection" Scope="User">
<Value Profile="(Default)">Ascending</Value>
</Setting>
<Setting Name="lvPanelWidth" Type="System.Windows.GridLength" Scope="User">
<Value Profile="(Default)">448</Value>
</Setting>
<Setting Name="appExtractImages" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appExtractText" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appImageFormat" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appTextEncoding" Type="System.Int32" Scope="User">
<Value Profile="(Default)">65001</Value>
</Setting>
<Setting Name="appLastDirectory" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appArchiveFormat" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appRecentFiles" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appLastCreatedArchive" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="winMenuBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="winToolBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="winStatusBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="appLastImageFormat" Type="System.String" Scope="User">
<Value Profile="(Default)">PNG</Value>
</Setting>
<Setting Name="appConvertAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="appExtractAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appIgnoreConversionErrors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="appLastDestination" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="GARbro.GUI.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="winTop" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="winLeft" Type="System.Double" Scope="User">
<Value Profile="(Default)">NaN</Value>
</Setting>
<Setting Name="winWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">1024</Value>
</Setting>
<Setting Name="winHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">600</Value>
</Setting>
<Setting Name="winState" Type="System.Windows.WindowState" Scope="User">
<Value Profile="(Default)">Normal</Value>
</Setting>
<Setting Name="lvNameColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">265</Value>
</Setting>
<Setting Name="lvTypeColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">75</Value>
</Setting>
<Setting Name="lvSizeColumnWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">75</Value>
</Setting>
<Setting Name="lvSortColumn" Type="System.String" Scope="User">
<Value Profile="(Default)">Name</Value>
</Setting>
<Setting Name="lvSortDirection" Type="System.ComponentModel.ListSortDirection" Scope="User">
<Value Profile="(Default)">Ascending</Value>
</Setting>
<Setting Name="lvPanelWidth" Type="System.Windows.GridLength" Scope="User">
<Value Profile="(Default)">448</Value>
</Setting>
<Setting Name="appExtractImages" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appExtractText" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appImageFormat" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appTextEncoding" Type="System.Int32" Scope="User">
<Value Profile="(Default)">65001</Value>
</Setting>
<Setting Name="appLastDirectory" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appArchiveFormat" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appRecentFiles" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="appLastCreatedArchive" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="winMenuBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="winToolBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="winStatusBarVisibility" Type="System.Windows.Visibility" Scope="User">
<Value Profile="(Default)">Visible</Value>
</Setting>
<Setting Name="appLastImageFormat" Type="System.String" Scope="User">
<Value Profile="(Default)">PNG</Value>
</Setting>
<Setting Name="appConvertAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="appExtractAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="appIgnoreConversionErrors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="appLastDestination" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@ -1,56 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<!--
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
-->
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</asmv1:assembly>
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<!--
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
-->
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</asmv1:assembly>

View File

@ -1,43 +1,43 @@
namespace GARbro.GUI.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
this.SettingsLoaded += OnSettingsLoadedHandler;
}
void OnSettingsLoadedHandler (object sender, System.Configuration.SettingsLoadedEventArgs e)
{
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}
// do not restore in minimized state
if (Settings.Default.winState == System.Windows.WindowState.Minimized)
Settings.Default.winState = System.Windows.WindowState.Normal;
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}
namespace GARbro.GUI.Properties {
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
this.SettingsLoaded += OnSettingsLoadedHandler;
}
void OnSettingsLoadedHandler (object sender, System.Configuration.SettingsLoadedEventArgs e)
{
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}
// do not restore in minimized state
if (Settings.Default.winState == System.Windows.WindowState.Minimized)
Settings.Default.winState = System.Windows.WindowState.Normal;
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
// Add code to handle the SettingsSaving event here.
}
}
}

View File

@ -1,345 +1,345 @@
//! \file Shell.cs
//! \date Tue Aug 02 13:48:55 2011
//! \brief Win32 shell functions.
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace GARbro.Shell
{
/// <summary>
/// Wrapper around MoveFileEx WINAPI call.
/// </summary>
class File
{
[DllImport("kernel32.dll", EntryPoint="MoveFileExW", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool MoveFileEx (string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
[Flags]
public enum MoveFileFlags : uint
{
ReplaceExisting = 0x00000001,
CopyAllowed = 0x00000002,
DelayUntilReboot = 0x00000004,
WriteThrough = 0x00000008,
CreateHardlink = 0x00000010,
FailIfNotTrackable = 0x00000020
}
public static bool Rename (string szFrom, string szTo)
{
return MoveFileEx (szFrom, szTo, MoveFileFlags.ReplaceExisting);
}
public static int GetLastError ()
{
return Marshal.GetLastWin32Error();
}
/// <summary>
/// Possible flags for the SHFileOperation method.
/// </summary>
[Flags]
public enum FileOperationFlags : ushort
{
/// <summary>
/// Do not show a dialog during the process
/// </summary>
FOF_SILENT = 0x0004,
/// <summary>
/// Do not ask the user to confirm selection
/// </summary>
FOF_NOCONFIRMATION = 0x0010,
/// <summary>
/// Delete the file to the recycle bin. (Required flag to send a file to the bin
/// </summary>
FOF_ALLOWUNDO = 0x0040,
/// <summary>
/// Do not show the names of the files or folders that are being recycled.
/// </summary>
FOF_SIMPLEPROGRESS = 0x0100,
/// <summary>
/// Surpress errors, if any occur during the process.
/// </summary>
FOF_NOERRORUI = 0x0400,
/// <summary>
/// Warn if files are too big to fit in the recycle bin and will need
/// to be deleted completely.
/// </summary>
FOF_WANTNUKEWARNING = 0x4000,
}
/// <summary>
/// File Operation Function Type for SHFileOperation
/// </summary>
public enum FileOperationType : uint
{
/// <summary>
/// Move the objects
/// </summary>
FO_MOVE = 0x0001,
/// <summary>
/// Copy the objects
/// </summary>
FO_COPY = 0x0002,
/// <summary>
/// Delete (or recycle) the objects
/// </summary>
FO_DELETE = 0x0003,
/// <summary>
/// Rename the object(s)
/// </summary>
FO_RENAME = 0x0004,
}
/// <summary>
/// SHFILEOPSTRUCT for SHFileOperation from COM
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
private struct SHFILEOPSTRUCT
{
public IntPtr hwnd;
[MarshalAs(UnmanagedType.U4)]
public FileOperationType wFunc;
public string pFrom;
public string pTo;
public FileOperationFlags fFlags;
[MarshalAs(UnmanagedType.Bool)]
public bool fAnyOperationsAborted;
public IntPtr hNameMappings;
public string lpszProgressTitle;
}
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
private static extern int SHFileOperation (ref SHFILEOPSTRUCT FileOp);
/// <summary>
/// Send file to recycle bin
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
/// <param name="flags">FileOperationFlags to add in addition to FOF_ALLOWUNDO</param>
public static bool Delete (string path, FileOperationFlags flags)
{
var fs = new SHFILEOPSTRUCT
{
wFunc = FileOperationType.FO_DELETE,
pFrom = path + '\0' + '\0',
fFlags = FileOperationFlags.FOF_ALLOWUNDO | flags
};
return 0 == SHFileOperation (ref fs);
}
public static bool Delete (IEnumerable<string> file_list, FileOperationFlags flags)
{
var files = new StringBuilder();
foreach (var file in file_list)
{
files.Append (file);
files.Append ('\0');
}
if (0 == files.Length)
return false;
files.Append ('\0');
var fs = new SHFILEOPSTRUCT
{
wFunc = FileOperationType.FO_DELETE,
pFrom = files.ToString(),
fFlags = FileOperationFlags.FOF_ALLOWUNDO | flags
};
return 0 == SHFileOperation (ref fs);
}
public static bool Delete (IEnumerable<string> file_list)
{
return Delete (file_list, FileOperationFlags.FOF_WANTNUKEWARNING);
}
/// <summary>
/// Send file to recycle bin. Display dialog, display warning if files are too big to fit (FOF_WANTNUKEWARNING)
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
public static bool Delete (string path)
{
return Delete (path, FileOperationFlags.FOF_NOCONFIRMATION | FileOperationFlags.FOF_WANTNUKEWARNING);
}
/// <summary>
/// Send file silently to recycle bin. Surpress dialog, surpress errors, delete if too large.
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
public static bool MoveToRecycleBin (string path)
{
return Delete (path, FileOperationFlags.FOF_NOCONFIRMATION | FileOperationFlags.FOF_NOERRORUI | FileOperationFlags.FOF_SILENT);
}
}
public class TemporaryFile : IDisposable
{
private string m_name;
public string Name { get { return m_name; } }
public TemporaryFile ()
{
m_name = Path.GetRandomFileName();
}
public TemporaryFile (string filename)
{
m_name = filename;
}
public TemporaryFile (string path, string filename)
{
m_name = Path.Combine (path, filename);
}
#region IDisposable Members
bool disposed = false;
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (!disposed)
{
if (disposing)
{
System.IO.File.Delete (m_name);
}
disposed = true;
}
}
#endregion
};
/// <summary>
/// Wrapper around SHGetFileInfo WINAPI call.
/// </summary>
class FileInfo
{
[DllImport("shell32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SHGetFileInfo(
string pszPath, Int32 dwFileAttributes,
ref SHFILEINFO psfi, int cbFileInfo, int uFlags);
[DllImport("User32.dll")]
public static extern int DestroyIcon(IntPtr hIcon);
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public int iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
public SHFILEINFO(bool b)
{
hIcon = IntPtr.Zero;
iIcon = 0;
dwAttributes = 0;
szDisplayName = "";
szTypeName = "";
}
};
[Flags]
public enum SHGFI : uint
{
/// <summary>get icon</summary>
Icon = 0x000000100,
/// <summary>get display name</summary>
DisplayName = 0x000000200,
/// <summary>get type name</summary>
TypeName = 0x000000400,
/// <summary>get attributes</summary>
Attributes = 0x000000800,
/// <summary>get icon location</summary>
IconLocation = 0x000001000,
/// <summary>return exe type</summary>
ExeType = 0x000002000,
/// <summary>get system icon index</summary>
SysIconIndex = 0x000004000,
/// <summary>put a link overlay on icon</summary>
LinkOverlay = 0x000008000,
/// <summary>show icon in selected state</summary>
Selected = 0x000010000,
/// <summary>get only specified attributes</summary>
Attr_Specified = 0x000020000,
/// <summary>get large icon</summary>
LargeIcon = 0x000000000,
/// <summary>get small icon</summary>
SmallIcon = 0x000000001,
/// <summary>get open icon</summary>
OpenIcon = 0x000000002,
/// <summary>get shell size icon</summary>
ShellIconSize = 0x000000004,
/// <summary>pszPath is a pidl</summary>
PIDL = 0x000000008,
/// <summary>use passed dwFileAttribute</summary>
UseFileAttributes= 0x000000010,
/// <summary>apply the appropriate overlays</summary>
AddOverlays = 0x000000020,
/// <summary>Get the index of the overlay in the upper 8 bits of the iIcon</summary>
OverlayIndex = 0x000000040,
}
public static string GetTypeName (string filename)
{
SHFILEINFO info = new SHFILEINFO(true);
int szInfo = Marshal.SizeOf (info);
int result = (int)SHGetFileInfo (filename, 0, ref info, szInfo, (int)SHGFI.TypeName);
// If uFlags does not contain SHGFI_EXETYPE or SHGFI_SYSICONINDEX,
// the return value is nonzero if successful, or zero otherwise.
if (result != 0)
return info.szTypeName;
else
return string.Empty;
}
public static SHFILEINFO? GetInfo (string filename, SHGFI flags)
{
SHFILEINFO info = new SHFILEINFO(true);
int szInfo = Marshal.SizeOf (info);
int result = (int)SHGetFileInfo (filename, 0, ref info, szInfo, (int)flags);
return result != 0? new Nullable<SHFILEINFO> (info): null;
}
}
}
//! \file Shell.cs
//! \date Tue Aug 02 13:48:55 2011
//! \brief Win32 shell functions.
//
// Copyright (C) 2011 by poddav
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace GARbro.Shell
{
/// <summary>
/// Wrapper around MoveFileEx WINAPI call.
/// </summary>
class File
{
[DllImport("kernel32.dll", EntryPoint="MoveFileExW", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool MoveFileEx (string lpExistingFileName, string lpNewFileName, MoveFileFlags dwFlags);
[Flags]
public enum MoveFileFlags : uint
{
ReplaceExisting = 0x00000001,
CopyAllowed = 0x00000002,
DelayUntilReboot = 0x00000004,
WriteThrough = 0x00000008,
CreateHardlink = 0x00000010,
FailIfNotTrackable = 0x00000020
}
public static bool Rename (string szFrom, string szTo)
{
return MoveFileEx (szFrom, szTo, MoveFileFlags.ReplaceExisting);
}
public static int GetLastError ()
{
return Marshal.GetLastWin32Error();
}
/// <summary>
/// Possible flags for the SHFileOperation method.
/// </summary>
[Flags]
public enum FileOperationFlags : ushort
{
/// <summary>
/// Do not show a dialog during the process
/// </summary>
FOF_SILENT = 0x0004,
/// <summary>
/// Do not ask the user to confirm selection
/// </summary>
FOF_NOCONFIRMATION = 0x0010,
/// <summary>
/// Delete the file to the recycle bin. (Required flag to send a file to the bin
/// </summary>
FOF_ALLOWUNDO = 0x0040,
/// <summary>
/// Do not show the names of the files or folders that are being recycled.
/// </summary>
FOF_SIMPLEPROGRESS = 0x0100,
/// <summary>
/// Surpress errors, if any occur during the process.
/// </summary>
FOF_NOERRORUI = 0x0400,
/// <summary>
/// Warn if files are too big to fit in the recycle bin and will need
/// to be deleted completely.
/// </summary>
FOF_WANTNUKEWARNING = 0x4000,
}
/// <summary>
/// File Operation Function Type for SHFileOperation
/// </summary>
public enum FileOperationType : uint
{
/// <summary>
/// Move the objects
/// </summary>
FO_MOVE = 0x0001,
/// <summary>
/// Copy the objects
/// </summary>
FO_COPY = 0x0002,
/// <summary>
/// Delete (or recycle) the objects
/// </summary>
FO_DELETE = 0x0003,
/// <summary>
/// Rename the object(s)
/// </summary>
FO_RENAME = 0x0004,
}
/// <summary>
/// SHFILEOPSTRUCT for SHFileOperation from COM
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
private struct SHFILEOPSTRUCT
{
public IntPtr hwnd;
[MarshalAs(UnmanagedType.U4)]
public FileOperationType wFunc;
public string pFrom;
public string pTo;
public FileOperationFlags fFlags;
[MarshalAs(UnmanagedType.Bool)]
public bool fAnyOperationsAborted;
public IntPtr hNameMappings;
public string lpszProgressTitle;
}
[DllImport("shell32.dll", CharSet = CharSet.Auto)]
private static extern int SHFileOperation (ref SHFILEOPSTRUCT FileOp);
/// <summary>
/// Send file to recycle bin
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
/// <param name="flags">FileOperationFlags to add in addition to FOF_ALLOWUNDO</param>
public static bool Delete (string path, FileOperationFlags flags)
{
var fs = new SHFILEOPSTRUCT
{
wFunc = FileOperationType.FO_DELETE,
pFrom = path + '\0' + '\0',
fFlags = FileOperationFlags.FOF_ALLOWUNDO | flags
};
return 0 == SHFileOperation (ref fs);
}
public static bool Delete (IEnumerable<string> file_list, FileOperationFlags flags)
{
var files = new StringBuilder();
foreach (var file in file_list)
{
files.Append (file);
files.Append ('\0');
}
if (0 == files.Length)
return false;
files.Append ('\0');
var fs = new SHFILEOPSTRUCT
{
wFunc = FileOperationType.FO_DELETE,
pFrom = files.ToString(),
fFlags = FileOperationFlags.FOF_ALLOWUNDO | flags
};
return 0 == SHFileOperation (ref fs);
}
public static bool Delete (IEnumerable<string> file_list)
{
return Delete (file_list, FileOperationFlags.FOF_WANTNUKEWARNING);
}
/// <summary>
/// Send file to recycle bin. Display dialog, display warning if files are too big to fit (FOF_WANTNUKEWARNING)
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
public static bool Delete (string path)
{
return Delete (path, FileOperationFlags.FOF_NOCONFIRMATION | FileOperationFlags.FOF_WANTNUKEWARNING);
}
/// <summary>
/// Send file silently to recycle bin. Surpress dialog, surpress errors, delete if too large.
/// </summary>
/// <param name="path">Location of directory or file to recycle</param>
public static bool MoveToRecycleBin (string path)
{
return Delete (path, FileOperationFlags.FOF_NOCONFIRMATION | FileOperationFlags.FOF_NOERRORUI | FileOperationFlags.FOF_SILENT);
}
}
public class TemporaryFile : IDisposable
{
private string m_name;
public string Name { get { return m_name; } }
public TemporaryFile ()
{
m_name = Path.GetRandomFileName();
}
public TemporaryFile (string filename)
{
m_name = filename;
}
public TemporaryFile (string path, string filename)
{
m_name = Path.Combine (path, filename);
}
#region IDisposable Members
bool disposed = false;
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (!disposed)
{
if (disposing)
{
System.IO.File.Delete (m_name);
}
disposed = true;
}
}
#endregion
};
/// <summary>
/// Wrapper around SHGetFileInfo WINAPI call.
/// </summary>
class FileInfo
{
[DllImport("shell32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SHGetFileInfo(
string pszPath, Int32 dwFileAttributes,
ref SHFILEINFO psfi, int cbFileInfo, int uFlags);
[DllImport("User32.dll")]
public static extern int DestroyIcon(IntPtr hIcon);
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public int iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
public SHFILEINFO(bool b)
{
hIcon = IntPtr.Zero;
iIcon = 0;
dwAttributes = 0;
szDisplayName = "";
szTypeName = "";
}
};
[Flags]
public enum SHGFI : uint
{
/// <summary>get icon</summary>
Icon = 0x000000100,
/// <summary>get display name</summary>
DisplayName = 0x000000200,
/// <summary>get type name</summary>
TypeName = 0x000000400,
/// <summary>get attributes</summary>
Attributes = 0x000000800,
/// <summary>get icon location</summary>
IconLocation = 0x000001000,
/// <summary>return exe type</summary>
ExeType = 0x000002000,
/// <summary>get system icon index</summary>
SysIconIndex = 0x000004000,
/// <summary>put a link overlay on icon</summary>
LinkOverlay = 0x000008000,
/// <summary>show icon in selected state</summary>
Selected = 0x000010000,
/// <summary>get only specified attributes</summary>
Attr_Specified = 0x000020000,
/// <summary>get large icon</summary>
LargeIcon = 0x000000000,
/// <summary>get small icon</summary>
SmallIcon = 0x000000001,
/// <summary>get open icon</summary>
OpenIcon = 0x000000002,
/// <summary>get shell size icon</summary>
ShellIconSize = 0x000000004,
/// <summary>pszPath is a pidl</summary>
PIDL = 0x000000008,
/// <summary>use passed dwFileAttribute</summary>
UseFileAttributes= 0x000000010,
/// <summary>apply the appropriate overlays</summary>
AddOverlays = 0x000000020,
/// <summary>Get the index of the overlay in the upper 8 bits of the iIcon</summary>
OverlayIndex = 0x000000040,
}
public static string GetTypeName (string filename)
{
SHFILEINFO info = new SHFILEINFO(true);
int szInfo = Marshal.SizeOf (info);
int result = (int)SHGetFileInfo (filename, 0, ref info, szInfo, (int)SHGFI.TypeName);
// If uFlags does not contain SHGFI_EXETYPE or SHGFI_SYSICONINDEX,
// the return value is nonzero if successful, or zero otherwise.
if (result != 0)
return info.szTypeName;
else
return string.Empty;
}
public static SHFILEINFO? GetInfo (string filename, SHGFI flags)
{
SHFILEINFO info = new SHFILEINFO(true);
int szInfo = Marshal.SizeOf (info);
int result = (int)SHGetFileInfo (filename, 0, ref info, szInfo, (int)flags);
return result != 0? new Nullable<SHFILEINFO> (info): null;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,452 +1,452 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonCancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ButtonExtract" xml:space="preserve">
<value>Extract</value>
</data>
<data name="ButtonOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="CtxMenuClose" xml:space="preserve">
<value>_Close</value>
</data>
<data name="CtxMenuCopy" xml:space="preserve">
<value>Copy</value>
</data>
<data name="CtxMenuCreate" xml:space="preserve">
<value>Create archive...</value>
</data>
<data name="CtxMenuCut" xml:space="preserve">
<value>Cut</value>
</data>
<data name="CtxMenuDelete" xml:space="preserve">
<value>_Delete</value>
</data>
<data name="CtxMenuExplorer" xml:space="preserve">
<value>Browse in _Explorer</value>
</data>
<data name="CtxMenuExtract" xml:space="preserve">
<value>Extract</value>
</data>
<data name="CtxMenuOpen" xml:space="preserve">
<value>Open</value>
</data>
<data name="CtxMenuPaste" xml:space="preserve">
<value>Paste</value>
</data>
<data name="CtxMenuRefresh" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="CtxMenuRename" xml:space="preserve">
<value>_Rename</value>
</data>
<data name="CtxMenuSortBy" xml:space="preserve">
<value>Sort by</value>
</data>
<data name="CtxMenuSortByName" xml:space="preserve">
<value>Name</value>
</data>
<data name="CtxMenuSortBySize" xml:space="preserve">
<value>Size</value>
</data>
<data name="CtxMenuSortByType" xml:space="preserve">
<value>Type</value>
</data>
<data name="CtxMenuUnsorted" xml:space="preserve">
<value>Unsorted</value>
</data>
<data name="HeaderName" xml:space="preserve">
<value>Name</value>
</data>
<data name="HeaderSize" xml:space="preserve">
<value>Size</value>
</data>
<data name="HeaderType" xml:space="preserve">
<value>Type</value>
</data>
<data name="LabelArchiveFormat" xml:space="preserve">
<value>Archive format</value>
</data>
<data name="LabelArchiveName" xml:space="preserve">
<value>Archive name</value>
</data>
<data name="LabelArchiveOptions" xml:space="preserve">
<value>Archive options</value>
</data>
<data name="LabelExtractAllTo" xml:space="preserve">
<value>Extract files from {0} to</value>
</data>
<data name="LabelExtractFileTo" xml:space="preserve">
<value>Extract {0} to</value>
</data>
<data name="MenuAbout" xml:space="preserve">
<value>About Game Resource browser</value>
</data>
<data name="MsgDeletedItem" xml:space="preserve">
<value>Deleted {0}</value>
</data>
<data name="MsgDirectoryNotFound" xml:space="preserve">
<value>directory not found</value>
</data>
<data name="MsgEmptyArchive" xml:space="preserve">
<value>archive is empty</value>
</data>
<data name="MsgErrorExtracting" xml:space="preserve">
<value>Error extracting file</value>
</data>
<data name="MsgErrorOpening" xml:space="preserve">
<value>Error opening file</value>
</data>
<data name="MsgExtractComplete" xml:space="preserve">
<value>Extracted {0} into {1}</value>
</data>
<data name="MsgExtractedFiles1" xml:space="preserve">
<value>Extracted {0} file</value>
</data>
<data name="MsgExtractingArchive" xml:space="preserve">
<value>Extracting files from {0}</value>
</data>
<data name="MsgExtractingFile" xml:space="preserve">
<value>Extracting file from {0}</value>
</data>
<data name="MsgExtractingTo" xml:space="preserve">
<value>Extracting files from {0} to {1}</value>
</data>
<data name="MsgImageSize" xml:space="preserve">
<value>Image {0} x {1} x {2}bpp</value>
</data>
<data name="MsgNoFiles" xml:space="preserve">
<value>no files to extract</value>
</data>
<data name="MsgReady" xml:space="preserve">
<value>Ready</value>
</data>
<data name="MsgUnableInterpretImage" xml:space="preserve">
<value>unable to interpret image format</value>
</data>
<data name="MsgVersion" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="TextAboutBuiltin" xml:space="preserve">
<value>[builtin]</value>
</data>
<data name="TextAboutArchives" xml:space="preserve">
<value>Archives</value>
</data>
<data name="TextAboutImages" xml:space="preserve">
<value>Images</value>
</data>
<data name="TextAboutTitle" xml:space="preserve">
<value>About Game Resource browser</value>
</data>
<data name="TextAllFiles" xml:space="preserve">
<value>All Files</value>
</data>
<data name="TextAsIs" xml:space="preserve">
<value>as is</value>
</data>
<data name="TextChooseArchive" xml:space="preserve">
<value>Choose archive location</value>
</data>
<data name="TextChooseDestDir" xml:space="preserve">
<value>Choose destination directory</value>
</data>
<data name="TextCreateArchive" xml:space="preserve">
<value>Create archive</value>
</data>
<data name="TextCreateArchiveError" xml:space="preserve">
<value>Archive creation error</value>
</data>
<data name="Type_directory" xml:space="preserve">
<value>&lt;DIR&gt;</value>
</data>
<data name="TextEncoding" xml:space="preserve">
<value>Text encoding</value>
</data>
<data name="TextExtractImages" xml:space="preserve">
<value>Extract images</value>
</data>
<data name="TextExtractText" xml:space="preserve">
<value>Extract text</value>
</data>
<data name="TextExtractTitle" xml:space="preserve">
<value>Extract from archive</value>
</data>
<data name="TextParametersTitle" xml:space="preserve">
<value>Archive parameters</value>
</data>
<data name="TextSaveAs" xml:space="preserve">
<value>Save as</value>
</data>
<data name="TextSaveImagesAs" xml:space="preserve">
<value>Save images as</value>
</data>
<data name="TextTitle" xml:space="preserve">
<value>Game Resource browser</value>
</data>
<data name="TooltipBack" xml:space="preserve">
<value>Back</value>
</data>
<data name="TooltipForward" xml:space="preserve">
<value>Forward</value>
</data>
<data name="MsgOverwrite" xml:space="preserve">
<value>File {0}
already exists.
Overwrite?</value>
</data>
<data name="TextConfirmOverwrite" xml:space="preserve">
<value>Confirm overwrite</value>
</data>
<data name="MsgCreatingArchive" xml:space="preserve">
<value>Creating archive {0}</value>
</data>
<data name="MenuOpen" xml:space="preserve">
<value>Open...</value>
</data>
<data name="MenuRecent" xml:space="preserve">
<value>Recent files</value>
</data>
<data name="MsgChooseFiles" xml:space="preserve">
<value>Choose files to extract</value>
</data>
<data name="MenuExit" xml:space="preserve">
<value>E_xit</value>
</data>
<data name="MenuFile" xml:space="preserve">
<value>_File</value>
</data>
<data name="MenuHelp" xml:space="preserve">
<value>_Help</value>
</data>
<data name="MsgExtractedFiles2" xml:space="preserve">
<value>Extracted {0} files</value>
</data>
<data name="MsgFiles1" xml:space="preserve">
<value>{0} file</value>
</data>
<data name="MsgFiles2" xml:space="preserve">
<value>{0} files</value>
</data>
<data name="MsgConfirmDeleteFiles" xml:space="preserve">
<value>Are you sure you want to delete these files?</value>
</data>
<data name="TextDeleteFiles" xml:space="preserve">
<value>Delete files</value>
</data>
<data name="MsgDeletedItems1" xml:space="preserve">
<value>Deleted {0} file</value>
</data>
<data name="MsgDeletedItems2" xml:space="preserve">
<value>Deleted {0} files</value>
</data>
<data name="MenuFitWindow" xml:space="preserve">
<value>Fit preview _window to image</value>
</data>
<data name="MenuToggleMenuBar" xml:space="preserve">
<value>Show/hide main _menu bar</value>
</data>
<data name="MenuToggleStatusBar" xml:space="preserve">
<value>Show/hide _status bar</value>
</data>
<data name="MenuToggleToolBar" xml:space="preserve">
<value>Show/hide _toolbar</value>
</data>
<data name="MenuView" xml:space="preserve">
<value>_View</value>
</data>
<data name="CtxMenuConvert" xml:space="preserve">
<value>Convert multimedia...</value>
</data>
<data name="ButtonConvert" xml:space="preserve">
<value>Convert</value>
</data>
<data name="LabelDestinationFormat" xml:space="preserve">
<value>Choose destination format for images</value>
</data>
<data name="TextConvertMedia" xml:space="preserve">
<value>Media conversion</value>
</data>
<data name="MsgConvertingFile" xml:space="preserve">
<value>Converting file {0}</value>
</data>
<data name="TextMediaConvertError" xml:space="preserve">
<value>Multimedia conversion error</value>
</data>
<data name="LabelEncoding" xml:space="preserve">
<value>Encoding</value>
</data>
<data name="TextConvertAudio" xml:space="preserve">
<value>Convert audio to common format</value>
</data>
<data name="TextExtractAudio" xml:space="preserve">
<value>Extract audio</value>
</data>
<data name="TooltipAudioFormats" xml:space="preserve">
<value>Either WAV, MP3 or OGG</value>
</data>
<data name="TextAboutAudio" xml:space="preserve">
<value>Audio</value>
</data>
<data name="TextAboutLicense" xml:space="preserve">
<value>License</value>
</data>
<data name="MsgUnableInterpretAudio" xml:space="preserve">
<value>unable to interpret audio format</value>
</data>
<data name="MsgNoMediaFiles" xml:space="preserve">
<value>No media files selected.</value>
</data>
<data name="TextAudioConversion" xml:space="preserve">
<value>Audio will be converted to either WAV, MP3 or OGG.</value>
</data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Skip incovertible files.</value>
</data>
<data name="MsgNoMatching" xml:space="preserve">
<value>No entries matching "{0}"</value>
</data>
<data name="MsgSelectedFiles1" xml:space="preserve">
<value>{0} file added to selection</value>
</data>
<data name="MsgSelectedFiles2" xml:space="preserve">
<value>{0} files added to selection</value>
</data>
<data name="LabelEnterMask" xml:space="preserve">
<value>Enter wildcard mask</value>
</data>
<data name="TextSelectFiles" xml:space="preserve">
<value>Select files</value>
</data>
<data name="TextErrorExtracting" xml:space="preserve">
<value>Error occured while extracting file
{0}
{1}</value>
</data>
<data name="CtxMenuFileType" xml:space="preserve">
<value>Assign file type</value>
</data>
<data name="Type_NONE" xml:space="preserve">
<value>none</value>
</data>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonCancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ButtonExtract" xml:space="preserve">
<value>Extract</value>
</data>
<data name="ButtonOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="CtxMenuClose" xml:space="preserve">
<value>_Close</value>
</data>
<data name="CtxMenuCopy" xml:space="preserve">
<value>Copy</value>
</data>
<data name="CtxMenuCreate" xml:space="preserve">
<value>Create archive...</value>
</data>
<data name="CtxMenuCut" xml:space="preserve">
<value>Cut</value>
</data>
<data name="CtxMenuDelete" xml:space="preserve">
<value>_Delete</value>
</data>
<data name="CtxMenuExplorer" xml:space="preserve">
<value>Browse in _Explorer</value>
</data>
<data name="CtxMenuExtract" xml:space="preserve">
<value>Extract</value>
</data>
<data name="CtxMenuOpen" xml:space="preserve">
<value>Open</value>
</data>
<data name="CtxMenuPaste" xml:space="preserve">
<value>Paste</value>
</data>
<data name="CtxMenuRefresh" xml:space="preserve">
<value>Refresh</value>
</data>
<data name="CtxMenuRename" xml:space="preserve">
<value>_Rename</value>
</data>
<data name="CtxMenuSortBy" xml:space="preserve">
<value>Sort by</value>
</data>
<data name="CtxMenuSortByName" xml:space="preserve">
<value>Name</value>
</data>
<data name="CtxMenuSortBySize" xml:space="preserve">
<value>Size</value>
</data>
<data name="CtxMenuSortByType" xml:space="preserve">
<value>Type</value>
</data>
<data name="CtxMenuUnsorted" xml:space="preserve">
<value>Unsorted</value>
</data>
<data name="HeaderName" xml:space="preserve">
<value>Name</value>
</data>
<data name="HeaderSize" xml:space="preserve">
<value>Size</value>
</data>
<data name="HeaderType" xml:space="preserve">
<value>Type</value>
</data>
<data name="LabelArchiveFormat" xml:space="preserve">
<value>Archive format</value>
</data>
<data name="LabelArchiveName" xml:space="preserve">
<value>Archive name</value>
</data>
<data name="LabelArchiveOptions" xml:space="preserve">
<value>Archive options</value>
</data>
<data name="LabelExtractAllTo" xml:space="preserve">
<value>Extract files from {0} to</value>
</data>
<data name="LabelExtractFileTo" xml:space="preserve">
<value>Extract {0} to</value>
</data>
<data name="MenuAbout" xml:space="preserve">
<value>About Game Resource browser</value>
</data>
<data name="MsgDeletedItem" xml:space="preserve">
<value>Deleted {0}</value>
</data>
<data name="MsgDirectoryNotFound" xml:space="preserve">
<value>directory not found</value>
</data>
<data name="MsgEmptyArchive" xml:space="preserve">
<value>archive is empty</value>
</data>
<data name="MsgErrorExtracting" xml:space="preserve">
<value>Error extracting file</value>
</data>
<data name="MsgErrorOpening" xml:space="preserve">
<value>Error opening file</value>
</data>
<data name="MsgExtractComplete" xml:space="preserve">
<value>Extracted {0} into {1}</value>
</data>
<data name="MsgExtractedFiles1" xml:space="preserve">
<value>Extracted {0} file</value>
</data>
<data name="MsgExtractingArchive" xml:space="preserve">
<value>Extracting files from {0}</value>
</data>
<data name="MsgExtractingFile" xml:space="preserve">
<value>Extracting file from {0}</value>
</data>
<data name="MsgExtractingTo" xml:space="preserve">
<value>Extracting files from {0} to {1}</value>
</data>
<data name="MsgImageSize" xml:space="preserve">
<value>Image {0} x {1} x {2}bpp</value>
</data>
<data name="MsgNoFiles" xml:space="preserve">
<value>no files to extract</value>
</data>
<data name="MsgReady" xml:space="preserve">
<value>Ready</value>
</data>
<data name="MsgUnableInterpretImage" xml:space="preserve">
<value>unable to interpret image format</value>
</data>
<data name="MsgVersion" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="TextAboutBuiltin" xml:space="preserve">
<value>[builtin]</value>
</data>
<data name="TextAboutArchives" xml:space="preserve">
<value>Archives</value>
</data>
<data name="TextAboutImages" xml:space="preserve">
<value>Images</value>
</data>
<data name="TextAboutTitle" xml:space="preserve">
<value>About Game Resource browser</value>
</data>
<data name="TextAllFiles" xml:space="preserve">
<value>All Files</value>
</data>
<data name="TextAsIs" xml:space="preserve">
<value>as is</value>
</data>
<data name="TextChooseArchive" xml:space="preserve">
<value>Choose archive location</value>
</data>
<data name="TextChooseDestDir" xml:space="preserve">
<value>Choose destination directory</value>
</data>
<data name="TextCreateArchive" xml:space="preserve">
<value>Create archive</value>
</data>
<data name="TextCreateArchiveError" xml:space="preserve">
<value>Archive creation error</value>
</data>
<data name="Type_directory" xml:space="preserve">
<value>&lt;DIR&gt;</value>
</data>
<data name="TextEncoding" xml:space="preserve">
<value>Text encoding</value>
</data>
<data name="TextExtractImages" xml:space="preserve">
<value>Extract images</value>
</data>
<data name="TextExtractText" xml:space="preserve">
<value>Extract text</value>
</data>
<data name="TextExtractTitle" xml:space="preserve">
<value>Extract from archive</value>
</data>
<data name="TextParametersTitle" xml:space="preserve">
<value>Archive parameters</value>
</data>
<data name="TextSaveAs" xml:space="preserve">
<value>Save as</value>
</data>
<data name="TextSaveImagesAs" xml:space="preserve">
<value>Save images as</value>
</data>
<data name="TextTitle" xml:space="preserve">
<value>Game Resource browser</value>
</data>
<data name="TooltipBack" xml:space="preserve">
<value>Back</value>
</data>
<data name="TooltipForward" xml:space="preserve">
<value>Forward</value>
</data>
<data name="MsgOverwrite" xml:space="preserve">
<value>File {0}
already exists.
Overwrite?</value>
</data>
<data name="TextConfirmOverwrite" xml:space="preserve">
<value>Confirm overwrite</value>
</data>
<data name="MsgCreatingArchive" xml:space="preserve">
<value>Creating archive {0}</value>
</data>
<data name="MenuOpen" xml:space="preserve">
<value>Open...</value>
</data>
<data name="MenuRecent" xml:space="preserve">
<value>Recent files</value>
</data>
<data name="MsgChooseFiles" xml:space="preserve">
<value>Choose files to extract</value>
</data>
<data name="MenuExit" xml:space="preserve">
<value>E_xit</value>
</data>
<data name="MenuFile" xml:space="preserve">
<value>_File</value>
</data>
<data name="MenuHelp" xml:space="preserve">
<value>_Help</value>
</data>
<data name="MsgExtractedFiles2" xml:space="preserve">
<value>Extracted {0} files</value>
</data>
<data name="MsgFiles1" xml:space="preserve">
<value>{0} file</value>
</data>
<data name="MsgFiles2" xml:space="preserve">
<value>{0} files</value>
</data>
<data name="MsgConfirmDeleteFiles" xml:space="preserve">
<value>Are you sure you want to delete these files?</value>
</data>
<data name="TextDeleteFiles" xml:space="preserve">
<value>Delete files</value>
</data>
<data name="MsgDeletedItems1" xml:space="preserve">
<value>Deleted {0} file</value>
</data>
<data name="MsgDeletedItems2" xml:space="preserve">
<value>Deleted {0} files</value>
</data>
<data name="MenuFitWindow" xml:space="preserve">
<value>Fit preview _window to image</value>
</data>
<data name="MenuToggleMenuBar" xml:space="preserve">
<value>Show/hide main _menu bar</value>
</data>
<data name="MenuToggleStatusBar" xml:space="preserve">
<value>Show/hide _status bar</value>
</data>
<data name="MenuToggleToolBar" xml:space="preserve">
<value>Show/hide _toolbar</value>
</data>
<data name="MenuView" xml:space="preserve">
<value>_View</value>
</data>
<data name="CtxMenuConvert" xml:space="preserve">
<value>Convert multimedia...</value>
</data>
<data name="ButtonConvert" xml:space="preserve">
<value>Convert</value>
</data>
<data name="LabelDestinationFormat" xml:space="preserve">
<value>Choose destination format for images</value>
</data>
<data name="TextConvertMedia" xml:space="preserve">
<value>Media conversion</value>
</data>
<data name="MsgConvertingFile" xml:space="preserve">
<value>Converting file {0}</value>
</data>
<data name="TextMediaConvertError" xml:space="preserve">
<value>Multimedia conversion error</value>
</data>
<data name="LabelEncoding" xml:space="preserve">
<value>Encoding</value>
</data>
<data name="TextConvertAudio" xml:space="preserve">
<value>Convert audio to common format</value>
</data>
<data name="TextExtractAudio" xml:space="preserve">
<value>Extract audio</value>
</data>
<data name="TooltipAudioFormats" xml:space="preserve">
<value>Either WAV, MP3 or OGG</value>
</data>
<data name="TextAboutAudio" xml:space="preserve">
<value>Audio</value>
</data>
<data name="TextAboutLicense" xml:space="preserve">
<value>License</value>
</data>
<data name="MsgUnableInterpretAudio" xml:space="preserve">
<value>unable to interpret audio format</value>
</data>
<data name="MsgNoMediaFiles" xml:space="preserve">
<value>No media files selected.</value>
</data>
<data name="TextAudioConversion" xml:space="preserve">
<value>Audio will be converted to either WAV, MP3 or OGG.</value>
</data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Skip incovertible files.</value>
</data>
<data name="MsgNoMatching" xml:space="preserve">
<value>No entries matching "{0}"</value>
</data>
<data name="MsgSelectedFiles1" xml:space="preserve">
<value>{0} file added to selection</value>
</data>
<data name="MsgSelectedFiles2" xml:space="preserve">
<value>{0} files added to selection</value>
</data>
<data name="LabelEnterMask" xml:space="preserve">
<value>Enter wildcard mask</value>
</data>
<data name="TextSelectFiles" xml:space="preserve">
<value>Select files</value>
</data>
<data name="TextErrorExtracting" xml:space="preserve">
<value>Error occured while extracting file
{0}
{1}</value>
</data>
<data name="CtxMenuFileType" xml:space="preserve">
<value>Assign file type</value>
</data>
<data name="Type_NONE" xml:space="preserve">
<value>none</value>
</data>
</root>

View File

@ -1,473 +1,473 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonCancel" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="ButtonExtract" xml:space="preserve">
<value>Извлечь</value>
</data>
<data name="CtxMenuClose" xml:space="preserve">
<value>_Закрыть</value>
</data>
<data name="CtxMenuCopy" xml:space="preserve">
<value>Копировать</value>
</data>
<data name="CtxMenuCreate" xml:space="preserve">
<value>Создать архив...</value>
</data>
<data name="CtxMenuCut" xml:space="preserve">
<value>Вырезать</value>
</data>
<data name="CtxMenuDelete" xml:space="preserve">
<value>Удалить</value>
</data>
<data name="CtxMenuExplorer" xml:space="preserve">
<value>Просмотр в Explorer</value>
</data>
<data name="CtxMenuExtract" xml:space="preserve">
<value>Извлечь</value>
</data>
<data name="CtxMenuOpen" xml:space="preserve">
<value>Открыть</value>
</data>
<data name="CtxMenuPaste" xml:space="preserve">
<value>Вставить</value>
</data>
<data name="CtxMenuRefresh" xml:space="preserve">
<value>Обновить</value>
</data>
<data name="CtxMenuRename" xml:space="preserve">
<value>Переименовать</value>
</data>
<data name="CtxMenuSortBy" xml:space="preserve">
<value>Сортировка</value>
</data>
<data name="CtxMenuSortByName" xml:space="preserve">
<value>по имени</value>
</data>
<data name="CtxMenuSortBySize" xml:space="preserve">
<value>по размеру</value>
</data>
<data name="CtxMenuSortByType" xml:space="preserve">
<value>по типу</value>
</data>
<data name="CtxMenuUnsorted" xml:space="preserve">
<value>не сортировать</value>
</data>
<data name="HeaderName" xml:space="preserve">
<value>Имя</value>
</data>
<data name="HeaderSize" xml:space="preserve">
<value>Размер</value>
</data>
<data name="HeaderType" xml:space="preserve">
<value>Тип</value>
</data>
<data name="LabelArchiveFormat" xml:space="preserve">
<value>Формат архива</value>
</data>
<data name="LabelArchiveName" xml:space="preserve">
<value>Имя архива</value>
</data>
<data name="LabelArchiveOptions" xml:space="preserve">
<value>Настройки архивирования</value>
</data>
<data name="LabelExtractAllTo" xml:space="preserve">
<value>Извлечь файлы из {0} в</value>
</data>
<data name="LabelExtractFileTo" xml:space="preserve">
<value>Извлечь {0} в</value>
</data>
<data name="MenuAbout" xml:space="preserve">
<value>О программе</value>
</data>
<data name="MsgDeletedItem" xml:space="preserve">
<value>Удалён файл {0}</value>
</data>
<data name="MsgDirectoryNotFound" xml:space="preserve">
<value>каталог не найден</value>
</data>
<data name="MsgEmptyArchive" xml:space="preserve">
<value>архив пуст</value>
</data>
<data name="MsgErrorExtracting" xml:space="preserve">
<value>Ошибка извлечения файла</value>
</data>
<data name="MsgErrorOpening" xml:space="preserve">
<value>Ошибка открытия файла</value>
</data>
<data name="MsgExtractComplete" xml:space="preserve">
<value>{0} извлечён в {1}</value>
</data>
<data name="MsgExtractingArchive" xml:space="preserve">
<value>Извлекаются файлы из {0}</value>
</data>
<data name="MsgExtractingFile" xml:space="preserve">
<value>Файл извлекается из {0}</value>
</data>
<data name="MsgExtractingTo" xml:space="preserve">
<value>Извлекаются файлы из {0} в {1}</value>
</data>
<data name="MsgImageSize" xml:space="preserve">
<value>Изображение {0} x {1} x {2}bpp</value>
</data>
<data name="MsgNoFiles" xml:space="preserve">
<value>отсутствуют файлы, удовлетворяющие выбранным критериям</value>
</data>
<data name="MsgReady" xml:space="preserve">
<value>Готов</value>
</data>
<data name="MsgUnableInterpretImage" xml:space="preserve">
<value>не удалось интерпретировать формат изображения</value>
</data>
<data name="MsgVersion" xml:space="preserve">
<value>Версия {0}</value>
</data>
<data name="TextAboutBuiltin" xml:space="preserve">
<value>[встроен]</value>
</data>
<data name="TextAboutArchives" xml:space="preserve">
<value>Архивы</value>
</data>
<data name="TextAboutImages" xml:space="preserve">
<value>Изображения</value>
</data>
<data name="TextAboutTitle" xml:space="preserve">
<value>Об обозревателе игровых ресурсов</value>
</data>
<data name="TextAllFiles" xml:space="preserve">
<value>Все файлы</value>
</data>
<data name="TextAsIs" xml:space="preserve">
<value>исходном</value>
</data>
<data name="TextChooseArchive" xml:space="preserve">
<value>Выберите месторасположение архива</value>
</data>
<data name="TextChooseDestDir" xml:space="preserve">
<value>Выберите место извлечения</value>
</data>
<data name="TextCreateArchive" xml:space="preserve">
<value>Создать архив</value>
</data>
<data name="TextCreateArchiveError" xml:space="preserve">
<value>Ошибка при создании архива</value>
</data>
<data name="TextEncoding" xml:space="preserve">
<value>Кодировка текста</value>
</data>
<data name="TextExtractImages" xml:space="preserve">
<value>Извлекать изображения</value>
</data>
<data name="TextExtractText" xml:space="preserve">
<value>Извлекать текст</value>
</data>
<data name="TextExtractTitle" xml:space="preserve">
<value>Извлечь из архива</value>
</data>
<data name="TextOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="TextParametersTitle" xml:space="preserve">
<value>Параметры архива</value>
</data>
<data name="TextSaveAs" xml:space="preserve">
<value>Сохранить в формате</value>
</data>
<data name="TextSaveImagesAs" xml:space="preserve">
<value>Сохранить в формате</value>
</data>
<data name="TextTitle" xml:space="preserve">
<value>Обозреватель игровых ресурсов</value>
</data>
<data name="TooltipBack" xml:space="preserve">
<value>Назад</value>
</data>
<data name="TooltipForward" xml:space="preserve">
<value>Вперёд</value>
</data>
<data name="MsgOverwrite" xml:space="preserve">
<value>Файл под именем '{0}'
уже существует.
Перезаписать?</value>
</data>
<data name="TextConfirmOverwrite" xml:space="preserve">
<value>Подтвердите перезапись</value>
</data>
<data name="MsgCreatingArchive" xml:space="preserve">
<value>Создание архива {0}</value>
</data>
<data name="Type_archive" xml:space="preserve">
<value>архив</value>
</data>
<data name="Type_image" xml:space="preserve">
<value>изображение</value>
</data>
<data name="Type_script" xml:space="preserve">
<value>сценарий</value>
</data>
<data name="MenuOpen" xml:space="preserve">
<value>Открыть...</value>
</data>
<data name="MenuRecent" xml:space="preserve">
<value>Недавние файлы</value>
</data>
<data name="MsgChooseFiles" xml:space="preserve">
<value>Выберите файлы для извлечения</value>
</data>
<data name="MenuExit" xml:space="preserve">
<value>Выход</value>
</data>
<data name="MenuFile" xml:space="preserve">
<value>_Файл</value>
</data>
<data name="MenuHelp" xml:space="preserve">
<value>_Справка</value>
</data>
<data name="MsgExtractedFiles1" xml:space="preserve">
<value>Извлечён {0} файл</value>
</data>
<data name="MsgExtractedFiles2" xml:space="preserve">
<value>Извлечено {0} файла</value>
</data>
<data name="MsgExtractedFiles3" xml:space="preserve">
<value>Извлечено {0} файлов</value>
</data>
<data name="MsgFiles1" xml:space="preserve">
<value>{0} файл</value>
</data>
<data name="MsgFiles2" xml:space="preserve">
<value>{0} файла</value>
</data>
<data name="MsgFiles3" xml:space="preserve">
<value>{0} файлов</value>
</data>
<data name="MsgConfirmDeleteFiles" xml:space="preserve">
<value>Вы действительно хотите удалить эти файлы?</value>
</data>
<data name="TextDeleteFiles" xml:space="preserve">
<value>Удалить файлы</value>
</data>
<data name="MsgDeletedItems1" xml:space="preserve">
<value>Удалён {0} файл</value>
</data>
<data name="MsgDeletedItems2" xml:space="preserve">
<value>Удалено {0} файла</value>
</data>
<data name="MsgDeletedItems3" xml:space="preserve">
<value>Удалено {0} файлов</value>
</data>
<data name="MenuFitWindow" xml:space="preserve">
<value>Подогнать размер окна под изображение</value>
</data>
<data name="MenuToggleMenuBar" xml:space="preserve">
<value>Вкл/выкл главное меню</value>
</data>
<data name="MenuToggleStatusBar" xml:space="preserve">
<value>Вкл/выкл полосу статуса</value>
</data>
<data name="MenuToggleToolBar" xml:space="preserve">
<value>Вкл/выкл панель инструментов</value>
</data>
<data name="MenuView" xml:space="preserve">
<value>Просмотр</value>
</data>
<data name="CtxMenuConvert" xml:space="preserve">
<value>Конверсия мультимедиа...</value>
</data>
<data name="ButtonConvert" xml:space="preserve">
<value>Преобразовать</value>
</data>
<data name="LabelDestinationFormat" xml:space="preserve">
<value>Формат преобразования изображений</value>
</data>
<data name="TextConvertMedia" xml:space="preserve">
<value>Преобразование мультимедиа</value>
</data>
<data name="MsgConvertingFile" xml:space="preserve">
<value>Преобразование файла {0}</value>
</data>
<data name="TextMediaConvertError" xml:space="preserve">
<value>Ошибка конверсии мультимедиа</value>
</data>
<data name="LabelEncoding" xml:space="preserve">
<value>Кодировка</value>
</data>
<data name="TextConvertAudio" xml:space="preserve">
<value>Преобразовывать аудио в стандартный формат</value>
</data>
<data name="TextExtractAudio" xml:space="preserve">
<value>Извлекать аудио</value>
</data>
<data name="TooltipAudioFormats" xml:space="preserve">
<value>WAV, MP3, либо OGG</value>
</data>
<data name="TextAboutAudio" xml:space="preserve">
<value>Аудио</value>
</data>
<data name="TextAboutLicense" xml:space="preserve">
<value>Лицензия</value>
</data>
<data name="Type_audio" xml:space="preserve">
<value>звук</value>
</data>
<data name="MsgUnableInterpretAudio" xml:space="preserve">
<value>не удалось интерпретировать формат аудио</value>
</data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Пропускать файлы, не поддавшиеся конверсии.</value>
</data>
<data name="MsgNoMediaFiles" xml:space="preserve">
<value>Среди выбранных файлов нет мультимедиа.</value>
</data>
<data name="TextAudioConversion" xml:space="preserve">
<value>Аудио-файлы будут преобразованы в WAV, MP3 или OGG.</value>
</data>
<data name="MsgNoMatching" xml:space="preserve">
<value>Нет файлов, подходящих под маску "{0}"</value>
</data>
<data name="MsgSelectedFiles1" xml:space="preserve">
<value>{0} файл добавлен к выбранным</value>
</data>
<data name="MsgSelectedFiles2" xml:space="preserve">
<value>{0} файла добавлено к выбранным</value>
</data>
<data name="MsgSelectedFiles3" xml:space="preserve">
<value>{0} файлов добавлено к выбранным</value>
</data>
<data name="LabelEnterMask" xml:space="preserve">
<value>Маска для имён файлов</value>
</data>
<data name="TextSelectFiles" xml:space="preserve">
<value>Выбрать файлы</value>
</data>
<data name="TextErrorExtracting" xml:space="preserve">
<value>Произошёл сбой во время извлечения файла
{0}
{1}</value>
</data>
<data name="CtxMenuFileType" xml:space="preserve">
<value>Задать тип файла</value>
</data>
<data name="Type_NONE" xml:space="preserve">
<value>без типа</value>
</data>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonCancel" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="ButtonExtract" xml:space="preserve">
<value>Извлечь</value>
</data>
<data name="CtxMenuClose" xml:space="preserve">
<value>_Закрыть</value>
</data>
<data name="CtxMenuCopy" xml:space="preserve">
<value>Копировать</value>
</data>
<data name="CtxMenuCreate" xml:space="preserve">
<value>Создать архив...</value>
</data>
<data name="CtxMenuCut" xml:space="preserve">
<value>Вырезать</value>
</data>
<data name="CtxMenuDelete" xml:space="preserve">
<value>Удалить</value>
</data>
<data name="CtxMenuExplorer" xml:space="preserve">
<value>Просмотр в Explorer</value>
</data>
<data name="CtxMenuExtract" xml:space="preserve">
<value>Извлечь</value>
</data>
<data name="CtxMenuOpen" xml:space="preserve">
<value>Открыть</value>
</data>
<data name="CtxMenuPaste" xml:space="preserve">
<value>Вставить</value>
</data>
<data name="CtxMenuRefresh" xml:space="preserve">
<value>Обновить</value>
</data>
<data name="CtxMenuRename" xml:space="preserve">
<value>Переименовать</value>
</data>
<data name="CtxMenuSortBy" xml:space="preserve">
<value>Сортировка</value>
</data>
<data name="CtxMenuSortByName" xml:space="preserve">
<value>по имени</value>
</data>
<data name="CtxMenuSortBySize" xml:space="preserve">
<value>по размеру</value>
</data>
<data name="CtxMenuSortByType" xml:space="preserve">
<value>по типу</value>
</data>
<data name="CtxMenuUnsorted" xml:space="preserve">
<value>не сортировать</value>
</data>
<data name="HeaderName" xml:space="preserve">
<value>Имя</value>
</data>
<data name="HeaderSize" xml:space="preserve">
<value>Размер</value>
</data>
<data name="HeaderType" xml:space="preserve">
<value>Тип</value>
</data>
<data name="LabelArchiveFormat" xml:space="preserve">
<value>Формат архива</value>
</data>
<data name="LabelArchiveName" xml:space="preserve">
<value>Имя архива</value>
</data>
<data name="LabelArchiveOptions" xml:space="preserve">
<value>Настройки архивирования</value>
</data>
<data name="LabelExtractAllTo" xml:space="preserve">
<value>Извлечь файлы из {0} в</value>
</data>
<data name="LabelExtractFileTo" xml:space="preserve">
<value>Извлечь {0} в</value>
</data>
<data name="MenuAbout" xml:space="preserve">
<value>О программе</value>
</data>
<data name="MsgDeletedItem" xml:space="preserve">
<value>Удалён файл {0}</value>
</data>
<data name="MsgDirectoryNotFound" xml:space="preserve">
<value>каталог не найден</value>
</data>
<data name="MsgEmptyArchive" xml:space="preserve">
<value>архив пуст</value>
</data>
<data name="MsgErrorExtracting" xml:space="preserve">
<value>Ошибка извлечения файла</value>
</data>
<data name="MsgErrorOpening" xml:space="preserve">
<value>Ошибка открытия файла</value>
</data>
<data name="MsgExtractComplete" xml:space="preserve">
<value>{0} извлечён в {1}</value>
</data>
<data name="MsgExtractingArchive" xml:space="preserve">
<value>Извлекаются файлы из {0}</value>
</data>
<data name="MsgExtractingFile" xml:space="preserve">
<value>Файл извлекается из {0}</value>
</data>
<data name="MsgExtractingTo" xml:space="preserve">
<value>Извлекаются файлы из {0} в {1}</value>
</data>
<data name="MsgImageSize" xml:space="preserve">
<value>Изображение {0} x {1} x {2}bpp</value>
</data>
<data name="MsgNoFiles" xml:space="preserve">
<value>отсутствуют файлы, удовлетворяющие выбранным критериям</value>
</data>
<data name="MsgReady" xml:space="preserve">
<value>Готов</value>
</data>
<data name="MsgUnableInterpretImage" xml:space="preserve">
<value>не удалось интерпретировать формат изображения</value>
</data>
<data name="MsgVersion" xml:space="preserve">
<value>Версия {0}</value>
</data>
<data name="TextAboutBuiltin" xml:space="preserve">
<value>[встроен]</value>
</data>
<data name="TextAboutArchives" xml:space="preserve">
<value>Архивы</value>
</data>
<data name="TextAboutImages" xml:space="preserve">
<value>Изображения</value>
</data>
<data name="TextAboutTitle" xml:space="preserve">
<value>Об обозревателе игровых ресурсов</value>
</data>
<data name="TextAllFiles" xml:space="preserve">
<value>Все файлы</value>
</data>
<data name="TextAsIs" xml:space="preserve">
<value>исходном</value>
</data>
<data name="TextChooseArchive" xml:space="preserve">
<value>Выберите месторасположение архива</value>
</data>
<data name="TextChooseDestDir" xml:space="preserve">
<value>Выберите место извлечения</value>
</data>
<data name="TextCreateArchive" xml:space="preserve">
<value>Создать архив</value>
</data>
<data name="TextCreateArchiveError" xml:space="preserve">
<value>Ошибка при создании архива</value>
</data>
<data name="TextEncoding" xml:space="preserve">
<value>Кодировка текста</value>
</data>
<data name="TextExtractImages" xml:space="preserve">
<value>Извлекать изображения</value>
</data>
<data name="TextExtractText" xml:space="preserve">
<value>Извлекать текст</value>
</data>
<data name="TextExtractTitle" xml:space="preserve">
<value>Извлечь из архива</value>
</data>
<data name="TextOK" xml:space="preserve">
<value>OK</value>
</data>
<data name="TextParametersTitle" xml:space="preserve">
<value>Параметры архива</value>
</data>
<data name="TextSaveAs" xml:space="preserve">
<value>Сохранить в формате</value>
</data>
<data name="TextSaveImagesAs" xml:space="preserve">
<value>Сохранить в формате</value>
</data>
<data name="TextTitle" xml:space="preserve">
<value>Обозреватель игровых ресурсов</value>
</data>
<data name="TooltipBack" xml:space="preserve">
<value>Назад</value>
</data>
<data name="TooltipForward" xml:space="preserve">
<value>Вперёд</value>
</data>
<data name="MsgOverwrite" xml:space="preserve">
<value>Файл под именем '{0}'
уже существует.
Перезаписать?</value>
</data>
<data name="TextConfirmOverwrite" xml:space="preserve">
<value>Подтвердите перезапись</value>
</data>
<data name="MsgCreatingArchive" xml:space="preserve">
<value>Создание архива {0}</value>
</data>
<data name="Type_archive" xml:space="preserve">
<value>архив</value>
</data>
<data name="Type_image" xml:space="preserve">
<value>изображение</value>
</data>
<data name="Type_script" xml:space="preserve">
<value>сценарий</value>
</data>
<data name="MenuOpen" xml:space="preserve">
<value>Открыть...</value>
</data>
<data name="MenuRecent" xml:space="preserve">
<value>Недавние файлы</value>
</data>
<data name="MsgChooseFiles" xml:space="preserve">
<value>Выберите файлы для извлечения</value>
</data>
<data name="MenuExit" xml:space="preserve">
<value>Выход</value>
</data>
<data name="MenuFile" xml:space="preserve">
<value>_Файл</value>
</data>
<data name="MenuHelp" xml:space="preserve">
<value>_Справка</value>
</data>
<data name="MsgExtractedFiles1" xml:space="preserve">
<value>Извлечён {0} файл</value>
</data>
<data name="MsgExtractedFiles2" xml:space="preserve">
<value>Извлечено {0} файла</value>
</data>
<data name="MsgExtractedFiles3" xml:space="preserve">
<value>Извлечено {0} файлов</value>
</data>
<data name="MsgFiles1" xml:space="preserve">
<value>{0} файл</value>
</data>
<data name="MsgFiles2" xml:space="preserve">
<value>{0} файла</value>
</data>
<data name="MsgFiles3" xml:space="preserve">
<value>{0} файлов</value>
</data>
<data name="MsgConfirmDeleteFiles" xml:space="preserve">
<value>Вы действительно хотите удалить эти файлы?</value>
</data>
<data name="TextDeleteFiles" xml:space="preserve">
<value>Удалить файлы</value>
</data>
<data name="MsgDeletedItems1" xml:space="preserve">
<value>Удалён {0} файл</value>
</data>
<data name="MsgDeletedItems2" xml:space="preserve">
<value>Удалено {0} файла</value>
</data>
<data name="MsgDeletedItems3" xml:space="preserve">
<value>Удалено {0} файлов</value>
</data>
<data name="MenuFitWindow" xml:space="preserve">
<value>Подогнать размер окна под изображение</value>
</data>
<data name="MenuToggleMenuBar" xml:space="preserve">
<value>Вкл/выкл главное меню</value>
</data>
<data name="MenuToggleStatusBar" xml:space="preserve">
<value>Вкл/выкл полосу статуса</value>
</data>
<data name="MenuToggleToolBar" xml:space="preserve">
<value>Вкл/выкл панель инструментов</value>
</data>
<data name="MenuView" xml:space="preserve">
<value>Просмотр</value>
</data>
<data name="CtxMenuConvert" xml:space="preserve">
<value>Конверсия мультимедиа...</value>
</data>
<data name="ButtonConvert" xml:space="preserve">
<value>Преобразовать</value>
</data>
<data name="LabelDestinationFormat" xml:space="preserve">
<value>Формат преобразования изображений</value>
</data>
<data name="TextConvertMedia" xml:space="preserve">
<value>Преобразование мультимедиа</value>
</data>
<data name="MsgConvertingFile" xml:space="preserve">
<value>Преобразование файла {0}</value>
</data>
<data name="TextMediaConvertError" xml:space="preserve">
<value>Ошибка конверсии мультимедиа</value>
</data>
<data name="LabelEncoding" xml:space="preserve">
<value>Кодировка</value>
</data>
<data name="TextConvertAudio" xml:space="preserve">
<value>Преобразовывать аудио в стандартный формат</value>
</data>
<data name="TextExtractAudio" xml:space="preserve">
<value>Извлекать аудио</value>
</data>
<data name="TooltipAudioFormats" xml:space="preserve">
<value>WAV, MP3, либо OGG</value>
</data>
<data name="TextAboutAudio" xml:space="preserve">
<value>Аудио</value>
</data>
<data name="TextAboutLicense" xml:space="preserve">
<value>Лицензия</value>
</data>
<data name="Type_audio" xml:space="preserve">
<value>звук</value>
</data>
<data name="MsgUnableInterpretAudio" xml:space="preserve">
<value>не удалось интерпретировать формат аудио</value>
</data>
<data name="LabelSkipFailures" xml:space="preserve">
<value>Пропускать файлы, не поддавшиеся конверсии.</value>
</data>
<data name="MsgNoMediaFiles" xml:space="preserve">
<value>Среди выбранных файлов нет мультимедиа.</value>
</data>
<data name="TextAudioConversion" xml:space="preserve">
<value>Аудио-файлы будут преобразованы в WAV, MP3 или OGG.</value>
</data>
<data name="MsgNoMatching" xml:space="preserve">
<value>Нет файлов, подходящих под маску "{0}"</value>
</data>
<data name="MsgSelectedFiles1" xml:space="preserve">
<value>{0} файл добавлен к выбранным</value>
</data>
<data name="MsgSelectedFiles2" xml:space="preserve">
<value>{0} файла добавлено к выбранным</value>
</data>
<data name="MsgSelectedFiles3" xml:space="preserve">
<value>{0} файлов добавлено к выбранным</value>
</data>
<data name="LabelEnterMask" xml:space="preserve">
<value>Маска для имён файлов</value>
</data>
<data name="TextSelectFiles" xml:space="preserve">
<value>Выбрать файлы</value>
</data>
<data name="TextErrorExtracting" xml:space="preserve">
<value>Произошёл сбой во время извлечения файла
{0}
{1}</value>
</data>
<data name="CtxMenuFileType" xml:space="preserve">
<value>Задать тип файла</value>
</data>
<data name="Type_NONE" xml:space="preserve">
<value>без типа</value>
</data>
</root>

View File

@ -1,151 +1,151 @@
//! \file Utility.cs
//! \date Sun Jul 06 07:40:34 2014
//! \brief utility classes.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Windows.Input;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
internal class NativeMethods
{
[DllImport ("shlwapi.dll", CharSet = CharSet.Unicode)]
internal static extern int StrCmpLogicalW (string psz1, string psz2);
[DllImport ("gdi32.dll")]
internal static extern int GetDeviceCaps (IntPtr hDc, int nIndex);
[DllImport ("user32.dll")]
internal static extern IntPtr GetDC (IntPtr hWnd);
[DllImport ("user32.dll")]
internal static extern int ReleaseDC (IntPtr hWnd, IntPtr hDc);
}
public static class Desktop
{
public static int DpiX { get { return dpi_x; } }
public static int DpiY { get { return dpi_y; } }
public const int LOGPIXELSX = 88;
public const int LOGPIXELSY = 90;
private static int dpi_x = GetCaps (LOGPIXELSX);
private static int dpi_y = GetCaps (LOGPIXELSY);
public static int GetCaps (int cap)
{
IntPtr hdc = NativeMethods.GetDC (IntPtr.Zero);
if (hdc == IntPtr.Zero)
return 96;
int dpi = NativeMethods.GetDeviceCaps (hdc, cap);
NativeMethods.ReleaseDC (IntPtr.Zero, hdc);
return dpi;
}
}
public sealed class NumericStringComparer : IComparer<string>
{
public int Compare (string a, string b)
{
return NativeMethods.StrCmpLogicalW (a, b);
}
}
public class WaitCursor : IDisposable
{
private Cursor m_previousCursor;
public WaitCursor()
{
m_previousCursor = Mouse.OverrideCursor;
Mouse.OverrideCursor = Cursors.Wait;
}
#region IDisposable Members
bool disposed = false;
public void Dispose()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (!disposed)
{
Mouse.OverrideCursor = m_previousCursor;
disposed = true;
}
}
#endregion
}
public static class Localization
{
public static string Plural (int n, string msg_id)
{
string suffix;
if (CultureInfo.CurrentUICulture.Name == "ru-RU")
{
suffix = (n%10==1 && n%100!=11 ? "1" : n%10>=2 && n% 10<=4 && (n%100<10 || n%100>=20) ? "2" : "3");
}
else // assume en-EN
{
suffix = 1 == n ? "1" : "2";
}
try
{
var res = guiStrings.ResourceManager.GetString (msg_id+suffix);
if (null == res)
{
Trace.WriteLine (string.Format ("Missing string resource for '{0}' token", msg_id+suffix));
if (suffix != "1")
res = guiStrings.ResourceManager.GetString (msg_id+"1");
if (null == res)
res = guiStrings.ResourceManager.GetString (msg_id);
}
return res ?? msg_id;
}
catch (Exception X)
{
Trace.WriteLine (X.Message, "Localization.Plural");
return msg_id;
}
}
public static string Format (string msg_id, int n)
{
return string.Format (Plural (n, msg_id), n);
}
// Localization.Format ("{0:file:files} copied", count);
// public static string Format (string format, params object[] args);
}
}
//! \file Utility.cs
//! \date Sun Jul 06 07:40:34 2014
//! \brief utility classes.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Windows.Input;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
internal class NativeMethods
{
[DllImport ("shlwapi.dll", CharSet = CharSet.Unicode)]
internal static extern int StrCmpLogicalW (string psz1, string psz2);
[DllImport ("gdi32.dll")]
internal static extern int GetDeviceCaps (IntPtr hDc, int nIndex);
[DllImport ("user32.dll")]
internal static extern IntPtr GetDC (IntPtr hWnd);
[DllImport ("user32.dll")]
internal static extern int ReleaseDC (IntPtr hWnd, IntPtr hDc);
}
public static class Desktop
{
public static int DpiX { get { return dpi_x; } }
public static int DpiY { get { return dpi_y; } }
public const int LOGPIXELSX = 88;
public const int LOGPIXELSY = 90;
private static int dpi_x = GetCaps (LOGPIXELSX);
private static int dpi_y = GetCaps (LOGPIXELSY);
public static int GetCaps (int cap)
{
IntPtr hdc = NativeMethods.GetDC (IntPtr.Zero);
if (hdc == IntPtr.Zero)
return 96;
int dpi = NativeMethods.GetDeviceCaps (hdc, cap);
NativeMethods.ReleaseDC (IntPtr.Zero, hdc);
return dpi;
}
}
public sealed class NumericStringComparer : IComparer<string>
{
public int Compare (string a, string b)
{
return NativeMethods.StrCmpLogicalW (a, b);
}
}
public class WaitCursor : IDisposable
{
private Cursor m_previousCursor;
public WaitCursor()
{
m_previousCursor = Mouse.OverrideCursor;
Mouse.OverrideCursor = Cursors.Wait;
}
#region IDisposable Members
bool disposed = false;
public void Dispose()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (!disposed)
{
Mouse.OverrideCursor = m_previousCursor;
disposed = true;
}
}
#endregion
}
public static class Localization
{
public static string Plural (int n, string msg_id)
{
string suffix;
if (CultureInfo.CurrentUICulture.Name == "ru-RU")
{
suffix = (n%10==1 && n%100!=11 ? "1" : n%10>=2 && n% 10<=4 && (n%100<10 || n%100>=20) ? "2" : "3");
}
else // assume en-EN
{
suffix = 1 == n ? "1" : "2";
}
try
{
var res = guiStrings.ResourceManager.GetString (msg_id+suffix);
if (null == res)
{
Trace.WriteLine (string.Format ("Missing string resource for '{0}' token", msg_id+suffix));
if (suffix != "1")
res = guiStrings.ResourceManager.GetString (msg_id+"1");
if (null == res)
res = guiStrings.ResourceManager.GetString (msg_id);
}
return res ?? msg_id;
}
catch (Exception X)
{
Trace.WriteLine (X.Message, "Localization.Plural");
return msg_id;
}
}
public static string Format (string msg_id, int n)
{
return string.Format (Plural (n, msg_id), n);
}
// Localization.Format ("{0:file:files} copied", count);
// public static string Format (string format, params object[] args);
}
}

View File

@ -1,230 +1,230 @@
//! \file ViewModel.cs
//! \date Wed Jul 02 07:29:11 2014
//! \brief GARbro directory list.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Windows.Data;
using GameRes;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
public class DirectoryViewModel : ObservableCollection<EntryViewModel>
{
public IReadOnlyList<string> Path { get; private set; }
public IEnumerable<Entry> Source { get; private set; }
public bool IsArchive { get; private set; }
public DirectoryViewModel (IEnumerable<string> path, IEnumerable<Entry> filelist, bool is_archive)
{
Path = path.ToList();
Source = filelist;
IsArchive = is_archive;
ImportFromSource();
}
protected void ImportFromSource ()
{
var last_dir = Path.Last();
if (IsArchive || !string.IsNullOrEmpty (last_dir) && null != Directory.GetParent (last_dir))
{
Add (new EntryViewModel (new SubDirEntry (".."), -2));
}
foreach (var entry in Source)
{
int prio = entry is SubDirEntry ? -1 : 0;
Add (new EntryViewModel (entry, prio));
}
}
public EntryViewModel Find (string name)
{
return this.FirstOrDefault (e => e.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase));
}
}
public class EntryViewModel : INotifyPropertyChanged
{
public EntryViewModel (Entry entry, int priority)
{
Source = entry;
Name = Path.GetFileName (entry.Name);
Priority = priority;
}
public event PropertyChangedEventHandler PropertyChanged;
public Entry Source { get; private set; }
public string Name { get; private set; }
public string Type
{
get { return Source.Type; }
set
{
if (Source.Type != value)
{
Source.Type = value;
OnPropertyChanged ("Type");
}
}
}
public uint? Size { get { return IsDirectory ? null : (uint?)Source.Size; } }
public int Priority { get; private set; }
public bool IsDirectory { get { return Priority < 0; } }
private void OnPropertyChanged (string property = "")
{
if (PropertyChanged != null)
{
PropertyChanged (this, new PropertyChangedEventArgs (property));
}
}
}
public sealed class FileSystemComparer : IComparer
{
private string m_property;
private int m_direction;
private static Comparer s_default_comparer = new Comparer (CultureInfo.CurrentUICulture);
public FileSystemComparer (string property, ListSortDirection direction)
{
m_property = property;
m_direction = direction == ListSortDirection.Ascending ? 1 : -1;
}
public int Compare (object a, object b)
{
var v_a = a as EntryViewModel;
var v_b = b as EntryViewModel;
if (null == v_a || null == v_b)
return s_default_comparer.Compare (a, b) * m_direction;
if (v_a.Priority < v_b.Priority)
return -1;
if (v_a.Priority > v_b.Priority)
return 1;
if (string.IsNullOrEmpty (m_property))
return 0;
int order;
if (m_property != "Name")
{
if ("Type" == m_property)
{
// empty strings placed in the end
if (string.IsNullOrEmpty (v_a.Type))
order = string.IsNullOrEmpty (v_b.Type) ? 0 : m_direction;
else if (string.IsNullOrEmpty (v_b.Type))
order = -m_direction;
else
order = string.Compare (v_a.Type, v_b.Type, true) * m_direction;
}
else
{
var prop_a = a.GetType ().GetProperty (m_property).GetValue (a);
var prop_b = b.GetType ().GetProperty (m_property).GetValue (b);
order = s_default_comparer.Compare (prop_a, prop_b) * m_direction;
}
if (0 == order)
order = CompareNames (v_a.Name, v_b.Name);
}
else
order = CompareNames (v_a.Name, v_b.Name) * m_direction;
return order;
}
static int CompareNames (string a, string b)
{
// return NativeMethods.StrCmpLogicalW (a, b);
return string.Compare (a, b, StringComparison.CurrentCultureIgnoreCase);
}
}
/// <summary>
/// Image format model for formats drop-down list widgets.
/// </summary>
public class ImageFormatModel
{
public ImageFormat Source { get; private set; }
public string Tag {
get { return null != Source ? Source.Tag : guiStrings.TextAsIs; }
}
public ImageFormatModel (ImageFormat impl = null)
{
Source = impl;
}
}
/// <summary>
/// Stores current position within directory view model.
/// </summary>
public class DirectoryPosition
{
public IEnumerable<string> Path { get; set; }
public string Item { get; set; }
public DirectoryPosition (DirectoryViewModel vm, EntryViewModel item)
{
Path = vm.Path;
Item = null != item ? item.Name : null;
}
public DirectoryPosition (string filename)
{
Path = new string[] { System.IO.Path.GetDirectoryName (filename) };
Item = System.IO.Path.GetFileName (filename);
}
}
public class EntryTypeConverter : IValueConverter
{
public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
{
var type = value as string;
if (!string.IsNullOrEmpty (type))
{
var translation = guiStrings.ResourceManager.GetString ("Type_"+type, guiStrings.Culture);
if (!string.IsNullOrEmpty (translation))
return translation;
}
return value;
}
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
//! \file ViewModel.cs
//! \date Wed Jul 02 07:29:11 2014
//! \brief GARbro directory list.
//
// Copyright (C) 2014 by morkt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Windows.Data;
using GameRes;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
public class DirectoryViewModel : ObservableCollection<EntryViewModel>
{
public IReadOnlyList<string> Path { get; private set; }
public IEnumerable<Entry> Source { get; private set; }
public bool IsArchive { get; private set; }
public DirectoryViewModel (IEnumerable<string> path, IEnumerable<Entry> filelist, bool is_archive)
{
Path = path.ToList();
Source = filelist;
IsArchive = is_archive;
ImportFromSource();
}
protected void ImportFromSource ()
{
var last_dir = Path.Last();
if (IsArchive || !string.IsNullOrEmpty (last_dir) && null != Directory.GetParent (last_dir))
{
Add (new EntryViewModel (new SubDirEntry (".."), -2));
}
foreach (var entry in Source)
{
int prio = entry is SubDirEntry ? -1 : 0;
Add (new EntryViewModel (entry, prio));
}
}
public EntryViewModel Find (string name)
{
return this.FirstOrDefault (e => e.Name.Equals (name, StringComparison.InvariantCultureIgnoreCase));
}
}
public class EntryViewModel : INotifyPropertyChanged
{
public EntryViewModel (Entry entry, int priority)
{
Source = entry;
Name = Path.GetFileName (entry.Name);
Priority = priority;
}
public event PropertyChangedEventHandler PropertyChanged;
public Entry Source { get; private set; }
public string Name { get; private set; }
public string Type
{
get { return Source.Type; }
set
{
if (Source.Type != value)
{
Source.Type = value;
OnPropertyChanged ("Type");
}
}
}
public uint? Size { get { return IsDirectory ? null : (uint?)Source.Size; } }
public int Priority { get; private set; }
public bool IsDirectory { get { return Priority < 0; } }
private void OnPropertyChanged (string property = "")
{
if (PropertyChanged != null)
{
PropertyChanged (this, new PropertyChangedEventArgs (property));
}
}
}
public sealed class FileSystemComparer : IComparer
{
private string m_property;
private int m_direction;
private static Comparer s_default_comparer = new Comparer (CultureInfo.CurrentUICulture);
public FileSystemComparer (string property, ListSortDirection direction)
{
m_property = property;
m_direction = direction == ListSortDirection.Ascending ? 1 : -1;
}
public int Compare (object a, object b)
{
var v_a = a as EntryViewModel;
var v_b = b as EntryViewModel;
if (null == v_a || null == v_b)
return s_default_comparer.Compare (a, b) * m_direction;
if (v_a.Priority < v_b.Priority)
return -1;
if (v_a.Priority > v_b.Priority)
return 1;
if (string.IsNullOrEmpty (m_property))
return 0;
int order;
if (m_property != "Name")
{
if ("Type" == m_property)
{
// empty strings placed in the end
if (string.IsNullOrEmpty (v_a.Type))
order = string.IsNullOrEmpty (v_b.Type) ? 0 : m_direction;
else if (string.IsNullOrEmpty (v_b.Type))
order = -m_direction;
else
order = string.Compare (v_a.Type, v_b.Type, true) * m_direction;
}
else
{
var prop_a = a.GetType ().GetProperty (m_property).GetValue (a);
var prop_b = b.GetType ().GetProperty (m_property).GetValue (b);
order = s_default_comparer.Compare (prop_a, prop_b) * m_direction;
}
if (0 == order)
order = CompareNames (v_a.Name, v_b.Name);
}
else
order = CompareNames (v_a.Name, v_b.Name) * m_direction;
return order;
}
static int CompareNames (string a, string b)
{
// return NativeMethods.StrCmpLogicalW (a, b);
return string.Compare (a, b, StringComparison.CurrentCultureIgnoreCase);
}
}
/// <summary>
/// Image format model for formats drop-down list widgets.
/// </summary>
public class ImageFormatModel
{
public ImageFormat Source { get; private set; }
public string Tag {
get { return null != Source ? Source.Tag : guiStrings.TextAsIs; }
}
public ImageFormatModel (ImageFormat impl = null)
{
Source = impl;
}
}
/// <summary>
/// Stores current position within directory view model.
/// </summary>
public class DirectoryPosition
{
public IEnumerable<string> Path { get; set; }
public string Item { get; set; }
public DirectoryPosition (DirectoryViewModel vm, EntryViewModel item)
{
Path = vm.Path;
Item = null != item ? item.Name : null;
}
public DirectoryPosition (string filename)
{
Path = new string[] { System.IO.Path.GetDirectoryName (filename) };
Item = System.IO.Path.GetFileName (filename);
}
}
public class EntryTypeConverter : IValueConverter
{
public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
{
var type = value as string;
if (!string.IsNullOrEmpty (type))
{
var translation = guiStrings.ResourceManager.GetString ("Type_"+type, guiStrings.Culture);
if (!string.IsNullOrEmpty (translation))
return translation;
}
return value;
}
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NAudio" version="1.7.3" targetFramework="net45" />
<package id="Ookii.Dialogs" version="1.0" targetFramework="net45" />
<package id="WindowsAPICodePack-Core" version="1.1.1" targetFramework="net45" />
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net45" />
<package id="WPFToolkit" version="3.5.50211.1" targetFramework="net45" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NAudio" version="1.7.3" targetFramework="net45" />
<package id="Ookii.Dialogs" version="1.0" targetFramework="net45" />
<package id="WindowsAPICodePack-Core" version="1.1.1" targetFramework="net45" />
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net45" />
<package id="WPFToolkit" version="3.5.50211.1" targetFramework="net45" />
</packages>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\ArcFormats\packages.config" />
<repository path="..\GameRes\packages.config" />
<repository path="..\packages.config" />
</repositories>