Added Russian localization

Tweaked GUI
Updated README
This commit is contained in:
Roman Belkov 2015-01-14 19:32:49 +03:00
parent 168763d9f0
commit 6315a5c5a1
12 changed files with 1597 additions and 499 deletions

View file

@ -4,9 +4,9 @@
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}"
"IsWebType" = "8:FALSE"
"ProjectName" = "8:DiskImager.Installer"
"LanguageId" = "3:1033"
"LanguageId" = "3:0"
"CodePage" = "3:1252"
"UILanguageId" = "3:1033"
"UILanguageId" = "3:0"
"SccProjectName" = "8:"
"SccLocalPath" = "8:"
"SccAuxPath" = "8:"
@ -21,7 +21,7 @@
}
"Entry"
{
"MsmKey" = "8:_DB06497D6EA628F02D7A42761AF2DBAE"
"MsmKey" = "8:_B1090C5A5662721B31DE535DD9FE3833"
"OwnerKey" = "8:_8FDF365DCE9B4F70A60EF2BB1651CCBF"
"MsmSig" = "8:_UNDEFINED"
}
@ -34,7 +34,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_DB06497D6EA628F02D7A42761AF2DBAE"
"OwnerKey" = "8:_B1090C5A5662721B31DE535DD9FE3833"
"MsmSig" = "8:_UNDEFINED"
}
}
@ -142,14 +142,14 @@
}
"File"
{
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DB06497D6EA628F02D7A42761AF2DBAE"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_B1090C5A5662721B31DE535DD9FE3833"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_DB06497D6EA628F02D7A42761AF2DBAE"
"_B1090C5A5662721B31DE535DD9FE3833"
{
"Name" = "8:ICSharpCode.SharpZipLib.dll"
"Attributes" = "3:512"
@ -222,22 +222,22 @@
}
"MsiBootstrapper"
{
"LangId" = "3:1033"
"LangId" = "3:0"
"RequiresElevation" = "11:FALSE"
}
"Product"
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Disk Imager"
"ProductCode" = "8:{BEFE1D43-19A6-48F2-8340-92AD4513A108}"
"PackageCode" = "8:{1F1B2C34-933B-4AF1-8972-0CD044A9E172}"
"ProductCode" = "8:{51B52296-A8DC-4D25-9823-E85F0F7AADCF}"
"PackageCode" = "8:{43DD1045-2E31-4B8B-8299-C4C2D7BF62D1}"
"UpgradeCode" = "8:{A2F957D8-23F6-44DB-A22C-CCA8275E1FCE}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.1.0"
"ProductVersion" = "8:1.2.1"
"Manufacturer" = "8:Dynamic Devices"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
@ -779,7 +779,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_8FDF365DCE9B4F70A60EF2BB1651CCBF"
{
"SourcePath" = "8:..\\DiskImager\\obj\\x86\\Debug\\DiskImager.exe"
"SourcePath" = "8:..\\DiskImager\\obj\\x86\\Release\\DiskImager.exe"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_072AE4B10D3C471AA2B16D68E3691837"
@ -833,6 +833,34 @@
{
}
}
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_D9008FB07D394DC88312BB67F0526092"
{
"SourcePath" = "8:"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_072AE4B10D3C471AA2B16D68E3691837"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
"ProjectOutputGroupRegister" = "3:1"
"OutputConfiguration" = "8:"
"OutputGroupCanonicalName" = "8:LocalizedResourceDlls"
"OutputProjectGuid" = "8:{4A73C63C-2BF2-4F85-AA55-A5CA581A33B4}"
"ShowKeyOutput" = "11:TRUE"
"ExcludeFilters"
{
}
}
}
}
}

View file

