Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// 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("Unrar Tester")]
[assembly: AssemblyDescription("Unrar DLL Example Project")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Schematrix")]
[assembly: AssemblyProduct("UnrarTester")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// 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 Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View File

@@ -0,0 +1,186 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Schematrix
{
/// <summary>
/// Summary description for TextInputDialog.
/// </summary>
public class TextInputDialog : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox InputValue;
private System.Windows.Forms.Button OKButton;
private System.Windows.Forms.Button ResetButton;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Button CanxButton;
private string defaultValue=string.Empty;
public TextInputDialog()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
public string Value
{
get
{
return(InputValue.Text);
}
set
{
if(value!=InputValue.Text)
{
InputValue.Text=value;
InputValue.SelectionStart=value.Length;
InputValue.SelectionLength=0;
defaultValue=value;
}
}
}
public string Prompt
{
get
{
return(this.Text);
}
set
{
this.Text=value;
}
}
public char PasswordChar
{
get
{
return InputValue.PasswordChar;
}
set
{
InputValue.PasswordChar=value;
}
}
public void SelectAll()
{
InputValue.SelectAll();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.InputValue = new System.Windows.Forms.TextBox();
this.OKButton = new System.Windows.Forms.Button();
this.CanxButton = new System.Windows.Forms.Button();
this.ResetButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// InputValue
//
this.InputValue.Dock = System.Windows.Forms.DockStyle.Top;
this.InputValue.Location = new System.Drawing.Point(0, 0);
this.InputValue.Name = "InputValue";
this.InputValue.Size = new System.Drawing.Size(304, 20);
this.InputValue.TabIndex = 1;
this.InputValue.Text = "";
//
// OKButton
//
this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OKButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.OKButton.Location = new System.Drawing.Point(40, 26);
this.OKButton.Name = "OKButton";
this.OKButton.Size = new System.Drawing.Size(64, 24);
this.OKButton.TabIndex = 2;
this.OKButton.Text = "OK";
//
// CanxButton
//
this.CanxButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.CanxButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CanxButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.CanxButton.Location = new System.Drawing.Point(184, 26);
this.CanxButton.Name = "CanxButton";
this.CanxButton.Size = new System.Drawing.Size(64, 24);
this.CanxButton.TabIndex = 3;
this.CanxButton.Text = "Cancel";
//
// ResetButton
//
this.ResetButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ResetButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.ResetButton.Location = new System.Drawing.Point(112, 26);
this.ResetButton.Name = "ResetButton";
this.ResetButton.Size = new System.Drawing.Size(64, 24);
this.ResetButton.TabIndex = 4;
this.ResetButton.Text = "Reset";
this.ResetButton.Click += new System.EventHandler(this.ResetButton_Click);
//
// TextInputDialog
//
this.AcceptButton = this.OKButton;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(304, 54);
this.ControlBox = false;
this.Controls.Add(this.ResetButton);
this.Controls.Add(this.CanxButton);
this.Controls.Add(this.OKButton);
this.Controls.Add(this.InputValue);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TextInputDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "TextInputDialog";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextInputDialog_KeyDown);
this.ResumeLayout(false);
}
#endregion
private void ResetButton_Click(object sender, System.EventArgs e)
{
InputValue.Text=defaultValue;
}
private void TextInputDialog_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode==Keys.Escape)
this.DialogResult=DialogResult.Cancel;
}
}
}

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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="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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="InputValue.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="InputValue.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="InputValue.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="OKButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="OKButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="OKButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="CanxButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="CanxButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="CanxButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ResetButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="ResetButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="ResetButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>2, 2</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Name">
<value>TextInputDialog</value>
</data>
</root>

969
unrar/Examples/C#/Unrar.cs Normal file
View File

