# HG changeset patch # User Ivo Smits # Date 1391811788 -3600 # Node ID 8ac8eb805b6c25f80509ded54651644c17549bd3 Initial commit diff -r 000000000000 -r 8ac8eb805b6c .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,3 @@ +syntax: glob +bin/* +obj/* diff -r 000000000000 -r 8ac8eb805b6c AutoCRCheck.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AutoCRCheck.csproj Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,79 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4B58106F-D9C6-4473-AD83-42ED98E9ECAC} + Exe + Properties + AutoCRCheck + AutoCRCheck + v2.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + Form + + + frmOptions.cs + + + + + frmOptions.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + \ No newline at end of file diff -r 000000000000 -r 8ac8eb805b6c Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Program.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,192 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Windows.Forms; + +namespace AutoCRCheck { + static class Program { + static Boolean DeleteBad = false; + static String RenameBadSuffix = null; + static Boolean WaitOnCompletion = false; + static Boolean PrintMissing = false; + static Boolean PrintMismatch = false; + static UInt32 DirectoriesChecked = 0; + static UInt32 ListsChecked = 0; + static UInt32 FilesMissing = 0; + static UInt32 FilesBad = 0; + static UInt32 FilesGood = 0; + [STAThread] + static int Main(String[] args) { + String rootdirectory = null; + Console.Error.WriteLine("UCIS AutoCRCheck (c) 2014 Ivo Smits "); + Console.Error.WriteLine("See http://wiki.ucis.nl/AutoCRCheck for more information"); + for (int i = 0; i < args.Length; i++) { + if (args[i].StartsWith("-")) { + switch (args[i].Substring(1)) { + case "d": + case "delete": + DeleteBad = true; + break; + case "r": + case "rename": + RenameBadSuffix = args[++i]; + break; + case "w": + case "wait": + WaitOnCompletion = true; + break; + case "printmissing": + PrintMissing = true; + break; + case "p": + case "printmismatch": + PrintMismatch = true; + break; + case "help": + case "h": + PrintCommandlineHelp(Console.Out); + return -1; + default: + Console.Error.WriteLine("Error: unknown command line argument: " + args[i]); + PrintCommandlineHelp(Console.Error); + return -1; + } + } else { + if (rootdirectory != null) { + Console.Error.WriteLine("Error: duplicate root directory specified."); + return -1; + } + rootdirectory = args[i]; + } + } + if (rootdirectory == null) { + Console.Error.WriteLine("Root directory not set, waiting for GUI input..."); + try { + using (new Control()) ; + } catch { + Console.Error.WriteLine("It looks like you're trying to run this application in a non-GUI session. Luckily we're handling this nearly fatal error for you."); + PrintCommandlineHelp(Console.Error); + return -1; + } + using (frmOptions options = new frmOptions()) { + DialogResult result = options.ShowDialog(); + if (result != DialogResult.OK) return -2; + rootdirectory = options.RootDirectory; + DeleteBad = options.MismatchDelete; + RenameBadSuffix = options.MismatchRenameSuffix; + WaitOnCompletion = true; + } + + } + if (!Directory.Exists(rootdirectory)) { + Console.Error.WriteLine("Error: root directory not found."); + return -1; + } + rootdirectory = Path.GetFullPath(rootdirectory); + ScanDirectory(rootdirectory); + String report = String.Format( + "{0} directories scanned.\n{1} .SFV files processed\n{2} files were missing\n{3} files had a mismatching checksum, they have been dealt with.\n{4} files are good", + DirectoriesChecked, ListsChecked, FilesMissing, FilesBad, FilesGood); + Console.Error.WriteLine(report); + Console.Error.WriteLine("Done."); + if (WaitOnCompletion) { + MessageBox.Show("All files have been checked." + Environment.NewLine + report, "UCIS AutoCRCheck", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + return 0; + } + static void PrintCommandlineHelp(TextWriter w) { + w.WriteLine("UCIS AutoCRCheck recursively checks directories for .SFV files and handles mismatching checksums as instructed."); + w.WriteLine("Usage: AutoCRCheck.exe [options] [root directory]"); + w.WriteLine("Possible options:"); + w.WriteLine(" -delete Delete mismatching files"); + w.WriteLine(" -rename [suffix] Rename mismatching files, append [suffix] to filename"); + w.WriteLine(" -printmissing Print full path of missing files"); + w.WriteLine(" -printmismatch Print full path of mismatched files"); + w.WriteLine(" -wait Wait for user input when done"); + w.WriteLine(" -help Display this message"); + w.WriteLine(); + w.WriteLine("Examples:"); + w.WriteLine(" AutoCRCheck.exe . -rename .badcrc"); + w.WriteLine(" AutoCRCheck.exe . -printmismatch > badfiles.txt"); + } + static void ScanDirectory(String dir) { + DirectoriesChecked++; + Console.Error.WriteLine("Directory: {0}", dir); + foreach (String sfv in Directory.GetFiles(dir, "*.sfv")) { + ListsChecked++; + Console.Error.WriteLine("Checksum file: {0}", Path.GetFileName(sfv)); + using (TextReader reader = File.OpenText(Path.Combine(dir, sfv))) { + while (true) { + String line = reader.ReadLine(); + if (line == null) break; + if (line.Length == 0 || line[0] == ';') continue; + int lastspace = line.LastIndexOf(' '); + if (lastspace == -1) continue; + String file = line.Substring(0, lastspace).TrimEnd(' '); + String cksumstr = line.Substring(lastspace); + UInt32 goodcksum; + if (!UInt32.TryParse(cksumstr, NumberStyles.HexNumber, null, out goodcksum)) { + Console.Error.WriteLine("Failed to decode checksum string: {0}", cksumstr); + continue; + } + String filepath = Path.Combine(dir, file); + if (!File.Exists(filepath)) { + FilesMissing++; + Console.Error.WriteLine("File not found: {0}", file); + if (PrintMissing) Console.Out.WriteLine(filepath); + continue; + } + UInt32 realcksum; + Console.Error.Write("Checking file: {0}... ", file); + using (Stream input = File.OpenRead(filepath)) realcksum = CRCCalculate(input); + if (goodcksum != realcksum) { + FilesBad++; + Console.Error.WriteLine("Mismatch."); + if (PrintMismatch) Console.Out.WriteLine(filepath); + if (RenameBadSuffix != null) { + File.Move(filepath, filepath + RenameBadSuffix); + } else if (DeleteBad) { + File.Delete(filepath); + } + } else { + FilesGood++; + Console.Error.WriteLine("Good."); + } + } + } + } + foreach (String subdir in Directory.GetDirectories(dir)) { + ScanDirectory(Path.Combine(dir, subdir)); + } + } + static readonly UInt32[] CRCTable = CRCGenerateTable(); + static UInt32[] CRCGenerateTable() { + UInt32[] table = new UInt32[256]; + for (UInt32 v = 0; v < 256; v++) { + UInt32 e = CRCReflect(v, 8) << 24; + for (int i = 0; i < 8; i++) { + if ((e & 0x80000000L) == 0) e <<= 1; + else e = (e << 1) ^ 0x04C11DB7; + } + table[v] = CRCReflect(e, 32); + } + return table; + } + static UInt32 CRCReflect(UInt32 r, int v) { + UInt32 ret = 0; + for (int i = 1; i < v + 1; i++, r >>= 1) if ((r & 1) != 0) ret |= 1u << (v - i); + return ret; + } + static uint CRCCalculate(Stream input) { + uint c = 0xffffffff; + Byte[] buffer = new Byte[Math.Min(1024, input.Length)]; + while (true) { + int n = input.Read(buffer, 0, buffer.Length); + if (n <= 0) break; + for (int i = 0; i < n; i++) c = CRCTable[(c ^ buffer[i]) & 0xFF] ^ (c >> 8); + } + return c ^ 0xffffffff; + } + } +} diff -r 000000000000 -r 8ac8eb805b6c Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/AssemblyInfo.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("AutoCRCheck")] +[assembly: AssemblyDescription("Automatic recursive .SFV file checker")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("UCIS Internet")] +[assembly: AssemblyProduct("AutoCRCheck")] +[assembly: AssemblyCopyright("Copyright © Ivo Smits 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("512e59c7-986b-488f-b4b6-d9a78e7a5f17")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 000000000000 -r 8ac8eb805b6c Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Resources.Designer.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5472 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AutoCRCheck.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoCRCheck.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff -r 000000000000 -r 8ac8eb805b6c Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Resources.resx Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 8ac8eb805b6c Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Settings.Designer.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5472 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AutoCRCheck.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff -r 000000000000 -r 8ac8eb805b6c Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Properties/Settings.settings Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 000000000000 -r 8ac8eb805b6c frmOptions.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/frmOptions.Designer.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,185 @@ +namespace AutoCRCheck { + partial class frmOptions { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.fbdDirectoryBrowser = new System.Windows.Forms.FolderBrowserDialog(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtRootDirectory = new System.Windows.Forms.TextBox(); + this.btnRootDirectoryBrowse = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.radMismatchRename = new System.Windows.Forms.RadioButton(); + this.radMismatchDelete = new System.Windows.Forms.RadioButton(); + this.radMismatchNoAction = new System.Windows.Forms.RadioButton(); + this.txtMismatchRenameSuffix = new System.Windows.Forms.TextBox(); + this.btnStart = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 65); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(76, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Root directory:"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.Location = new System.Drawing.Point(12, 9); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(518, 50); + this.label2.TabIndex = 1; + this.label2.Text = "UCIS AutoCRCheck will recursively scan specified folder, looking for any .SFV fil" + + "es and checking the CRC checksums for the listed files. Mismatching files can be" + + " deleted or renamed."; + // + // txtRootDirectory + // + this.txtRootDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtRootDirectory.Location = new System.Drawing.Point(94, 62); + this.txtRootDirectory.Name = "txtRootDirectory"; + this.txtRootDirectory.Size = new System.Drawing.Size(396, 20); + this.txtRootDirectory.TabIndex = 2; + // + // btnRootDirectoryBrowse + // + this.btnRootDirectoryBrowse.Location = new System.Drawing.Point(496, 62); + this.btnRootDirectoryBrowse.Name = "btnRootDirectoryBrowse"; + this.btnRootDirectoryBrowse.Size = new System.Drawing.Size(34, 20); + this.btnRootDirectoryBrowse.TabIndex = 3; + this.btnRootDirectoryBrowse.Text = "..."; + this.btnRootDirectoryBrowse.UseVisualStyleBackColor = true; + this.btnRootDirectoryBrowse.Click += new System.EventHandler(this.btnRootDirectoryBrowse_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.radMismatchRename); + this.groupBox1.Controls.Add(this.radMismatchDelete); + this.groupBox1.Controls.Add(this.radMismatchNoAction); + this.groupBox1.Controls.Add(this.txtMismatchRenameSuffix); + this.groupBox1.Location = new System.Drawing.Point(15, 88); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(515, 90); + this.groupBox1.TabIndex = 4; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Mismatching files"; + // + // radMismatchRename + // + this.radMismatchRename.AutoSize = true; + this.radMismatchRename.Location = new System.Drawing.Point(6, 65); + this.radMismatchRename.Name = "radMismatchRename"; + this.radMismatchRename.Size = new System.Drawing.Size(153, 17); + this.radMismatchRename.TabIndex = 3; + this.radMismatchRename.Text = "Rename file, append suffix:"; + this.radMismatchRename.UseVisualStyleBackColor = true; + this.radMismatchRename.CheckedChanged += new System.EventHandler(this.radMismatch_CheckedChanged); + // + // radMismatchDelete + // + this.radMismatchDelete.AutoSize = true; + this.radMismatchDelete.Location = new System.Drawing.Point(6, 42); + this.radMismatchDelete.Name = "radMismatchDelete"; + this.radMismatchDelete.Size = new System.Drawing.Size(72, 17); + this.radMismatchDelete.TabIndex = 2; + this.radMismatchDelete.Text = "Delete file"; + this.radMismatchDelete.UseVisualStyleBackColor = true; + this.radMismatchDelete.CheckedChanged += new System.EventHandler(this.radMismatch_CheckedChanged); + // + // radMismatchNoAction + // + this.radMismatchNoAction.AutoSize = true; + this.radMismatchNoAction.Checked = true; + this.radMismatchNoAction.Location = new System.Drawing.Point(6, 19); + this.radMismatchNoAction.Name = "radMismatchNoAction"; + this.radMismatchNoAction.Size = new System.Drawing.Size(77, 17); + this.radMismatchNoAction.TabIndex = 1; + this.radMismatchNoAction.TabStop = true; + this.radMismatchNoAction.Text = "Do nothing"; + this.radMismatchNoAction.UseVisualStyleBackColor = true; + this.radMismatchNoAction.CheckedChanged += new System.EventHandler(this.radMismatch_CheckedChanged); + // + // txtMismatchRenameSuffix + // + this.txtMismatchRenameSuffix.Enabled = false; + this.txtMismatchRenameSuffix.Location = new System.Drawing.Point(165, 64); + this.txtMismatchRenameSuffix.Name = "txtMismatchRenameSuffix"; + this.txtMismatchRenameSuffix.Size = new System.Drawing.Size(100, 20); + this.txtMismatchRenameSuffix.TabIndex = 0; + this.txtMismatchRenameSuffix.Text = ".badcrc"; + // + // btnStart + // + this.btnStart.Location = new System.Drawing.Point(455, 184); + this.btnStart.Name = "btnStart"; + this.btnStart.Size = new System.Drawing.Size(75, 23); + this.btnStart.TabIndex = 5; + this.btnStart.Text = "Start"; + this.btnStart.UseVisualStyleBackColor = true; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // + // frmOptions + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(542, 213); + this.Controls.Add(this.btnStart); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.btnRootDirectoryBrowse); + this.Controls.Add(this.txtRootDirectory); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmOptions"; + this.Text = "UCIS AutoCRCheck options"; + this.Load += new System.EventHandler(this.Form1_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.FolderBrowserDialog fbdDirectoryBrowser; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtRootDirectory; + private System.Windows.Forms.Button btnRootDirectoryBrowse; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.RadioButton radMismatchRename; + private System.Windows.Forms.RadioButton radMismatchDelete; + private System.Windows.Forms.RadioButton radMismatchNoAction; + private System.Windows.Forms.TextBox txtMismatchRenameSuffix; + private System.Windows.Forms.Button btnStart; + } +} \ No newline at end of file diff -r 000000000000 -r 8ac8eb805b6c frmOptions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/frmOptions.cs Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,37 @@ +using System; +using System.IO; +using System.Windows.Forms; + +namespace AutoCRCheck { + public partial class frmOptions : Form { + public frmOptions() { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) { + txtRootDirectory.Text = Environment.CurrentDirectory; + } + + private void radMismatch_CheckedChanged(object sender, EventArgs e) { + txtMismatchRenameSuffix.Enabled = radMismatchRename.Checked; + } + + private void btnStart_Click(object sender, EventArgs e) { + DialogResult = DialogResult.OK; + Close(); + } + + private void btnRootDirectoryBrowse_Click(object sender, EventArgs e) { + fbdDirectoryBrowser.Description = "Select root directory"; + if (Directory.Exists(txtRootDirectory.Text)) fbdDirectoryBrowser.SelectedPath = txtRootDirectory.Text; + fbdDirectoryBrowser.ShowNewFolderButton = false; + if (fbdDirectoryBrowser.ShowDialog() == DialogResult.OK) { + txtRootDirectory.Text = fbdDirectoryBrowser.SelectedPath; + } + } + + public String RootDirectory { get { return txtRootDirectory.Text; } } + public Boolean MismatchDelete { get { return radMismatchDelete.Checked; } } + public String MismatchRenameSuffix { get { return radMismatchRename.Checked ? txtMismatchRenameSuffix.Text : null; } } + } +} diff -r 000000000000 -r 8ac8eb805b6c frmOptions.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/frmOptions.resx Fri Feb 07 23:23:08 2014 +0100 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file