@ -106,6 +106,9 @@
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.ru.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@ -116,6 +119,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Properties\Resources.ru.resx" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@ -158,6 +162,5 @@
<Name>ICSharpCode.SharpZLib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.textBoxFileName = new System.Windows.Forms.TextBox();
this.buttonRead = new System.Windows.Forms.Button();
this.buttonWrite = new System.Windows.Forms.Button();
@ -47,6 +48,9 @@
this.menuStripMain = new System.Windows.Forms.MenuStrip();
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.displayAllDrivesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.englishToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.russianToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBoxTruncation = new System.Windows.Forms.GroupBox();
this.checkBoxUseMBR = new System.Windows.Forms.CheckBox();
this.checkedListBoxDrives = new System.Windows.Forms.CheckedListBox();
@ -60,240 +64,191 @@
//
// textBoxFileName
//
this.textBoxFileName.Location = new System.Drawing.Point(10, 61);
resources.ApplyResources(this.textBoxFileName, "textBoxFileName");
this.textBoxFileName.Name = "textBoxFileName";
this.textBoxFileName.Size = new System.Drawing.Size(420, 20);
this.textBoxFileName.TabIndex = 1;
this.textBoxFileName.TextChanged += new System.EventHandler(this.TextBoxFileNameTextChanged);
//
// buttonRead
//
this.buttonRead.Location = new System.Drawing.Point(10, 98);
resources.ApplyResources(this.buttonRead, "buttonRead");
this.buttonRead.Name = "buttonRead";
this.buttonRead.Size = new System.Drawing.Size(75, 23);
this.buttonRead.TabIndex = 2;
this.buttonRead.Text = "Read";
this.buttonRead.UseVisualStyleBackColor = true;
this.buttonRead.Click += new System.EventHandler(this.ButtonReadClick);
//
// buttonWrite
//
this.buttonWrite.Location = new System.Drawing.Point(98, 98);
resources.ApplyResources(this.buttonWrite, "buttonWrite");
this.buttonWrite.Name = "buttonWrite";
this.buttonWrite.Size = new System.Drawing.Size(75, 23);
this.buttonWrite.TabIndex = 3;
this.buttonWrite.Text = "Write";
this.buttonWrite.UseVisualStyleBackColor = true;
this.buttonWrite.Click += new System.EventHandler(this.ButtonWriteClick);
//
// buttonExit
//
this.buttonExit.Location = new System.Drawing.Point(275, 98);
resources.ApplyResources(this.buttonExit, "buttonExit");
this.buttonExit.Name = "buttonExit";
this.buttonExit.Size = new System.Drawing.Size(75, 23);
this.buttonExit.TabIndex = 4;
this.buttonExit.Text = "Exit";
this.buttonExit.UseVisualStyleBackColor = true;
this.buttonExit.Click += new System.EventHandler(this.ButtonExitClick);
//
// buttonChooseFile
//
this.buttonChooseFile.Location = new System.Drawing.Point(436, 60);
resources.ApplyResources(this.buttonChooseFile, "buttonChooseFile");
this.buttonChooseFile.Name = "buttonChooseFile";
this.buttonChooseFile.Size = new System.Drawing.Size(25, 20);
this.buttonChooseFile.TabIndex = 5;
this.buttonChooseFile.Text = "...";
this.buttonChooseFile.UseVisualStyleBackColor = true;
this.buttonChooseFile.Click += new System.EventHandler(this.ButtonChooseFileClick);
//
// statusStrip1
//
resources.ApplyResources(this.statusStrip1, "statusStrip1");
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 335);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(620, 22);
this.statusStrip1.TabIndex = 6;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
resources.ApplyResources(this.toolStripStatusLabel1, "toolStripStatusLabel1");
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17);
this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
//
// saveFileDialog1
//
this.saveFileDialog1.AddExtension = false;
this.saveFileDialog1.DefaultExt = "img";
this.saveFileDialog1.Filter = "Image Files (*.img)|*.img|Binary files (*.bin)|*.bin|All files (*.*)|*.*";
resources.ApplyResources(this.saveFileDialog1, "saveFileDialog1");
//
// labelFileName
//
this.labelFileName.AutoSize = true;
this.labelFileName.Location = new System.Drawing.Point(12, 34);
resources.ApplyResources(this.labelFileName, "labelFileName");
this.labelFileName.Name = "labelFileName";
this.labelFileName.Size = new System.Drawing.Size(54, 13);
this.labelFileName.TabIndex = 7;
this.labelFileName.Text = "File Name";
//
// labelDriveTitle
//
this.labelDriveTitle.AutoSize = true;
this.labelDriveTitle.Location = new System.Drawing.Point(466, 34);
resources.ApplyResources(this.labelDriveTitle, "labelDriveTitle");
this.labelDriveTitle.Name = "labelDriveTitle";
this.labelDriveTitle.Size = new System.Drawing.Size(94, 13);
this.labelDriveTitle.TabIndex = 8;
this.labelDriveTitle.Text = "Removable Drives";
//
// buttonCancel
//
this.buttonCancel.Enabled = false;
this.buttonCancel.Location = new System.Drawing.Point(187, 98);
resources.ApplyResources(this.buttonCancel, "buttonCancel");
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 10;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// groupBoxCompression
//
resources.ApplyResources(this.groupBoxCompression, "groupBoxCompression");
this.groupBoxCompression.Controls.Add(this.radioButtonCompNone);
this.groupBoxCompression.Controls.Add(this.radioButtonCompTgz);
this.groupBoxCompression.Controls.Add(this.radioButtonCompGz);
this.groupBoxCompression.Controls.Add(this.radioButtonCompZip);
this.groupBoxCompression.Location = new System.Drawing.Point(33, 132);
this.groupBoxCompression.Name = "groupBoxCompression";
this.groupBoxCompression.Size = new System.Drawing.Size(252, 50);
this.groupBoxCompression.TabIndex = 11;
this.groupBoxCompression.TabStop = false;
this.groupBoxCompression.Text = "Compression";
//
// radioButtonCompNone
//
this.radioButtonCompNone.AutoSize = true;
resources.ApplyResources(this.radioButtonCompNone, "radioButtonCompNone");
this.radioButtonCompNone.Checked = true;
this.radioButtonCompNone.Location = new System.Drawing.Point(170, 19);
this.radioButtonCompNone.Name = "radioButtonCompNone";
this.radioButtonCompNone.Size = new System.Drawing.Size(56, 17);
this.radioButtonCompNone.TabIndex = 3;
this.radioButtonCompNone.TabStop = true;
this.radioButtonCompNone.Text = "NONE";
this.radioButtonCompNone.UseVisualStyleBackColor = true;
this.radioButtonCompNone.CheckedChanged += new System.EventHandler(this.RadioButtonCompNoneCheckedChanged);
//
// radioButtonCompTgz
//
this.radioButtonCompTgz.AutoSize = true;
this.radioButtonCompTgz.Location = new System.Drawing.Point(117, 19);
resources.ApplyResources(this.radioButtonCompTgz, "radioButtonCompTgz");
this.radioButtonCompTgz.Name = "radioButtonCompTgz";
this.radioButtonCompTgz.Size = new System.Drawing.Size(47, 17);
this.radioButtonCompTgz.TabIndex = 2;
this.radioButtonCompTgz.Text = "TGZ";
this.radioButtonCompTgz.UseVisualStyleBackColor = true;
this.radioButtonCompTgz.CheckedChanged += new System.EventHandler(this.RadioButtonCompTgzCheckedChanged);
//
// radioButtonCompGz
//
this.radioButtonCompGz.AutoSize = true;
this.radioButtonCompGz.Location = new System.Drawing.Point(71, 19);
resources.ApplyResources(this.radioButtonCompGz, "radioButtonCompGz");
this.radioButtonCompGz.Name = "radioButtonCompGz";
this.radioButtonCompGz.Size = new System.Drawing.Size(40, 17);
this.radioButtonCompGz.TabIndex = 1;
this.radioButtonCompGz.Text = "GZ";
this.radioButtonCompGz.UseVisualStyleBackColor = true;
this.radioButtonCompGz.CheckedChanged += new System.EventHandler(this.RadioButtonCompGzCheckedChanged);
//
// radioButtonCompZip
//
this.radioButtonCompZip.AutoSize = true;
this.radioButtonCompZip.Location = new System.Drawing.Point(23, 19);
resources.ApplyResources(this.radioButtonCompZip, "radioButtonCompZip");
this.radioButtonCompZip.Name = "radioButtonCompZip";
this.radioButtonCompZip.Size = new System.Drawing.Size(42, 17);
this.radioButtonCompZip.TabIndex = 0;
this.radioButtonCompZip.Text = "ZIP";
this.radioButtonCompZip.UseVisualStyleBackColor = true;
this.radioButtonCompZip.CheckedChanged += new System.EventHandler(this.RadioButtonCompZipCheckedChanged);
//
// menuStripMain
//
resources.ApplyResources(this.menuStripMain, "menuStripMain");
this.menuStripMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.optionsToolStripMenuItem});
this.menuStripMain.Location = new System.Drawing.Point(0, 0);
this.menuStripMain.Name = "menuStripMain";
this.menuStripMain.Size = new System.Drawing.Size(620, 24);
this.menuStripMain.TabIndex = 12;
this.menuStripMain.Text = "menuStrip1";
//
// optionsToolStripMenuItem
//
resources.ApplyResources(this.optionsToolStripMenuItem, "optionsToolStripMenuItem");
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.displayAllDrivesToolStripMenuItem});
this.displayAllDrivesToolStripMenuItem,
this.languageToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
this.optionsToolStripMenuItem.Text = "Options";
//
// displayAllDrivesToolStripMenuItem
//
resources.ApplyResources(this.displayAllDrivesToolStripMenuItem, "displayAllDrivesToolStripMenuItem");
this.displayAllDrivesToolStripMenuItem.CheckOnClick = true;
this.displayAllDrivesToolStripMenuItem.Name = "displayAllDrivesToolStripMenuItem";
this.displayAllDrivesToolStripMenuItem.Size = new System.Drawing.Size(275, 22);
this.displayAllDrivesToolStripMenuItem.Text = "Display All Drives *** DANGEROUS ***";
this.displayAllDrivesToolStripMenuItem.CheckedChanged += new System.EventHandler(this.DisplayAllDrivesToolStripMenuItemCheckedChanged);
//
// languageToolStripMenuItem
//
resources.ApplyResources(this.languageToolStripMenuItem, "languageToolStripMenuItem");
this.languageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.englishToolStripMenuItem,
this.russianToolStripMenuItem});
this.languageToolStripMenuItem.Name = "languageToolStripMenuItem";
//
// englishToolStripMenuItem
//
resources.ApplyResources(this.englishToolStripMenuItem, "englishToolStripMenuItem");
this.englishToolStripMenuItem.Name = "englishToolStripMenuItem";
this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click);
//
// russianToolStripMenuItem
//
resources.ApplyResources(this.russianToolStripMenuItem, "russianToolStripMenuItem");
this.russianToolStripMenuItem.Name = "russianToolStripMenuItem";
this.russianToolStripMenuItem.Click += new System.EventHandler(this.russianToolStripMenuItem_Click);
//
// groupBoxTruncation
//
resources.ApplyResources(this.groupBoxTruncation, "groupBoxTruncation");
this.groupBoxTruncation.Controls.Add(this.checkBoxUseMBR);
this.groupBoxTruncation.Location = new System.Drawing.Point(291, 132);
this.groupBoxTruncation.Name = "groupBoxTruncation";
this.groupBoxTruncation.Size = new System.Drawing.Size(172, 50);
this.groupBoxTruncation.TabIndex = 13;
this.groupBoxTruncation.TabStop = false;
this.groupBoxTruncation.Text = "Image Truncation";
//
// checkBoxUseMBR
//
this.checkBoxUseMBR.AutoSize = true;
this.checkBoxUseMBR.Location = new System.Drawing.Point(23, 19);
resources.ApplyResources(this.checkBoxUseMBR, "checkBoxUseMBR");
this.checkBoxUseMBR.Name = "checkBoxUseMBR";
this.checkBoxUseMBR.Size = new System.Drawing.Size(138, 17);
this.checkBoxUseMBR.TabIndex = 0;
this.checkBoxUseMBR.Text = "Use MBR partition sizes";
this.checkBoxUseMBR.UseVisualStyleBackColor = true;
//
// checkedListBoxDrives
//
resources.ApplyResources(this.checkedListBoxDrives, "checkedListBoxDrives");
this.checkedListBoxDrives.FormattingEnabled = true;
this.checkedListBoxDrives.Location = new System.Drawing.Point(469, 58);
this.checkedListBoxDrives.Name = "checkedListBoxDrives";
this.checkedListBoxDrives.Size = new System.Drawing.Size(139, 124);
this.checkedListBoxDrives.Sorted = true;
this.checkedListBoxDrives.TabIndex = 15;
//
// flowLayoutPanelProgressBars
//
resources.ApplyResources(this.flowLayoutPanelProgressBars, "flowLayoutPanelProgressBars");
this.flowLayoutPanelProgressBars.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanelProgressBars.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanelProgressBars.Location = new System.Drawing.Point(10, 194);
this.flowLayoutPanelProgressBars.Name = "flowLayoutPanelProgressBars";
this.flowLayoutPanelProgressBars.Size = new System.Drawing.Size(211, 137);
this.flowLayoutPanelProgressBars.TabIndex = 16;
//
// flowLayoutPanelProgressLabels
//
resources.ApplyResources(this.flowLayoutPanelProgressLabels, "flowLayoutPanelProgressLabels");
this.flowLayoutPanelProgressLabels.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanelProgressLabels.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanelProgressLabels.Location = new System.Drawing.Point(229, 194);
this.flowLayoutPanelProgressLabels.Name = "flowLayoutPanelProgressLabels";
this.flowLayoutPanelProgressLabels.Size = new System.Drawing.Size(379, 137);
this.flowLayoutPanelProgressLabels.TabIndex = 17;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(620, 357);
this.Controls.Add(this.flowLayoutPanelProgressLabels);
this.Controls.Add(this.flowLayoutPanelProgressBars);
this.Controls.Add(this.checkedListBoxDrives);
@ -314,7 +269,6 @@
this.MaximizeBox = false;
this.Name = "MainForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Disk Imager";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
@ -355,6 +309,9 @@
private System.Windows.Forms.CheckedListBox checkedListBoxDrives;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelProgressBars;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelProgressLabels;
private System.Windows.Forms.ToolStripMenuItem languageToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem englishToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem russianToolStripMenuItem;
}
}