@@ -0,0 +1,969 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Collections;
/* Author: Michael A. McCloskey
* Company: Schematrix
* Version: 20040714
*
* Personal Comments:
* I created this unrar wrapper class for personal use
* after running into a number of issues trying to use
* another COM unrar product via COM interop. I hope it
* proves as useful to you as it has to me and saves you
* some time in building your own products.
*/
namespace Schematrix
{
#region Event Delegate Definitions
/// <summary>
/// Represents the method that will handle data available events
/// </summary>
public delegate void DataAvailableHandler(object sender, DataAvailableEventArgs e);
/// <summary>
/// Represents the method that will handle extraction progress events
/// </summary>
public delegate void ExtractionProgressHandler(object sender, ExtractionProgressEventArgs e);
/// <summary>
/// Represents the method that will handle missing archive volume events
/// </summary>
public delegate void MissingVolumeHandler(object sender, MissingVolumeEventArgs e);
/// <summary>
/// Represents the method that will handle new volume events
/// </summary>
public delegate void NewVolumeHandler(object sender, NewVolumeEventArgs e);
/// <summary>
/// Represents the method that will handle new file notifications
/// </summary>
public delegate void NewFileHandler(object sender, NewFileEventArgs e);
/// <summary>
/// Represents the method that will handle password required events
/// </summary>
public delegate void PasswordRequiredHandler(object sender, PasswordRequiredEventArgs e);
#endregion
/// <summary>
/// Wrapper class for unrar DLL supplied by RARSoft.
/// Calls unrar DLL via platform invocation services (pinvoke).
/// DLL is available at http://www.rarlab.com/rar/UnRARDLL.exe
/// </summary>
public class Unrar : IDisposable
{
#region Unrar DLL enumerations
/// <summary>
/// Mode in which archive is to be opened for processing.
/// </summary>
public enum OpenMode
{
/// <summary>
/// Open archive for listing contents only
/// </summary>
List=0,
/// <summary>
/// Open archive for testing or extracting contents
/// </summary>
Extract=1
}
private enum RarError : uint
{
EndOfArchive=10,
InsufficientMemory=11,
BadData=12,
BadArchive=13,
UnknownFormat=14,
OpenError=15,
CreateError=16,
CloseError=17,
ReadError=18,
WriteError=19,
BufferTooSmall=20,
UnknownError=21
}
private enum Operation : uint
{
Skip=0,
Test=1,
Extract=2
}
private enum VolumeMessage : uint
{
Ask=0,
Notify=1
}
[Flags]
private enum ArchiveFlags : uint
{
Volume=0x1, // Volume attribute (archive volume)
CommentPresent=0x2, // Archive comment present
Lock=0x4, // Archive lock attribute
SolidArchive=0x8, // Solid attribute (solid archive)
NewNamingScheme=0x10, // New volume naming scheme ('volname.partN.rar')
AuthenticityPresent=0x20, // Authenticity information present
RecoveryRecordPresent=0x40, // Recovery record present
EncryptedHeaders=0x80, // Block headers are encrypted
FirstVolume=0x100 // 0x0100 - First volume (set only by RAR 3.0 and later)
}
private enum CallbackMessages : uint
{
VolumeChange=0,
ProcessData=1,
NeedPassword=2
}
#endregion
#region Unrar DLL structure definitions
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
private struct RARHeaderData
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)]
public string ArcName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)]
public string FileName;
public uint Flags;
public uint PackSize;
public uint UnpSize;
public uint HostOS;
public uint FileCRC;
public uint FileTime;
public uint UnpVer;
public uint Method;
public uint FileAttr;
[MarshalAs(UnmanagedType.LPStr)]
public string CmtBuf;
public uint CmtBufSize;
public uint CmtSize;
public uint CmtState;
public void Initialize()
{
this.CmtBuf=new string((char)0, 65536);
this.CmtBufSize=65536;
}
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct RARHeaderDataEx
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=512)]
public string ArcName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)]
public string ArcNameW;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=512)]
public string FileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)]
public string FileNameW;
public uint Flags;
public uint PackSize;
public uint PackSizeHigh;
public uint UnpSize;
public uint UnpSizeHigh;
public uint HostOS;
public uint FileCRC;
public uint FileTime;
public uint UnpVer;
public uint Method;
public uint FileAttr;
[MarshalAs(UnmanagedType.LPStr)]
public string CmtBuf;
public uint CmtBufSize;
public uint CmtSize;
public uint CmtState;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)]
public uint[] Reserved;
public void Initialize()
{
this.CmtBuf=new string((char)0, 65536);
this.CmtBufSize=65536;
}
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct RAROpenArchiveData
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)]
public string ArcName;
public uint OpenMode;
public uint OpenResult;
[MarshalAs(UnmanagedType.LPStr)]
public string CmtBuf;
public uint CmtBufSize;
public uint CmtSize;
public uint CmtState;
public void Initialize()
{
this.CmtBuf=new string((char)0,65536);
this.CmtBufSize=65536;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RAROpenArchiveDataEx
{
[MarshalAs(UnmanagedType.LPStr)]
public string ArcName;
[MarshalAs(UnmanagedType.LPWStr)]
public string ArcNameW;
public uint OpenMode;
public uint OpenResult;
[MarshalAs(UnmanagedType.LPStr)]
public string CmtBuf;
public uint CmtBufSize;
public uint CmtSize;
public uint CmtState;
public uint Flags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)]
public uint[] Reserved;
public void Initialize()
{
this.CmtBuf=new string((char)0,65536);
this.CmtBufSize=65536;
this.Reserved=new uint[32];
}
}
#endregion
#region Unrar function declarations
[DllImport("unrar.dll")]
private static extern IntPtr RAROpenArchive(ref RAROpenArchiveData archiveData);
[DllImport("UNRAR.DLL")]
private static extern IntPtr RAROpenArchiveEx(ref RAROpenArchiveDataEx archiveData);
[DllImport("unrar.dll")]
private static extern int RARCloseArchive(IntPtr hArcData);
[DllImport("unrar.dll")]
private static extern int RARReadHeader(IntPtr hArcData, ref RARHeaderData headerData);
[DllImport("unrar.dll")]
private static extern int RARReadHeaderEx(IntPtr hArcData, ref RARHeaderDataEx headerData);
[DllImport("unrar.dll")]
private static extern int RARProcessFile(IntPtr hArcData, int operation,
[MarshalAs(UnmanagedType.LPStr)] string destPath,
[MarshalAs(UnmanagedType.LPStr)] string destName );
[DllImport("unrar.dll")]
private static extern void RARSetCallback(IntPtr hArcData, UNRARCallback callback, int userData);
[DllImport("unrar.dll")]
private static extern void RARSetPassword(IntPtr hArcData,
[MarshalAs(UnmanagedType.LPStr)] string password);
// Unrar callback delegate signature
private delegate int UNRARCallback(uint msg, int UserData, IntPtr p1, int p2);
#endregion
#region Public event declarations
/// <summary>
/// Event that is raised when a new chunk of data has been extracted
/// </summary>
public event DataAvailableHandler DataAvailable;
/// <summary>
/// Event that is raised to indicate extraction progress
/// </summary>
public event ExtractionProgressHandler ExtractionProgress;
/// <summary>
/// Event that is raised when a required archive volume is missing
/// </summary>
public event MissingVolumeHandler MissingVolume;
/// <summary>
/// Event that is raised when a new file is encountered during processing
/// </summary>
public event NewFileHandler NewFile;
/// <summary>
/// Event that is raised when a new archive volume is opened for processing
/// </summary>
public event NewVolumeHandler NewVolume;
/// <summary>
/// Event that is raised when a password is required before continuing
/// </summary>
public event PasswordRequiredHandler PasswordRequired;
#endregion
#region Private fields
private string archivePathName=string.Empty;
private IntPtr archiveHandle=new IntPtr(0);
private bool retrieveComment=true;
private string password=string.Empty;
private string comment=string.Empty;
private ArchiveFlags archiveFlags=0;
private RARHeaderDataEx header=new RARHeaderDataEx();
private string destinationPath=string.Empty;
private RARFileInfo currentFile=null;
private UNRARCallback callback=null;
#endregion
#region Object lifetime procedures
public Unrar()
{
this.callback=new UNRARCallback(RARCallback);
}
public Unrar(string archivePathName) : this()
{
this.archivePathName=archivePathName;
}
~Unrar()
{
if(this.archiveHandle!=IntPtr.Zero)
{
Unrar.RARCloseArchive(this.archiveHandle);
this.archiveHandle=IntPtr.Zero;
}
}
public void Dispose()
{
if(this.archiveHandle!=IntPtr.Zero)
{
Unrar.RARCloseArchive(this.archiveHandle);
this.archiveHandle=IntPtr.Zero;
}
}
#endregion
#region Public Properties
/// <summary>
/// Path and name of RAR archive to open
/// </summary>
public string ArchivePathName
{
get
{
return this.archivePathName;
}
set
{
this.archivePathName=value;
}
}
/// <summary>
/// Archive comment
/// </summary>
public string Comment
{
get
{
return(this.comment);
}
}
/// <summary>
/// Current file being processed
/// </summary>
public RARFileInfo CurrentFile
{
get
{
return(this.currentFile);
}
}
/// <summary>
/// Default destination path for extraction
/// </summary>
public string DestinationPath
{
get
{
return this.destinationPath;
}
set
{
this.destinationPath=value;
}
}
/// <summary>
/// Password for opening encrypted archive
/// </summary>
public string Password
{
get
{
return(this.password);
}
set
{
this.password=value;
if(this.archiveHandle!=IntPtr.Zero)
RARSetPassword(this.archiveHandle, value);
}
}
#endregion
#region Public Methods
/// <summary>
/// Close the currently open archive
/// </summary>
/// <returns></returns>
public void Close()
{
// Exit without exception if no archive is open
if(this.archiveHandle==IntPtr.Zero)
return;
// Close archive
int result=Unrar.RARCloseArchive(this.archiveHandle);
// Check result
if(result!=0)
{
ProcessFileError(result);
}
else
{
this.archiveHandle=IntPtr.Zero;
}
}
/// <summary>
/// Opens archive specified by the ArchivePathName property for testing or extraction
/// </summary>
public void Open()
{
if(this.ArchivePathName.Length==0)
throw new IOException("Archive name has not been set.");
this.Open(this.ArchivePathName, OpenMode.Extract);
}
/// <summary>
/// Opens archive specified by the ArchivePathName property with a specified mode
/// </summary>
/// <param name="openMode">Mode in which archive should be opened</param>
public void Open(OpenMode openMode)
{
if(this.ArchivePathName.Length==0)
throw new IOException("Archive name has not been set.");
this.Open(this.ArchivePathName, openMode);
}
/// <summary>
/// Opens specified archive using the specified mode.
/// </summary>
/// <param name="archivePathName">Path of archive to open</param>
/// <param name="openMode">Mode in which to open archive</param>
public void Open(string archivePathName, OpenMode openMode)
{
IntPtr handle=IntPtr.Zero;
// Close any previously open archives
if(this.archiveHandle!=IntPtr.Zero)
this.Close();
// Prepare extended open archive struct
this.ArchivePathName=archivePathName;
RAROpenArchiveDataEx openStruct=new RAROpenArchiveDataEx();
openStruct.Initialize();
openStruct.ArcName=this.archivePathName+"\0";
openStruct.ArcNameW=this.archivePathName+"\0";
openStruct.OpenMode=(uint)openMode;
if(this.retrieveComment)
{
openStruct.CmtBuf=new string((char)0,65536);
openStruct.CmtBufSize=65536;
}
else
{
openStruct.CmtBuf=null;
openStruct.CmtBufSize=0;
}
// Open archive
handle=Unrar.RAROpenArchiveEx(ref openStruct);
// Check for success
if(openStruct.OpenResult!=0)
{
switch((RarError)openStruct.OpenResult)
{
case RarError.InsufficientMemory:
throw new OutOfMemoryException("Insufficient memory to perform operation.");
case RarError.BadData:
throw new IOException("Archive header broken");
case RarError.BadArchive:
throw new IOException("File is not a valid archive.");
case RarError.OpenError:
throw new IOException("File could not be opened.");
}
}
// Save handle and flags
this.archiveHandle=handle;
this.archiveFlags=(ArchiveFlags)openStruct.Flags;
// Set callback
Unrar.RARSetCallback(this.archiveHandle, this.callback, this.GetHashCode());
// If comment retrieved, save it
if(openStruct.CmtState==1)
this.comment=openStruct.CmtBuf.ToString();
// If password supplied, set it
if(this.password.Length!=0)
Unrar.RARSetPassword(this.archiveHandle, this.password);
// Fire NewVolume event for first volume
this.OnNewVolume(this.archivePathName);
}
/// <summary>
/// Reads the next archive header and populates CurrentFile property data
/// </summary>
/// <returns></returns>
public bool ReadHeader()
{
// Throw exception if archive not open
if(this.archiveHandle==IntPtr.Zero)
throw new IOException("Archive is not open.");
// Initialize header struct
this.header=new RARHeaderDataEx();
header.Initialize();
// Read next entry
currentFile=null;
int result=Unrar.RARReadHeaderEx(this.archiveHandle, ref this.header);
// Check for error or end of archive
if((RarError)result==RarError.EndOfArchive)
return false;
else if((RarError)result==RarError.BadData)
throw new IOException("Archive data is corrupt.");
// Determine if new file
if(((header.Flags & 0x01) != 0) && currentFile!=null)
currentFile.ContinuedFromPrevious=true;
else
{
// New file, prepare header
currentFile=new RARFileInfo();
currentFile.FileName=header.FileNameW.ToString();
if((header.Flags & 0x02) != 0)
currentFile.ContinuedOnNext=true;
if(header.PackSizeHigh != 0)
currentFile.PackedSize=(header.PackSizeHigh * 0x100000000) + header.PackSize;
else
currentFile.PackedSize=header.PackSize;
if(header.UnpSizeHigh != 0)
currentFile.UnpackedSize=(header.UnpSizeHigh * 0x100000000) + header.UnpSize;
else
currentFile.UnpackedSize=header.UnpSize;
currentFile.HostOS=(int)header.HostOS;
currentFile.FileCRC=header.FileCRC;
currentFile.FileTime=FromMSDOSTime(header.FileTime);
currentFile.VersionToUnpack=(int)header.UnpVer;
currentFile.Method=(int)header.Method;
currentFile.FileAttributes=(int)header.FileAttr;
currentFile.BytesExtracted=0;
if((header.Flags & 0x20) == 0x20)
currentFile.IsDirectory=true;
this.OnNewFile();
}
// Return success
return true;
}
/// <summary>
/// Returns array of file names contained in archive
/// </summary>
/// <returns></returns>
public string[] ListFiles()
{
ArrayList fileNames=new ArrayList();
while(this.ReadHeader())
{
if(!currentFile.IsDirectory)
fileNames.Add(currentFile.FileName);
this.Skip();
}
string[] files=new string[fileNames.Count];
fileNames.CopyTo(files);
return files;
}
/// <summary>
/// Moves the current archive position to the next available header
/// </summary>
/// <returns></returns>
public void Skip()
{
int result=Unrar.RARProcessFile(this.archiveHandle, (int)Operation.Skip, string.Empty, string.Empty);
// Check result
if(result!=0)
{
ProcessFileError(result);
}
}
/// <summary>
/// Tests the ability to extract the current file without saving extracted data to disk
/// </summary>
/// <returns></returns>
public void Test()
{
int result=Unrar.RARProcessFile(this.archiveHandle, (int)Operation.Test, string.Empty, string.Empty);
// Check result
if(result!=0)
{
ProcessFileError(result);
}
}
/// <summary>
/// Extracts the current file to the default destination path
/// </summary>
/// <returns></returns>
public void Extract()
{
this.Extract(this.destinationPath, string.Empty);
}
/// <summary>
/// Extracts the current file to a specified destination path and filename
/// </summary>
/// <param name="destinationName">Path and name of extracted file</param>
/// <returns></returns>
public void Extract(string destinationName)
{
this.Extract(string.Empty, destinationName);
}
/// <summary>
/// Extracts the current file to a specified directory without renaming file
/// </summary>
/// <param name="destinationPath"></param>
/// <returns></returns>
public void ExtractToDirectory(string destinationPath)
{
this.Extract(destinationPath, string.Empty);
}
#endregion
#region Private Methods
private void Extract(string destinationPath, string destinationName)
{
int result=Unrar.RARProcessFile(this.archiveHandle, (int)Operation.Extract, destinationPath, destinationName);
// Check result
if(result!=0)
{
ProcessFileError(result);
}
}
private DateTime FromMSDOSTime(uint dosTime)
{
int day=0;
int month=0;
int year=0;
int second=0;
int hour=0;
int minute=0;
ushort hiWord;
ushort loWord;
hiWord=(ushort)((dosTime & 0xFFFF0000) >> 16);
loWord=(ushort)(dosTime & 0xFFFF);
year=((hiWord & 0xFE00) >> 9)+1980;
month=(hiWord & 0x01E0) >> 5;
day=hiWord & 0x1F;
hour=(loWord & 0xF800) >> 11;
minute=(loWord & 0x07E0) >> 5;
second=(loWord & 0x1F) << 1;
return new DateTime(year, month, day, hour, minute, second);
}
private void ProcessFileError(int result)
{
switch((RarError)result)
{
case RarError.UnknownFormat:
throw new OutOfMemoryException("Unknown archive format.");
case RarError.BadData:
throw new IOException("File CRC Error");
case RarError.BadArchive:
throw new IOException("File is not a valid archive.");
case RarError.OpenError:
throw new IOException("File could not be opened.");
case RarError.CreateError:
throw new IOException("File could not be created.");
case RarError.CloseError:
throw new IOException("File close error.");
case RarError.ReadError:
throw new IOException("File read error.");
case RarError.WriteError:
throw new IOException("File write error.");
}
}
private int RARCallback(uint msg, int UserData, IntPtr p1, int p2)
{
string volume=string.Empty;
string newVolume=string.Empty;
int result=-1;
switch((CallbackMessages)msg)
{
case CallbackMessages.VolumeChange:
volume=Marshal.PtrToStringAnsi(p1);
if((VolumeMessage)p2==VolumeMessage.Notify)
result=OnNewVolume(volume);
else if((VolumeMessage)p2==VolumeMessage.Ask)
{
newVolume=OnMissingVolume(volume);
if(newVolume.Length==0)
result=-1;
else
{
if(newVolume!=volume)
{
for(int i=0; i<newVolume.Length; i++)
{
Marshal.WriteByte(p1, i, (byte)newVolume[i]);
}
Marshal.WriteByte(p1, newVolume.Length, (byte)0);
}
result=1;
}
}
break;
case CallbackMessages.ProcessData:
result=OnDataAvailable(p1, p2);
break;
case CallbackMessages.NeedPassword:
result=OnPasswordRequired(p1, p2);
break;
}
return result;
}
#endregion
#region Protected Virtual (Overridable) Methods
protected virtual void OnNewFile()
{
if(this.NewFile!=null)
{
NewFileEventArgs e = new NewFileEventArgs(this.currentFile);
this.NewFile(this, e);
}
}
protected virtual int OnPasswordRequired(IntPtr p1, int p2)
{
int result=-1;
if(this.PasswordRequired!=null)
{
PasswordRequiredEventArgs e=new PasswordRequiredEventArgs();
this.PasswordRequired(this, e);
if(e.ContinueOperation && e.Password.Length>0)
{
for(int i=0; (i<e.Password.Length) && (i<p2); i++)
Marshal.WriteByte(p1, i, (byte)e.Password[i]);
Marshal.WriteByte(p1, e.Password.Length, (byte)0);
result=1;
}
}
else
{
throw new IOException("Password is required for extraction.");
}
return result;
}
protected virtual int OnDataAvailable(IntPtr p1, int p2)
{
int result=1;
if(this.currentFile!=null)
this.currentFile.BytesExtracted+=p2;
if(this.DataAvailable!=null)
{
byte[] data=new byte[p2];
Marshal.Copy(p1, data, 0, p2);
DataAvailableEventArgs e=new DataAvailableEventArgs(data);
this.DataAvailable(this, e);
if(!e.ContinueOperation)
result=-1;
}
if((this.ExtractionProgress!=null) && (this.currentFile!=null))
{
ExtractionProgressEventArgs e = new ExtractionProgressEventArgs();
e.FileName=this.currentFile.FileName;
e.FileSize=this.currentFile.UnpackedSize;
e.BytesExtracted=this.currentFile.BytesExtracted;
e.PercentComplete=this.currentFile.PercentComplete;
this.ExtractionProgress(this, e);
if(!e.ContinueOperation)
result=-1;
}
return result;
}
protected virtual int OnNewVolume(string volume)
{
int result=1;
if(this.NewVolume!=null)
{
NewVolumeEventArgs e=new NewVolumeEventArgs(volume);
this.NewVolume(this, e);
if(!e.ContinueOperation)
result=-1;
}
return result;
}
protected virtual string OnMissingVolume(string volume)
{
string result=string.Empty;
if(this.MissingVolume!=null)
{
MissingVolumeEventArgs e=new MissingVolumeEventArgs(volume);
this.MissingVolume(this, e);
if(e.ContinueOperation)
result=e.VolumeName;
}
return result;
}
#endregion
}
#region Event Argument Classes
public class NewVolumeEventArgs
{
public string VolumeName;
public bool ContinueOperation=true;
public NewVolumeEventArgs(string volumeName)
{
this.VolumeName=volumeName;
}
}
public class MissingVolumeEventArgs
{
public string VolumeName;
public bool ContinueOperation=false;
public MissingVolumeEventArgs(string volumeName)
{
this.VolumeName=volumeName;
}
}
public class DataAvailableEventArgs
{
public readonly byte[] Data;
public bool ContinueOperation=true;
public DataAvailableEventArgs(byte[] data)
{
this.Data=data;
}
}
public class PasswordRequiredEventArgs
{
public string Password=string.Empty;
public bool ContinueOperation=true;
}
public class NewFileEventArgs
{
public RARFileInfo fileInfo;
public NewFileEventArgs(RARFileInfo fileInfo)
{
this.fileInfo=fileInfo;
}
}
public class ExtractionProgressEventArgs
{
public string FileName;
public long FileSize;
public long BytesExtracted;
public double PercentComplete;
public bool ContinueOperation=true;
}
public class RARFileInfo
{
public string FileName;
public bool ContinuedFromPrevious=false;
public bool ContinuedOnNext=false;
public bool IsDirectory=false;
public long PackedSize=0;
public long UnpackedSize=0;
public int HostOS=0;
public long FileCRC=0;
public DateTime FileTime;
public int VersionToUnpack=0;
public int Method=0;
public int FileAttributes=0;
public long BytesExtracted=0;
public double PercentComplete
{
get
{
if(this.UnpackedSize!=0)
return(((double)this.BytesExtracted/(double)this.UnpackedSize) * (double)100.0);
else
return (double)0;
}
}
}
#endregion
}