View file

@ -14,13 +14,17 @@ using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
using DynamicDevices.DiskWriter.Detection;
using DynamicDevices.DiskWriter.Win32;
using Microsoft.Win32;
using System.Threading.Tasks;
using DynamicDevices.DiskWriter.Properties;
namespace DynamicDevices.DiskWriter
{
@ -34,11 +38,15 @@ namespace DynamicDevices.DiskWriter
private DriveDetector _watcher = new DriveDetector();
private EnumCompressionType _eCompType;
private CultureInfo CurrentLocale { get; set; }
#endregion
#region Constructor
//var LocRM = new ResourceManager("")
public MainForm()
{
InitializeComponent();
@ -47,10 +55,10 @@ namespace DynamicDevices.DiskWriter
MessageBoxEx.Owner = Handle;
toolStripStatusLabel1.Text = @"Initialised. Licensed under GPLv3. Use at own risk!";
toolStripStatusLabel1.Text = Resources.MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_;
saveFileDialog1.OverwritePrompt = false;
saveFileDialog1.Filter = @"Image Files (*.img,*.bin,*.sdcard)|*.img;*.bin;*.sdcard|Compressed Files (*.zip,*.gz,*tgz)|*.zip;*.gz;*.tgz|All files (*.*)|*.*";
saveFileDialog1.Filter = Resources.MainForm_MainForm_Image_Files__Choose;
// Set version into title
var version = Assembly.GetEntryAssembly().GetName().Version;
@ -128,8 +136,8 @@ namespace DynamicDevices.DiskWriter
if (checkedListBoxDrives.CheckedItems.Count != 1)
{
MessageBox.Show(
@"You can read from only one drive at a time. Please select only one drive from drive list.",
@"*** WARNING ***", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Resources.MainForm_ButtonReadClick_You_can_read_from_only_one_drive_at_a_time,
Resources.MainForm_ButtonReadClick_____WARNING____, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
@ -158,7 +166,7 @@ namespace DynamicDevices.DiskWriter
}
if (!res && !disk.IsCancelling)
{
MessageBoxEx.Show("Problem with reading from disk.", "Read Error",
MessageBoxEx.Show(Resources.MainForm_ButtonReadClick_Problem_with_reading_from_disk_, Resources.MainForm_ButtonReadClick_Read_Error,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
@ -182,8 +190,8 @@ namespace DynamicDevices.DiskWriter
{
var dr =
MessageBox.Show(
@"C: is almost certainly your main hard drive. Writing to this will likely destroy your data, and brick your PC. Are you absolutely sure you want to do this?",
@"*** WARNING ***", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
Resources.MainForm_ButtonWriteClick_C__is_almost_certainly_your_main_HDD,
Resources.MainForm_ButtonReadClick_____WARNING____, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr != DialogResult.Yes)
return;
}
@ -219,7 +227,7 @@ namespace DynamicDevices.DiskWriter
}
if (!res && !disk.IsCancelling)
{
MessageBoxEx.Show("Problem writing to disk. Is it write-protected?", "Write Error",
MessageBoxEx.Show(Resources.MainForm_ButtonWriteClick_Problem_writing_to_disk__Is_it_write_protected_, Resources.MainForm_ButtonWriteClick_Write_Error,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
})).ToArray();
@ -528,5 +536,55 @@ namespace DynamicDevices.DiskWriter
}
#endregion
private void englishToolStripMenuItem_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
ChangeLanguage("en-US");
}
private void russianToolStripMenuItem_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ru-RU");
ChangeLanguage("ru-RU");
}
//change the language in real time
private void ChangeLanguage(string lang)
{
CurrentLocale = new CultureInfo(lang);
var resources = new ComponentResourceManager(typeof (MainForm));
foreach (Control c in Controls)
{
resources.ApplyResources(c, c.Name, CurrentLocale);
RefreshFormResources(c, resources);
}
ChangeMenuStripLanguage(menuStripMain.Items, resources);
toolStripStatusLabel1.Text = Resources.MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_;
saveFileDialog1.Filter = Resources.MainForm_MainForm_Image_Files__Choose;
}
//refresh all menu strip controls recursively
private void ChangeMenuStripLanguage(ToolStripItemCollection collection, ComponentResourceManager resources)
{
foreach (ToolStripItem m in collection)
{
resources.ApplyResources(m, m.Name, CurrentLocale);
var item = m as ToolStripDropDownItem;
if (item != null)
ChangeMenuStripLanguage(item.DropDownItems, resources);
}
}
//refresh all the sub-controls of the form recursively
private void RefreshFormResources(Control ctrl, ComponentResourceManager res)
{
ctrl.SuspendLayout();
res.ApplyResources(ctrl, ctrl.Name, CurrentLocale);
foreach (Control c in ctrl.Controls)
RefreshFormResources(c, res); // recursion
ctrl.ResumeLayout(false);
}
}
}

View file

@ -117,13 +117,613 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="textBoxFileName.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 61</value>
</data>
<data name="textBoxFileName.Size" type="System.Drawing.Size, System.Drawing">
<value>420, 20</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="textBoxFileName.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;textBoxFileName.Name" xml:space="preserve">
<value>textBoxFileName</value>
</data>
<data name="&gt;&gt;textBoxFileName.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxFileName.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;textBoxFileName.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="buttonRead.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 98</value>
</data>
<data name="buttonRead.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="buttonRead.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="buttonRead.Text" xml:space="preserve">
<value>Read</value>
</data>
<data name="&gt;&gt;buttonRead.Name" xml:space="preserve">
<value>buttonRead</value>
</data>
<data name="&gt;&gt;buttonRead.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonRead.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonRead.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="buttonWrite.Location" type="System.Drawing.Point, System.Drawing">
<value>98, 98</value>
</data>
<data name="buttonWrite.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="buttonWrite.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="buttonWrite.Text" xml:space="preserve">
<value>Write</value>
</data>
<data name="&gt;&gt;buttonWrite.Name" xml:space="preserve">
<value>buttonWrite</value>
</data>
<data name="&gt;&gt;buttonWrite.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonWrite.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonWrite.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="buttonExit.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 98</value>
</data>
<data name="buttonExit.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="buttonExit.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="buttonExit.Text" xml:space="preserve">
<value>Exit</value>
</data>
<data name="&gt;&gt;buttonExit.Name" xml:space="preserve">
<value>buttonExit</value>
</data>
<data name="&gt;&gt;buttonExit.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonExit.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonExit.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="buttonChooseFile.Location" type="System.Drawing.Point, System.Drawing">
<value>436, 60</value>
</data>
<data name="buttonChooseFile.Size" type="System.Drawing.Size, System.Drawing">
<value>25, 20</value>
</data>
<data name="buttonChooseFile.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="buttonChooseFile.Text" xml:space="preserve">
<value>...</value>
</data>
<data name="&gt;&gt;buttonChooseFile.Name" xml:space="preserve">
<value>buttonChooseFile</value>
</data>
<data name="&gt;&gt;buttonChooseFile.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonChooseFile.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonChooseFile.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="toolStripStatusLabel1.Size" type="System.Drawing.Size, System.Drawing">
<value>118, 17</value>
</data>
<data name="toolStripStatusLabel1.Text" xml:space="preserve">
<value>toolStripStatusLabel1</value>
</data>
<data name="statusStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 335</value>
</data>
<data name="statusStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>620, 22</value>
</data>
<data name="statusStrip1.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="statusStrip1.Text" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;statusStrip1.Name" xml:space="preserve">
<value>statusStrip1</value>
</data>
<data name="&gt;&gt;statusStrip1.Type" xml:space="preserve">
<value>System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;statusStrip1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;statusStrip1.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>273, 17</value>
</metadata>
<data name="saveFileDialog1.Filter" xml:space="preserve">
<value>Image Files (*.img)|*.img|Binary files (*.bin)|*.bin|All files (*.*)|*.*</value>
</data>
<data name="labelFileName.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelFileName.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 34</value>
</data>
<data name="labelFileName.Size" type="System.Drawing.Size, System.Drawing">
<value>54, 13</value>
</data>
<data name="labelFileName.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="labelFileName.Text" xml:space="preserve">
<value>File Name</value>
</data>
<data name="&gt;&gt;labelFileName.Name" xml:space="preserve">
<value>labelFileName</value>
</data>
<data name="&gt;&gt;labelFileName.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelFileName.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelFileName.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="labelDriveTitle.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelDriveTitle.Location" type="System.Drawing.Point, System.Drawing">
<value>466, 34</value>
</data>
<data name="labelDriveTitle.Size" type="System.Drawing.Size, System.Drawing">
<value>94, 13</value>
</data>
<data name="labelDriveTitle.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="labelDriveTitle.Text" xml:space="preserve">
<value>Removable Drives</value>
</data>
<data name="&gt;&gt;labelDriveTitle.Name" xml:space="preserve">
<value>labelDriveTitle</value>
</data>
<data name="&gt;&gt;labelDriveTitle.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelDriveTitle.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelDriveTitle.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="buttonCancel.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="buttonCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>187, 98</value>
</data>
<data name="buttonCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="buttonCancel.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="buttonCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;buttonCancel.Name" xml:space="preserve">
<value>buttonCancel</value>
</data>
<data name="&gt;&gt;buttonCancel.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonCancel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonCancel.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="radioButtonCompNone.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="radioButtonCompNone.Location" type="System.Drawing.Point, System.Drawing">
<value>170, 19</value>
</data>
<data name="radioButtonCompNone.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 17</value>
</data>
<data name="radioButtonCompNone.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="radioButtonCompNone.Text" xml:space="preserve">
<value>NONE</value>
</data>
<data name="&gt;&gt;radioButtonCompNone.Name" xml:space="preserve">
<value>radioButtonCompNone</value>
</data>
<data name="&gt;&gt;radioButtonCompNone.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;radioButtonCompNone.Parent" xml:space="preserve">
<value>groupBoxCompression</value>
</data>
<data name="&gt;&gt;radioButtonCompNone.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="radioButtonCompTgz.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="radioButtonCompTgz.Location" type="System.Drawing.Point, System.Drawing">
<value>117, 19</value>
</data>
<data name="radioButtonCompTgz.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 17</value>
</data>
<data name="radioButtonCompTgz.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="radioButtonCompTgz.Text" xml:space="preserve">
<value>TGZ</value>
</data>
<data name="&gt;&gt;radioButtonCompTgz.Name" xml:space="preserve">
<value>radioButtonCompTgz</value>
</data>
<data name="&gt;&gt;radioButtonCompTgz.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;radioButtonCompTgz.Parent" xml:space="preserve">
<value>groupBoxCompression</value>
</data>
<data name="&gt;&gt;radioButtonCompTgz.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="radioButtonCompGz.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="radioButtonCompGz.Location" type="System.Drawing.Point, System.Drawing">
<value>71, 19</value>
</data>
<data name="radioButtonCompGz.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 17</value>
</data>
<data name="radioButtonCompGz.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="radioButtonCompGz.Text" xml:space="preserve">
<value>GZ</value>
</data>
<data name="&gt;&gt;radioButtonCompGz.Name" xml:space="preserve">
<value>radioButtonCompGz</value>
</data>
<data name="&gt;&gt;radioButtonCompGz.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;radioButtonCompGz.Parent" xml:space="preserve">
<value>groupBoxCompression</value>
</data>
<data name="&gt;&gt;radioButtonCompGz.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="radioButtonCompZip.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="radioButtonCompZip.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 19</value>
</data>
<data name="radioButtonCompZip.Size" type="System.Drawing.Size, System.Drawing">
<value>42, 17</value>
</data>
<data name="radioButtonCompZip.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="radioButtonCompZip.Text" xml:space="preserve">
<value>ZIP</value>
</data>
<data name="&gt;&gt;radioButtonCompZip.Name" xml:space="preserve">
<value>radioButtonCompZip</value>
</data>
<data name="&gt;&gt;radioButtonCompZip.Type" xml:space="preserve">
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;radioButtonCompZip.Parent" xml:space="preserve">
<value>groupBoxCompression</value>
</data>
<data name="&gt;&gt;radioButtonCompZip.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="groupBoxCompression.Location" type="System.Drawing.Point, System.Drawing">
<value>33, 132</value>
</data>
<data name="groupBoxCompression.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 50</value>
</data>
<data name="groupBoxCompression.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="groupBoxCompression.Text" xml:space="preserve">
<value>Compression</value>
</data>
<data name="&gt;&gt;groupBoxCompression.Name" xml:space="preserve">
<value>groupBoxCompression</value>
</data>
<data name="&gt;&gt;groupBoxCompression.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBoxCompression.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBoxCompression.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<metadata name="menuStripMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>409, 17</value>
</metadata>
<data name="displayAllDrivesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 22</value>
</data>
<data name="displayAllDrivesToolStripMenuItem.Text" xml:space="preserve">
<value>Display All Drives *** DANGEROUS ***</value>
</data>
<data name="englishToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>114, 22</value>
</data>
<data name="englishToolStripMenuItem.Text" xml:space="preserve">
<value>English</value>
</data>
<data name="russianToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>114, 22</value>
</data>
<data name="russianToolStripMenuItem.Text" xml:space="preserve">
<value>Russian</value>
</data>
<data name="languageToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 22</value>
</data>
<data name="languageToolStripMenuItem.Text" xml:space="preserve">
<value>Language</value>
</data>
<data name="optionsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 20</value>
</data>
<data name="optionsToolStripMenuItem.Text" xml:space="preserve">
<value>Options</value>
</data>
<data name="menuStripMain.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="menuStripMain.Size" type="System.Drawing.Size, System.Drawing">
<value>620, 24</value>
</data>
<data name="menuStripMain.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="menuStripMain.Text" xml:space="preserve">
<value>menuStrip1</value>
</data>
<data name="&gt;&gt;menuStripMain.Name" xml:space="preserve">
<value>menuStripMain</value>
</data>
<data name="&gt;&gt;menuStripMain.Type" xml:space="preserve">
<value>System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;menuStripMain.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;menuStripMain.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="checkBoxUseMBR.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="checkBoxUseMBR.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 19</value>
</data>
<data name="checkBoxUseMBR.Size" type="System.Drawing.Size, System.Drawing">
<value>138, 17</value>
</data>
<data name="checkBoxUseMBR.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="checkBoxUseMBR.Text" xml:space="preserve">
<value>Use MBR partition sizes</value>
</data>
<data name="&gt;&gt;checkBoxUseMBR.Name" xml:space="preserve">
<value>checkBoxUseMBR</value>
</data>
<data name="&gt;&gt;checkBoxUseMBR.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;checkBoxUseMBR.Parent" xml:space="preserve">
<value>groupBoxTruncation</value>
</data>
<data name="&gt;&gt;checkBoxUseMBR.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBoxTruncation.Location" type="System.Drawing.Point, System.Drawing">
<value>291, 132</value>
</data>
<data name="groupBoxTruncation.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 50</value>
</data>
<data name="groupBoxTruncation.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="groupBoxTruncation.Text" xml:space="preserve">
<value>Image Truncation</value>
</data>
<data name="&gt;&gt;groupBoxTruncation.Name" xml:space="preserve">
<value>groupBoxTruncation</value>
</data>
<data name="&gt;&gt;groupBoxTruncation.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBoxTruncation.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBoxTruncation.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="checkedListBoxDrives.Location" type="System.Drawing.Point, System.Drawing">
<value>469, 58</value>
</data>
<data name="checkedListBoxDrives.Size" type="System.Drawing.Size, System.Drawing">
<value>139, 124</value>
</data>
<data name="checkedListBoxDrives.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;checkedListBoxDrives.Name" xml:space="preserve">
<value>checkedListBoxDrives</value>
</data>
<data name="&gt;&gt;checkedListBoxDrives.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;checkedListBoxDrives.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;checkedListBoxDrives.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="flowLayoutPanelProgressBars.FlowDirection" type="System.Windows.Forms.FlowDirection, System.Windows.Forms">
<value>TopDown</value>
</data>
<data name="flowLayoutPanelProgressBars.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 194</value>
</data>
<data name="flowLayoutPanelProgressBars.Size" type="System.Drawing.Size, System.Drawing">
<value>211, 137</value>
</data>
<data name="flowLayoutPanelProgressBars.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressBars.Name" xml:space="preserve">
<value>flowLayoutPanelProgressBars</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressBars.Type" xml:space="preserve">
<value>System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressBars.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressBars.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="flowLayoutPanelProgressLabels.FlowDirection" type="System.Windows.Forms.FlowDirection, System.Windows.Forms">
<value>TopDown</value>
</data>
<data name="flowLayoutPanelProgressLabels.Location" type="System.Drawing.Point, System.Drawing">
<value>229, 194</value>
</data>
<data name="flowLayoutPanelProgressLabels.Size" type="System.Drawing.Size, System.Drawing">
<value>379, 137</value>
</data>
<data name="flowLayoutPanelProgressLabels.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressLabels.Name" xml:space="preserve">
<value>flowLayoutPanelProgressLabels</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressLabels.Type" xml:space="preserve">
<value>System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressLabels.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;flowLayoutPanelProgressLabels.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>620, 357</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Disk Imager</value>
</data>
<data name="&gt;&gt;toolStripStatusLabel1.Name" xml:space="preserve">
<value>toolStripStatusLabel1</value>
</data>
<data name="&gt;&gt;toolStripStatusLabel1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;saveFileDialog1.Name" xml:space="preserve">
<value>saveFileDialog1</value>
</data>
<data name="&gt;&gt;saveFileDialog1.Type" xml:space="preserve">
<value>System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;optionsToolStripMenuItem.Name" xml:space="preserve">
<value>optionsToolStripMenuItem</value>
</data>
<data name="&gt;&gt;optionsToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;displayAllDrivesToolStripMenuItem.Name" xml:space="preserve">
<value>displayAllDrivesToolStripMenuItem</value>
</data>
<data name="&gt;&gt;displayAllDrivesToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;languageToolStripMenuItem.Name" xml:space="preserve">
<value>languageToolStripMenuItem</value>
</data>
<data name="&gt;&gt;languageToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;englishToolStripMenuItem.Name" xml:space="preserve">
<value>englishToolStripMenuItem</value>
</data>
<data name="&gt;&gt;englishToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;russianToolStripMenuItem.Name" xml:space="preserve">
<value>russianToolStripMenuItem</value>
</data>
<data name="&gt;&gt;russianToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainForm</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