View File

@@ -0,0 +1,130 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{2F343733-20A0-4AD0-88B2-762977614D67}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Unrar"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "WinExe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Schematrix"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "TextInputDialog.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "TextInputDialog.resx"
DependentUpon = "TextInputDialog.cs"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Unrar.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "UnrarTest.cs"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "UnrarTest.resx"
DependentUpon = "UnrarTest.cs"
BuildAction = "EmbeddedResource"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,48 @@
<VisualStudioProject>
<CSHARP LastOpenVersion = "7.10.3077" >
<Build>
<Settings ReferencePath = "" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unrar", "Unrar.csproj", "{2F343733-20A0-4AD0-88B2-762977614D67}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{2F343733-20A0-4AD0-88B2-762977614D67}.Debug.ActiveCfg = Debug|.NET
{2F343733-20A0-4AD0-88B2-762977614D67}.Debug.Build.0 = Debug|.NET
{2F343733-20A0-4AD0-88B2-762977614D67}.Release.ActiveCfg = Release|.NET
{2F343733-20A0-4AD0-88B2-762977614D67}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,438 @@
using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Schematrix
{
/// <summary>
/// Test driver form for unrar class
/// </summary>
public class UnrarTest : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox rarFileName;
private System.Windows.Forms.Button selectFile;
private System.Windows.Forms.Label rarFileNameLabel;
private System.Windows.Forms.ListView fileList;
private System.Windows.Forms.Button testButton;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.Button extractButton;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.FolderBrowserDialog folderBrowser;
private System.Windows.Forms.OpenFileDialog openFile;
private System.Windows.Forms.ColumnHeader fileNameColumnHeader;
private System.Windows.Forms.ColumnHeader unpackedSizeColumnHeader;
private System.Windows.Forms.ColumnHeader packedSizeColumnHeader;
private System.Windows.Forms.ColumnHeader fileTimestampColumnHeader;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private Unrar unrar;
public UnrarTest()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new UnrarTest());
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.rarFileName = new System.Windows.Forms.TextBox();
this.selectFile = new System.Windows.Forms.Button();
this.rarFileNameLabel = new System.Windows.Forms.Label();
this.fileList = new System.Windows.Forms.ListView();
this.fileNameColumnHeader = new System.Windows.Forms.ColumnHeader();
this.unpackedSizeColumnHeader = new System.Windows.Forms.ColumnHeader();
this.packedSizeColumnHeader = new System.Windows.Forms.ColumnHeader();
this.fileTimestampColumnHeader = new System.Windows.Forms.ColumnHeader();
this.testButton = new System.Windows.Forms.Button();
this.statusBar = new System.Windows.Forms.StatusBar();
this.extractButton = new System.Windows.Forms.Button();
this.progressBar = new System.Windows.Forms.ProgressBar();
this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
this.openFile = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// rarFileName
//
this.rarFileName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rarFileName.Location = new System.Drawing.Point(6, 26);
this.rarFileName.Name = "rarFileName";
this.rarFileName.ReadOnly = true;
this.rarFileName.Size = new System.Drawing.Size(590, 20);
this.rarFileName.TabIndex = 0;
this.rarFileName.Text = "";
//
// selectFile
//
this.selectFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.selectFile.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.selectFile.Location = new System.Drawing.Point(603, 26);
this.selectFile.Name = "selectFile";
this.selectFile.Size = new System.Drawing.Size(28, 20);
this.selectFile.TabIndex = 1;
this.selectFile.Text = "...";
this.selectFile.Click += new System.EventHandler(this.selectFile_Click);
//
// rarFileNameLabel
//
this.rarFileNameLabel.Location = new System.Drawing.Point(6, 8);
this.rarFileNameLabel.Name = "rarFileNameLabel";
this.rarFileNameLabel.Size = new System.Drawing.Size(208, 23);
this.rarFileNameLabel.TabIndex = 2;
this.rarFileNameLabel.Text = "RAR File Name";
//
// fileList
//
this.fileList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.fileList.CheckBoxes = true;
this.fileList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.fileNameColumnHeader,
this.unpackedSizeColumnHeader,
this.packedSizeColumnHeader,
this.fileTimestampColumnHeader});
this.fileList.Location = new System.Drawing.Point(6, 52);
this.fileList.Name = "fileList";
this.fileList.Size = new System.Drawing.Size(626, 304);
this.fileList.TabIndex = 3;
this.fileList.View = System.Windows.Forms.View.Details;
//
// fileNameColumnHeader
//
this.fileNameColumnHeader.Text = "File Name";
this.fileNameColumnHeader.Width = 250;
//
// unpackedSizeColumnHeader
//
this.unpackedSizeColumnHeader.Text = "Unpacked Size";
this.unpackedSizeColumnHeader.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.unpackedSizeColumnHeader.Width = 100;
//
// packedSizeColumnHeader
//
this.packedSizeColumnHeader.Text = "Packed Size";
this.packedSizeColumnHeader.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.packedSizeColumnHeader.Width = 100;
//
// fileTimestampColumnHeader
//
this.fileTimestampColumnHeader.Text = "File Timestamp";
this.fileTimestampColumnHeader.Width = 150;
//
// testButton
//
this.testButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.testButton.Enabled = false;
this.testButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.testButton.Location = new System.Drawing.Point(12, 364);
this.testButton.Name = "testButton";
this.testButton.Size = new System.Drawing.Size(66, 26);
this.testButton.TabIndex = 4;
this.testButton.Text = "Test";
this.testButton.Click += new System.EventHandler(this.testButton_Click);
//
// statusBar
//
this.statusBar.Location = new System.Drawing.Point(0, 398);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(640, 22);
this.statusBar.TabIndex = 5;
this.statusBar.Text = "Ready";
//
// extractButton
//
this.extractButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.extractButton.Enabled = false;
this.extractButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.extractButton.Location = new System.Drawing.Point(87, 365);
this.extractButton.Name = "extractButton";
this.extractButton.Size = new System.Drawing.Size(66, 26);
this.extractButton.TabIndex = 6;
this.extractButton.Text = "Extract";
this.extractButton.Click += new System.EventHandler(this.extractButton_Click);
//
// progressBar
//
this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar.Location = new System.Drawing.Point(162, 370);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(470, 16);
this.progressBar.TabIndex = 7;
//
// folderBrowser
//
this.folderBrowser.Description = "Please select a destination folder for the extracted files.";
//
// openFile
//
this.openFile.DefaultExt = "rar";
this.openFile.Filter = "RAR Files (*.rar)|*.rar|All Files (*.*)|*.*";
this.openFile.Title = "Select RAR File";
//
// UnrarTest
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(640, 420);
this.Controls.Add(this.progressBar);
this.Controls.Add(this.extractButton);
this.Controls.Add(this.statusBar);
this.Controls.Add(this.testButton);
this.Controls.Add(this.fileList);
this.Controls.Add(this.selectFile);
this.Controls.Add(this.rarFileName);
this.Controls.Add(this.rarFileNameLabel);
this.Name = "UnrarTest";
this.Text = "Unrar Class Tester";
this.ResumeLayout(false);
}
#endregion
private void selectFile_Click(object sender, System.EventArgs e)
{
if(openFile.ShowDialog()==DialogResult.OK)
{
rarFileName.Text = openFile.FileName;
OpenRarFile(rarFileName.Text);
}
}
private void OpenRarFile(string fileName)
{
try
{
this.Cursor=Cursors.WaitCursor;
testButton.Enabled=false;
extractButton.Enabled=false;
fileList.BeginUpdate();
fileList.Items.Clear();
// Create new unrar class and open archive for listing files
unrar=new Unrar();
unrar.Open(fileName, Unrar.OpenMode.List);
// Read each header, skipping directory entries
while(unrar.ReadHeader())
{
if(!unrar.CurrentFile.IsDirectory)
{
ListViewItem item=new ListViewItem(unrar.CurrentFile.FileName);
item.SubItems.Add(unrar.CurrentFile.UnpackedSize.ToString());
item.SubItems.Add(unrar.CurrentFile.PackedSize.ToString());
item.SubItems.Add(unrar.CurrentFile.FileTime.ToString());
item.Checked=true;
fileList.Items.Add(item);
}
unrar.Skip();
}
// Cleanup and enable buttons if no exception was thrown
unrar.Close();
this.unrar=null;
testButton.Enabled=true;
extractButton.Enabled=true;
}
catch(Exception ex)
{
testButton.Enabled=false;
extractButton.Enabled=false;
MessageBox.Show(ex.Message);
}
finally
{
this.Cursor=Cursors.Default;
fileList.EndUpdate();
if(this.unrar!=null)
unrar.Close();
}
}
private Hashtable GetSelectedFiles()
{
// Build hashtable of selected entries
Hashtable ht=new Hashtable(fileList.CheckedItems.Count);
foreach(ListViewItem item in fileList.CheckedItems)
ht.Add(item.Text, item);
return ht;
}
private void testButton_Click(object sender, System.EventArgs e)
{
// Get hashtable of selected files
Hashtable selectedFiles=GetSelectedFiles();
try
{
this.Cursor=Cursors.WaitCursor;
// Create new unrar class and attach event handlers for
// progress, missing volumes, and password
unrar=new Unrar();
AttachHandlers(unrar);
// Open archive for extraction
unrar.Open(rarFileName.Text, Unrar.OpenMode.Extract);
// Test each file found in hashtable
while(unrar.ReadHeader())
{
if(selectedFiles.ContainsKey(unrar.CurrentFile.FileName))
{
this.progressBar.Value=0;
unrar.Test();
}
else
{
unrar.Skip();
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
this.Cursor=Cursors.Default;
this.statusBar.Text = "Ready";
this.progressBar.Value=0;
if(this.unrar!=null)
unrar.Close();
}
}
private void extractButton_Click(object sender, System.EventArgs e)
{
// Get hashtable of selected files
Hashtable selectedFiles=GetSelectedFiles();
try
{
// Get destination from user
string directory=Path.GetDirectoryName(rarFileName.Text);
if(Directory.Exists(directory))
folderBrowser.SelectedPath=directory;
if(folderBrowser.ShowDialog()==DialogResult.OK)
{
this.Cursor=Cursors.WaitCursor;
// Create new unrar class and attach event handlers for
// progress, missing volumes, and password
unrar=new Unrar();
AttachHandlers(unrar);
// Set destination path for all files
unrar.DestinationPath=folderBrowser.SelectedPath;
// Open archive for extraction
unrar.Open(rarFileName.Text, Unrar.OpenMode.Extract);
// Extract each file found in hashtable
while(unrar.ReadHeader())
{
if(selectedFiles.ContainsKey(unrar.CurrentFile.FileName))
{
this.progressBar.Value=0;
unrar.Extract();
}
else
{
unrar.Skip();
}
}
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
this.Cursor=Cursors.Default;
this.statusBar.Text = "Ready";
this.progressBar.Value=0;
if(this.unrar!=null)
unrar.Close();
}
}
private void AttachHandlers(Unrar unrar)
{
unrar.ExtractionProgress+=new ExtractionProgressHandler(unrar_ExtractionProgress);
unrar.MissingVolume+=new MissingVolumeHandler(unrar_MissingVolume);
unrar.PasswordRequired+=new PasswordRequiredHandler(unrar_PasswordRequired);
}
private void unrar_ExtractionProgress(object sender, ExtractionProgressEventArgs e)
{
statusBar.Text = "Testing " + e.FileName;
progressBar.Value=(int)e.PercentComplete;
}
private void unrar_MissingVolume(object sender, MissingVolumeEventArgs e)
{
TextInputDialog dialog=new TextInputDialog();
dialog.Value=e.VolumeName;
dialog.Prompt=string.Format("Volume is missing. Correct or cancel.");
if(dialog.ShowDialog()==DialogResult.OK)
{
e.VolumeName=dialog.Value;
e.ContinueOperation=true;
}
else
e.ContinueOperation=false;
}
private void unrar_PasswordRequired(object sender, PasswordRequiredEventArgs e)
{
TextInputDialog dialog=new TextInputDialog();
dialog.Prompt=string.Format("Password is required for extraction.");
dialog.PasswordChar='*';
if(dialog.ShowDialog()==DialogResult.OK)
{
e.Password=dialog.Value;
e.ContinueOperation=true;
}
else
e.ContinueOperation=false;
}
}
}

View File

@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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 forserialized 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="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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="rarFileName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rarFileName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="rarFileName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="selectFile.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="selectFile.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="selectFile.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rarFileNameLabel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="rarFileNameLabel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="rarFileNameLabel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileList.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="fileList.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileList.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileNameColumnHeader.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileNameColumnHeader.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="unpackedSizeColumnHeader.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="unpackedSizeColumnHeader.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="packedSizeColumnHeader.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="packedSizeColumnHeader.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileTimestampColumnHeader.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="fileTimestampColumnHeader.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="testButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="testButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="testButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="statusBar.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="statusBar.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="statusBar.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="extractButton.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="extractButton.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="extractButton.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="progressBar.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="progressBar.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="progressBar.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="folderBrowser.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="folderBrowser.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="folderBrowser.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="openFile.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="openFile.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="openFile.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 17</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>2, 2</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Name">
<value>UnrarTest</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root>