196
DiskImager/MainForm.ru.resx Normal file
View file

@ -0,0 +1,196 @@
<?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="buttonRead.Text" xml:space="preserve">
<value>Чтение</value>
</data>
<data name="buttonWrite.Text" xml:space="preserve">
<value>Запись</value>
</data>
<data name="buttonExit.Text" xml:space="preserve">
<value>Выход</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="labelFileName.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 13</value>
</data>
<data name="labelFileName.Text" xml:space="preserve">
<value>Имя файла</value>
</data>
<data name="labelDriveTitle.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 13</value>
</data>
<data name="labelDriveTitle.Text" xml:space="preserve">
<value>Диски</value>
</data>
<data name="buttonCancel.Text" xml:space="preserve">
<value>Отмена</value>
</data>
<data name="groupBoxCompression.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 132</value>
</data>
<data name="groupBoxCompression.Text" xml:space="preserve">
<value>Сжатие</value>
</data>
<data name="displayAllDrivesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 22</value>
</data>
<data name="displayAllDrivesToolStripMenuItem.Text" xml:space="preserve">
<value>Показать все диски ***ОПАСНО***</value>
</data>
<data name="englishToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>141, 22</value>
</data>
<data name="englishToolStripMenuItem.Text" xml:space="preserve">
<value>Английский</value>
</data>
<data name="russianToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>141, 22</value>
</data>
<data name="russianToolStripMenuItem.Text" xml:space="preserve">
<value>Русский</value>
</data>
<data name="languageToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>265, 22</value>
</data>
<data name="languageToolStripMenuItem.Text" xml:space="preserve">
<value>Язык</value>
</data>
<data name="optionsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 20</value>
</data>
<data name="optionsToolStripMenuItem.Text" xml:space="preserve">
<value>Опции</value>
</data>
<data name="checkBoxUseMBR.Size" type="System.Drawing.Size, System.Drawing">
<value>126, 17</value>
</data>
<data name="checkBoxUseMBR.Text" xml:space="preserve">
<value>Использовать MBR</value>
</data>
<data name="groupBoxTruncation.Location" type="System.Drawing.Point, System.Drawing">
<value>275, 132</value>
</data>
<data name="groupBoxTruncation.Size" type="System.Drawing.Size, System.Drawing">
<value>188, 50</value>
</data>
<data name="groupBoxTruncation.Text" xml:space="preserve">
<value>Образ логических разделов</value>
</data>
</root>

View file

@ -47,5 +47,5 @@ using System.Runtime.InteropServices;
// 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.0.*")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.1.*")]
[assembly: AssemblyFileVersion("1.2.1.0")]

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34003
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -11,6 +11,7 @@
namespace DynamicDevices.DiskWriter.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -58,5 +59,86 @@ namespace DynamicDevices.DiskWriter.Properties {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to *** WARNING ***.
/// </summary>
internal static string MainForm_ButtonReadClick_____WARNING____ {
get {
return ResourceManager.GetString("MainForm_ButtonReadClick_____WARNING____", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Problem with reading from disk..
/// </summary>
internal static string MainForm_ButtonReadClick_Problem_with_reading_from_disk_ {
get {
return ResourceManager.GetString("MainForm_ButtonReadClick_Problem_with_reading_from_disk_", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Read Error.
/// </summary>
internal static string MainForm_ButtonReadClick_Read_Error {
get {
return ResourceManager.GetString("MainForm_ButtonReadClick_Read_Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can read from only one drive at a time. Please select only one drive from drive list..
/// </summary>
internal static string MainForm_ButtonReadClick_You_can_read_from_only_one_drive_at_a_time {
get {
return ResourceManager.GetString("MainForm_ButtonReadClick_You_can_read_from_only_one_drive_at_a_time", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to C: is almost certainly your main hard drive. Writing to this will likely destroy your data, and brick your PC. Are you absolutely sure you want to do this?.
/// </summary>
internal static string MainForm_ButtonWriteClick_C__is_almost_certainly_your_main_HDD {
get {
return ResourceManager.GetString("MainForm_ButtonWriteClick_C__is_almost_certainly_your_main_HDD", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Problem writing to disk. Is it write-protected?.
/// </summary>
internal static string MainForm_ButtonWriteClick_Problem_writing_to_disk__Is_it_write_protected_ {
get {
return ResourceManager.GetString("MainForm_ButtonWriteClick_Problem_writing_to_disk__Is_it_write_protected_", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Write Error.
/// </summary>
internal static string MainForm_ButtonWriteClick_Write_Error {
get {
return ResourceManager.GetString("MainForm_ButtonWriteClick_Write_Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Image Files (*.img,*.bin,*.sdcard)|*.img;*.bin;*.sdcard|Compressed Files (*.zip,*.gz,*tgz)|*.zip;*.gz;*.tgz|All files (*.*)|*.*.
/// </summary>
internal static string MainForm_MainForm_Image_Files__Choose {
get {
return ResourceManager.GetString("MainForm_MainForm_Image_Files__Choose", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Initialised. Licensed under GPLv3. Use at own risk!.
/// </summary>
internal static string MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_ {
get {
return ResourceManager.GetString("MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_", resourceCulture);
}
}
}
}

View file

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -114,4 +113,31 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_" xml:space="preserve">
<value>Initialised. Licensed under GPLv3. Use at own risk!</value>
</data>
<data name="MainForm_MainForm_Image_Files__Choose" xml:space="preserve">
<value>Image Files (*.img,*.bin,*.sdcard)|*.img;*.bin;*.sdcard|Compressed Files (*.zip,*.gz,*tgz)|*.zip;*.gz;*.tgz|All files (*.*)|*.*</value>
</data>
<data name="MainForm_ButtonReadClick_You_can_read_from_only_one_drive_at_a_time" xml:space="preserve">
<value>You can read from only one drive at a time. Please select only one drive from drive list.</value>
</data>
<data name="MainForm_ButtonReadClick_____WARNING____" xml:space="preserve">
<value>*** WARNING ***</value>
</data>
<data name="MainForm_ButtonReadClick_Problem_with_reading_from_disk_" xml:space="preserve">
<value>Problem with reading from disk.</value>
</data>
<data name="MainForm_ButtonReadClick_Read_Error" xml:space="preserve">
<value>Read Error</value>
</data>
<data name="MainForm_ButtonWriteClick_C__is_almost_certainly_your_main_HDD" xml:space="preserve">
<value>C: is almost certainly your main hard drive. Writing to this will likely destroy your data, and brick your PC. Are you absolutely sure you want to do this?</value>
</data>
<data name="MainForm_ButtonWriteClick_Problem_writing_to_disk__Is_it_write_protected_" xml:space="preserve">
<value>Problem writing to disk. Is it write-protected?</value>
</data>
<data name="MainForm_ButtonWriteClick_Write_Error" xml:space="preserve">
<value>Write Error</value>
</data>
</root>

View file

@ -0,0 +1,147 @@
<?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="MainForm_ButtonReadClick_____WARNING____" xml:space="preserve">
<value>***ВНИМАНИЕ***</value>
</data>
<data name="MainForm_ButtonReadClick_Problem_with_reading_from_disk_" xml:space="preserve">
<value>Проблема при чтении с диска</value>
</data>
<data name="MainForm_ButtonReadClick_Read_Error" xml:space="preserve">
<value>Ошибка чтения</value>
</data>
<data name="MainForm_ButtonReadClick_You_can_read_from_only_one_drive_at_a_time" xml:space="preserve">
<value>Считывать можно только с одного диска одновременно. Пожалуйста, выберите только один диск.</value>
</data>
<data name="MainForm_ButtonWriteClick_C__is_almost_certainly_your_main_HDD" xml:space="preserve">
<value>Диск C: наверняка является основным жёстким диском Вашего компьютера. Запись на этот диск может повредить данные на Вашем компьютере.</value>
</data>
<data name="MainForm_ButtonWriteClick_Problem_writing_to_disk__Is_it_write_protected_" xml:space="preserve">
<value>Ошибка записи на диск. Пожалуйста, проверьте, не защищён ли диск от записи.</value>
</data>
<data name="MainForm_ButtonWriteClick_Write_Error" xml:space="preserve">
<value>Ошибка записи</value>
</data>
<data name="MainForm_MainForm_Image_Files__Choose" xml:space="preserve">
<value>Образы файлов (*.img,*.bin,*.sdcard)|*.img;*.bin;*.sdcard|Сжатые файлы (*.zip,*.gz,*tgz)|*.zip;*.gz;*.tgz|Все файлы (*.*)|*.*</value>
</data>
<data name="MainForm_MainForm_Initialised__Licensed_under_GPLv3__Use_at_own_risk_" xml:space="preserve">
<value>Программа лицензирована GNU GPL v3. Авторы не несут ответственность за ущерб!</value>
</data>
</root>

View file

@ -1,94 +1,94 @@
// GzipInputStream.cs
//
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
// HISTORY
// 2009-08-11 T9121 Geoff Hart Added Multi-member gzip support
// 2012-06-03 Z-1802 Incorrect endianness and subfield in FEXTRA handling.
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.GZip
{
/// <summary>
/// This filter stream is used to decompress a "GZIP" format stream.
/// The "GZIP" format is described baseInputStream RFC 1952.
///
/// author of the original java version : John Leuner
/// </summary>
/// <example> This sample shows how to unzip a gzipped file
/// <code>
/// using System;
/// using System.IO;
///
/// using ICSharpCode.SharpZipLib.Core;
/// using ICSharpCode.SharpZipLib.GZip;
///
/// class MainClass
/// {
/// public static void Main(string[] args)
/// {
/// using (Stream inStream = new GZipInputStream(File.OpenRead(args[0])))
/// using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) {
/// byte[] buffer = new byte[4096];
/// StreamUtils.Copy(inStream, outStream, buffer);
/// }
/// }
/// }
/// </code>
/// </example>
public class GZipInputStream : InflaterInputStream
{
#region Instance Fields
/// <summary>
/// CRC-32 value for uncompressed data
/// </summary>
protected Crc32 crc;
/// <summary>
/// Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data).
/// This is tracked per-block as the file is parsed.
/// </summary>
// GzipInputStream.cs
//
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
// HISTORY
// 2009-08-11 T9121 Geoff Hart Added Multi-member gzip support
// 2012-06-03 Z-1802 Incorrect endianness and subfield in FEXTRA handling.
using System;
using System.IO;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.GZip
{
/// <summary>
/// This filter stream is used to decompress a "GZIP" format stream.
/// The "GZIP" format is described baseInputStream RFC 1952.
///
/// author of the original java version : John Leuner
/// </summary>
/// <example> This sample shows how to unzip a gzipped file
/// <code>
/// using System;
/// using System.IO;
///
/// using ICSharpCode.SharpZipLib.Core;
/// using ICSharpCode.SharpZipLib.GZip;
///
/// class MainClass
/// {
/// public static void Main(string[] args)
/// {
/// using (Stream inStream = new GZipInputStream(File.OpenRead(args[0])))
/// using (FileStream outStream = File.Create(Path.GetFileNameWithoutExtension(args[0]))) {
/// byte[] buffer = new byte[4096];
/// StreamUtils.Copy(inStream, outStream, buffer);
/// }
/// }
/// }
/// </code>
/// </example>
public class GZipInputStream : InflaterInputStream
{
#region Instance Fields
/// <summary>
/// CRC-32 value for uncompressed data
/// </summary>
protected Crc32 crc;
/// <summary>
/// Flag to indicate if we've read the GZIP header yet for the current member (block of compressed data).
/// This is tracked per-block as the file is parsed.
/// </summary>
bool readGZIPHeader;
/// <summary>
@ -101,288 +101,288 @@ namespace ICSharpCode.SharpZipLib.GZip
/// </summary>
private long _length;
private Stream _baseInputStream;
#endregion
#region Constructors
/// <summary>
/// Creates a GZipInputStream with the default buffer size
/// </summary>
/// <param name="baseInputStream">
/// The stream to read compressed data from (baseInputStream GZIP format)
/// </param>
public GZipInputStream(Stream baseInputStream)
private Stream _baseInputStream;
#endregion
#region Constructors
/// <summary>
/// Creates a GZipInputStream with the default buffer size
/// </summary>
/// <param name="baseInputStream">
/// The stream to read compressed data from (baseInputStream GZIP format)
/// </param>
public GZipInputStream(Stream baseInputStream)
: this(baseInputStream, 4096)
{
_baseInputStream = baseInputStream;
}
/// <summary>
/// Creates a GZIPInputStream with the specified buffer size
/// </summary>
/// <param name="baseInputStream">
/// The stream to read compressed data from (baseInputStream GZIP format)
/// </param>
/// <param name="size">
/// Size of the buffer to use
/// </param>
public GZipInputStream(Stream baseInputStream, int size)
: base(baseInputStream, new Inflater(true), size)
}
/// <summary>
/// Creates a GZIPInputStream with the specified buffer size
/// </summary>
/// <param name="baseInputStream">
/// The stream to read compressed data from (baseInputStream GZIP format)
/// </param>
/// <param name="size">
/// Size of the buffer to use
/// </param>
public GZipInputStream(Stream baseInputStream, int size)
: base(baseInputStream, new Inflater(true), size)
{
_baseInputStream = baseInputStream;
}
#endregion
#region Stream overrides
/// <summary>
/// Reads uncompressed data into an array of bytes
/// </summary>
/// <param name="buffer">
/// The buffer to read uncompressed data into
/// </param>
/// <param name="offset">
/// The offset indicating where the data should be placed
/// </param>
/// <param name="count">
/// The number of uncompressed bytes to be read
/// </param>
/// <returns>Returns the number of bytes actually read.</returns>
public override int Read(byte[] buffer, int offset, int count)
{
// A GZIP file can contain multiple blocks of compressed data, although this is quite rare.
// A compressed block could potentially be empty, so we need to loop until we reach EOF or
// we find data.
while (true) {
// If we haven't read the header for this block, read it
if (! readGZIPHeader) {
// Try to read header. If there is no header (0 bytes available), this is EOF. If there is
// an incomplete header, this will throw an exception.
if (! ReadHeader()) {
return 0;
}
}
// Try to read compressed data
int bytesRead = base.Read(buffer, offset, count);
if (bytesRead > 0) {
crc.Update(buffer, offset, bytesRead);
}
// If this is the end of stream, read the footer
if (inf.IsFinished) {
ReadFooter();
}
if (bytesRead > 0) {
return bytesRead;
}
}
}
#endregion
#region Support routines
bool ReadHeader()
{
// Initialize CRC for this block
crc = new Crc32();
// Make sure there is data in file. We can't rely on ReadLeByte() to fill the buffer, as this could be EOF,
// which is fine, but ReadLeByte() throws an exception if it doesn't find data, so we do this part ourselves.
if (inputBuffer.Available <= 0) {
inputBuffer.Fill();
if (inputBuffer.Available <= 0) {
// No header, EOF.
return false;
}
}
// 1. Check the two magic bytes
Crc32 headCRC = new Crc32();
int magic = inputBuffer.ReadLeByte();
if (magic < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(magic);
if (magic != (GZipConstants.GZIP_MAGIC >> 8)) {
throw new GZipException("Error GZIP header, first magic byte doesn't match");
}
//magic = baseInputStream.ReadByte();
magic = inputBuffer.ReadLeByte();
if (magic < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) {
throw new GZipException("Error GZIP header, second magic byte doesn't match");
}
headCRC.Update(magic);
// 2. Check the compression type (must be 8)
int compressionType = inputBuffer.ReadLeByte();
if ( compressionType < 0 ) {
throw new EndOfStreamException("EOS reading GZIP header");
}
if ( compressionType != 8 ) {
throw new GZipException("Error GZIP header, data not in deflate format");
}
headCRC.Update(compressionType);
// 3. Check the flags
int flags = inputBuffer.ReadLeByte();
if (flags < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(flags);
/* This flag byte is divided into individual bits as follows:
bit 0 FTEXT
bit 1 FHCRC
bit 2 FEXTRA
bit 3 FNAME
bit 4 FCOMMENT
bit 5 reserved
bit 6 reserved
bit 7 reserved
*/
// 3.1 Check the reserved bits are zero
if ((flags & 0xE0) != 0) {
throw new GZipException("Reserved flag bits in GZIP header != 0");
}
// 4.-6. Skip the modification time, extra flags, and OS type
for (int i=0; i< 6; i++) {
int readByte = inputBuffer.ReadLeByte();
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 7. Read extra field
if ((flags & GZipConstants.FEXTRA) != 0) {
// XLEN is total length of extra subfields, we will skip them all
int len1, len2;
len1 = inputBuffer.ReadLeByte();
len2 = inputBuffer.ReadLeByte();
if ((len1 < 0) || (len2 < 0)) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(len1);
headCRC.Update(len2);
int extraLen = (len2 << 8) | len1; // gzip is LSB first
for (int i = 0; i < extraLen;i++) {
int readByte = inputBuffer.ReadLeByte();
if (readByte < 0)
{
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
}
// 8. Read file name
if ((flags & GZipConstants.FNAME) != 0) {
int readByte;
while ( (readByte = inputBuffer.ReadLeByte()) > 0) {
headCRC.Update(readByte);
}
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 9. Read comment
if ((flags & GZipConstants.FCOMMENT) != 0) {
int readByte;
while ( (readByte = inputBuffer.ReadLeByte()) > 0) {
headCRC.Update(readByte);
}
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 10. Read header CRC
if ((flags & GZipConstants.FHCRC) != 0) {
int tempByte;
int crcval = inputBuffer.ReadLeByte();
if (crcval < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
tempByte = inputBuffer.ReadLeByte();
if (tempByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
crcval = (crcval << 8) | tempByte;
if (crcval != ((int) headCRC.Value & 0xffff)) {
throw new GZipException("Header CRC value mismatch");
}
}
readGZIPHeader = true;
return true;
}
void ReadFooter()
{
byte[] footer = new byte[8];
// End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator
long bytesRead = inf.TotalOut & 0xffffffff;
inputBuffer.Available += inf.RemainingInput;
inf.Reset();
// Read footer from inputBuffer
int needed = 8;
while (needed > 0) {
int count = inputBuffer.ReadClearTextBuffer(footer, 8 - needed, needed);
if (count <= 0) {
throw new EndOfStreamException("EOS reading GZIP footer");
}
needed -= count; // Jewel Jan 16
}
// Calculate CRC
int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) | ((footer[2] & 0xff) << 16) | (footer[3] << 24);
if (crcval != (int) crc.Value) {
throw new GZipException("GZIP crc sum mismatch, theirs \"" + crcval + "\" and ours \"" + (int) crc.Value);
}
// NOTE The total here is the original total modulo 2 ^ 32.
uint total =
(uint)((uint)footer[4] & 0xff) |
(uint)(((uint)footer[5] & 0xff) << 8) |
(uint)(((uint)footer[6] & 0xff) << 16) |
(uint)((uint)footer[7] << 24);
if (bytesRead != total) {
throw new GZipException("Number of bytes mismatch in footer");
}
// Mark header read as false so if another header exists, we'll continue reading through the file
readGZIPHeader = false;
}
#endregion
#region Stream overrides
/// <summary>
/// Reads uncompressed data into an array of bytes
/// </summary>
/// <param name="buffer">
/// The buffer to read uncompressed data into
/// </param>
/// <param name="offset">
/// The offset indicating where the data should be placed
/// </param>
/// <param name="count">
/// The number of uncompressed bytes to be read
/// </param>
/// <returns>Returns the number of bytes actually read.</returns>
public override int Read(byte[] buffer, int offset, int count)
{
// A GZIP file can contain multiple blocks of compressed data, although this is quite rare.
// A compressed block could potentially be empty, so we need to loop until we reach EOF or
// we find data.
while (true) {
// If we haven't read the header for this block, read it
if (! readGZIPHeader) {
// Try to read header. If there is no header (0 bytes available), this is EOF. If there is
// an incomplete header, this will throw an exception.
if (! ReadHeader()) {
return 0;
}
}
// Try to read compressed data
int bytesRead = base.Read(buffer, offset, count);
if (bytesRead > 0) {
crc.Update(buffer, offset, bytesRead);
}
// If this is the end of stream, read the footer
if (inf.IsFinished) {
ReadFooter();
}
if (bytesRead > 0) {
return bytesRead;
}
}
}
#endregion
#region Support routines
bool ReadHeader()
{
// Initialize CRC for this block
crc = new Crc32();
// Make sure there is data in file. We can't rely on ReadLeByte() to fill the buffer, as this could be EOF,
// which is fine, but ReadLeByte() throws an exception if it doesn't find data, so we do this part ourselves.
if (inputBuffer.Available <= 0) {
inputBuffer.Fill();
if (inputBuffer.Available <= 0) {
// No header, EOF.
return false;
}
}
// 1. Check the two magic bytes
Crc32 headCRC = new Crc32();
int magic = inputBuffer.ReadLeByte();
if (magic < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(magic);
if (magic != (GZipConstants.GZIP_MAGIC >> 8)) {
throw new GZipException("Error GZIP header, first magic byte doesn't match");
}
//magic = baseInputStream.ReadByte();
magic = inputBuffer.ReadLeByte();
if (magic < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
if (magic != (GZipConstants.GZIP_MAGIC & 0xFF)) {
throw new GZipException("Error GZIP header, second magic byte doesn't match");
}
headCRC.Update(magic);
// 2. Check the compression type (must be 8)
int compressionType = inputBuffer.ReadLeByte();
if ( compressionType < 0 ) {
throw new EndOfStreamException("EOS reading GZIP header");
}
if ( compressionType != 8 ) {
throw new GZipException("Error GZIP header, data not in deflate format");
}
headCRC.Update(compressionType);
// 3. Check the flags
int flags = inputBuffer.ReadLeByte();
if (flags < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(flags);
/* This flag byte is divided into individual bits as follows:
bit 0 FTEXT
bit 1 FHCRC
bit 2 FEXTRA
bit 3 FNAME
bit 4 FCOMMENT
bit 5 reserved
bit 6 reserved
bit 7 reserved
*/
// 3.1 Check the reserved bits are zero
if ((flags & 0xE0) != 0) {
throw new GZipException("Reserved flag bits in GZIP header != 0");
}
// 4.-6. Skip the modification time, extra flags, and OS type
for (int i=0; i< 6; i++) {
int readByte = inputBuffer.ReadLeByte();
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 7. Read extra field
if ((flags & GZipConstants.FEXTRA) != 0) {
// XLEN is total length of extra subfields, we will skip them all
int len1, len2;
len1 = inputBuffer.ReadLeByte();
len2 = inputBuffer.ReadLeByte();
if ((len1 < 0) || (len2 < 0)) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(len1);
headCRC.Update(len2);
int extraLen = (len2 << 8) | len1; // gzip is LSB first
for (int i = 0; i < extraLen;i++) {
int readByte = inputBuffer.ReadLeByte();
if (readByte < 0)
{
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
}
// 8. Read file name
if ((flags & GZipConstants.FNAME) != 0) {
int readByte;
while ( (readByte = inputBuffer.ReadLeByte()) > 0) {
headCRC.Update(readByte);
}
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 9. Read comment
if ((flags & GZipConstants.FCOMMENT) != 0) {
int readByte;
while ( (readByte = inputBuffer.ReadLeByte()) > 0) {
headCRC.Update(readByte);
}
if (readByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
headCRC.Update(readByte);
}
// 10. Read header CRC
if ((flags & GZipConstants.FHCRC) != 0) {
int tempByte;
int crcval = inputBuffer.ReadLeByte();
if (crcval < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
tempByte = inputBuffer.ReadLeByte();
if (tempByte < 0) {
throw new EndOfStreamException("EOS reading GZIP header");
}
crcval = (crcval << 8) | tempByte;
if (crcval != ((int) headCRC.Value & 0xffff)) {
throw new GZipException("Header CRC value mismatch");
}
}
readGZIPHeader = true;
return true;
}
void ReadFooter()
{
byte[] footer = new byte[8];
// End of stream; reclaim all bytes from inf, read the final byte count, and reset the inflator
long bytesRead = inf.TotalOut & 0xffffffff;
inputBuffer.Available += inf.RemainingInput;
inf.Reset();
// Read footer from inputBuffer
int needed = 8;
while (needed > 0) {
int count = inputBuffer.ReadClearTextBuffer(footer, 8 - needed, needed);
if (count <= 0) {
throw new EndOfStreamException("EOS reading GZIP footer");
}
needed -= count; // Jewel Jan 16
}
// Calculate CRC
int crcval = (footer[0] & 0xff) | ((footer[1] & 0xff) << 8) | ((footer[2] & 0xff) << 16) | (footer[3] << 24);
if (crcval != (int) crc.Value) {
throw new GZipException("GZIP crc sum mismatch, theirs \"" + crcval + "\" and ours \"" + (int) crc.Value);
}
// NOTE The total here is the original total modulo 2 ^ 32.
uint total =
(uint)((uint)footer[4] & 0xff) |
(uint)(((uint)footer[5] & 0xff) << 8) |
(uint)(((uint)footer[6] & 0xff) << 16) |
(uint)((uint)footer[7] << 24);
if (bytesRead != total) {
throw new GZipException("Number of bytes mismatch in footer");
}
// Mark header read as false so if another header exists, we'll continue reading through the file
readGZIPHeader = false;
}
/// <summary>
@ -432,7 +432,7 @@ namespace ICSharpCode.SharpZipLib.GZip
}
return _length;
}
}
#endregion
}
}
}
#endregion
}
}

View file

@ -6,12 +6,12 @@ A Windows Disk Imager. A C#.NET utility for reading / writing SD cards and USB d
Licensed under GNU General Public License 3.0 or later.
Some rights reserved. See LICENSE, AUTHORS.
The current release can be downloaded here
http://www.dynamicdevices.co.uk/downloads/DiskImager.Installer.msi
The current release can be downloaded [here](https://github.com/RomanBelkov/DiskImager/releases)
or [here (old link)](http://www.dynamicdevices.co.uk/downloads/DiskImager.Installer.msi)
(Please feed back any platform testing you do, or any issues you encounter. Thanks.)
## Description ##
This utility is a C#.NET implementation of Win32DiskImager with a couple of features authors wanted to use:
- writing images to a number of SD cards at once
@ -24,12 +24,13 @@ This utility is a C#.NET implementation of Win32DiskImager with a couple of feat
- it also *might* be slightly faster when dealing with uncompressed read/write
*NOTE This application is under development and could possibly cause damage to your computer drive(s). We cannot take responsibility for any damage caused or losses incurred through use of this utility. Use at own risk!*
*NOTE: This application is under development and could possibly cause damage to your computer drive(s). We cannot take responsibility for any damage caused or losses incurred through use of this utility. Use at own risk!*
Credits: Inspired by the excellent Win32DiskImager.
ChangeLog
=========
## ChangeLog ##
1.2.1 14/01/15 RB Added Russian localization and tweaked GUI a bit.
1.2.0 06/01/15 RB Added ability to write the same image to many SD simultaneously. Changed the look of GUI.