diff --git a/.gitignore b/.gitignore index f2b4073..81d4c76 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ /bin /obj /*.user -/Properties/PublishProfiles/*.user \ No newline at end of file +/*/.vs +/*/bin +/*/obj +/*/*.user \ No newline at end of file diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 2173a08..0e4c15d 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -29,424 +29,458 @@ namespace RandomFileRunner /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.button2 = new RyzStudio.Windows.ThemedForms.TButton(); - this.label9 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); - this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); - this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - this.addDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TClearableTextBox(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.button4 = new RyzStudio.Windows.ThemedForms.TButton(); - this.button3 = new RyzStudio.Windows.ThemedForms.TMenuButton(); - this.memoBox1 = new RyzStudio.Windows.ThemedForms.TMemoBox(); - this.button5 = new RyzStudio.Windows.ThemedForms.TButton(); - this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); - this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.menuStrip1.SuspendLayout(); - this.contextMenuStrip1.SuspendLayout(); - this.SuspendLayout(); + pictureBox1 = new System.Windows.Forms.PictureBox(); + toolTip1 = new System.Windows.Forms.ToolTip(components); + button2 = new RyzStudio.Windows.ThemedForms.ThButton(); + label9 = new System.Windows.Forms.Label(); + menuStrip1 = new System.Windows.Forms.MenuStrip(); + fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem13 = new System.Windows.Forms.ToolStripSeparator(); + saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); + exitToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); + aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + label1 = new System.Windows.Forms.Label(); + button1 = new RyzStudio.Windows.ThemedForms.ThButton(); + tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + textBox1 = new RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox(); + tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + button5 = new RyzStudio.Windows.ThemedForms.ThButton(); + openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); + saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + progressBar2 = new RyzStudio.Windows.ThemedForms.ThProgressBar(); + progressBar1 = new RyzStudio.Windows.ThemedForms.ThProgressBar(); + label3 = new System.Windows.Forms.Label(); + label4 = new System.Windows.Forms.Label(); + tHorizontalSeparator3 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + label2 = new System.Windows.Forms.Label(); + textBox2 = new RyzStudio.Windows.ThemedForms.ThButtonTextBox(); + button4 = new RyzStudio.Windows.ThemedForms.ThButton(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); + menuStrip1.SuspendLayout(); + SuspendLayout(); // // pictureBox1 // - this.pictureBox1.ErrorImage = null; - this.pictureBox1.InitialImage = null; - this.pictureBox1.Location = new System.Drawing.Point(81, 79); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(33, 33); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; - this.pictureBox1.TabIndex = 15; - this.pictureBox1.TabStop = false; + pictureBox1.ErrorImage = null; + pictureBox1.InitialImage = null; + pictureBox1.Location = new System.Drawing.Point(289, 121); + pictureBox1.Name = "pictureBox1"; + pictureBox1.Size = new System.Drawing.Size(33, 33); + pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + pictureBox1.TabIndex = 15; + pictureBox1.TabStop = false; // // button2 // - this.button2.ActiveImage = null; - this.button2.BackColor = System.Drawing.Color.Transparent; - this.button2.HoverImage = null; - this.button2.IdleImage = null; - this.button2.LabelText = "&Search"; - this.button2.Location = new System.Drawing.Point(127, 79); - this.button2.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button2.Name = "button2"; - this.button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button2.Size = new System.Drawing.Size(149, 33); - this.button2.TabIndex = 1; - this.button2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button2_MouseClick); + button2.AcceptButton = null; + button2.ActiveImage = null; + button2.BackColor = System.Drawing.Color.Transparent; + button2.EnableMenuOnClick = false; + button2.EnableReactiveVisual = true; + button2.HoverImage = null; + button2.IdleImage = null; + button2.LabelText = "&Search"; + button2.Location = new System.Drawing.Point(127, 121); + button2.Margin = new System.Windows.Forms.Padding(10, 0, 10, 10); + button2.Name = "button2"; + button2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + button2.Size = new System.Drawing.Size(149, 33); + button2.TabIndex = 1; + button2.TabStop = false; + button2.MouseClick += button2_MouseClick; // // label9 // - this.label9.Location = new System.Drawing.Point(13, 36); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(101, 33); - this.label9.TabIndex = 27; - this.label9.Text = "Search Filter"; - this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // 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(289, 81); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(156, 31); - this.label2.TabIndex = 30; - this.label2.Text = "0"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label9.Location = new System.Drawing.Point(13, 78); + label9.Name = "label9"; + label9.Size = new System.Drawing.Size(101, 33); + label9.TabIndex = 27; + label9.Text = "Search Pattern"; + label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // menuStrip1 // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.toolsToolStripMenuItem, - this.helpToolStripMenuItem1}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(464, 24); - this.menuStrip1.TabIndex = 32; + menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem1 }); + menuStrip1.Location = new System.Drawing.Point(0, 0); + menuStrip1.Name = "menuStrip1"; + menuStrip1.Size = new System.Drawing.Size(464, 24); + menuStrip1.TabIndex = 32; // // fileToolStripMenuItem // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.newToolStripMenuItem, - this.openToolStripMenuItem, - this.toolStripMenuItem13, - this.saveAsToolStripMenuItem, - this.toolStripMenuItem15, - this.exitToolStripMenuItem2}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; + fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, toolStripMenuItem13, saveAsToolStripMenuItem, toolStripMenuItem15, exitToolStripMenuItem2 }); + fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + fileToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // - this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.newToolStripMenuItem.Text = "&New"; - this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); + newToolStripMenuItem.Name = "newToolStripMenuItem"; + newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N; + newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + newToolStripMenuItem.Text = "&New"; + newToolStripMenuItem.Click += newToolStripMenuItem_Click; // // openToolStripMenuItem // - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.openToolStripMenuItem.Text = "&Open"; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + openToolStripMenuItem.Name = "openToolStripMenuItem"; + openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O; + openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + openToolStripMenuItem.Text = "&Open"; + openToolStripMenuItem.Click += openToolStripMenuItem_Click; // // toolStripMenuItem13 // - this.toolStripMenuItem13.Name = "toolStripMenuItem13"; - this.toolStripMenuItem13.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem13.Name = "toolStripMenuItem13"; + toolStripMenuItem13.Size = new System.Drawing.Size(143, 6); // // saveAsToolStripMenuItem // - this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); - this.saveAsToolStripMenuItem.Text = "Save &As..."; - this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); + saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; + saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); + saveAsToolStripMenuItem.Text = "Save &As..."; + saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click; // // toolStripMenuItem15 // - this.toolStripMenuItem15.Name = "toolStripMenuItem15"; - this.toolStripMenuItem15.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem15.Name = "toolStripMenuItem15"; + toolStripMenuItem15.Size = new System.Drawing.Size(143, 6); // // exitToolStripMenuItem2 // - this.exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; - this.exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); - this.exitToolStripMenuItem2.Text = "E&xit"; - this.exitToolStripMenuItem2.Click += new System.EventHandler(this.exitToolStripMenuItem2_Click); + exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; + exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); + exitToolStripMenuItem2.Text = "E&xit"; + exitToolStripMenuItem2.Click += exitToolStripMenuItem2_Click; // // toolsToolStripMenuItem // - this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.optionsToolStripMenuItem}); - this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); - this.toolsToolStripMenuItem.Text = "&Tools"; + toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { optionsToolStripMenuItem }); + toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); + toolsToolStripMenuItem.Text = "&Tools"; // // optionsToolStripMenuItem // - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12))); - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22); - this.optionsToolStripMenuItem.Text = "&Options"; - this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); + optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12; + optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22); + optionsToolStripMenuItem.Text = "&Options"; + optionsToolStripMenuItem.Click += optionsToolStripMenuItem_Click; // // helpToolStripMenuItem1 // - this.helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.viewHelpToolStripMenuItem1, - this.toolStripMenuItem16, - this.aboutToolStripMenuItem1}); - this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; - this.helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem1.Text = "&Help"; + helpToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { viewHelpToolStripMenuItem1, toolStripMenuItem16, aboutToolStripMenuItem1 }); + helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; + helpToolStripMenuItem1.Size = new System.Drawing.Size(44, 20); + helpToolStripMenuItem1.Text = "&Help"; // // viewHelpToolStripMenuItem1 // - this.viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; - this.viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; - this.viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); - this.viewHelpToolStripMenuItem1.Text = "&View Help"; - this.viewHelpToolStripMenuItem1.Click += new System.EventHandler(this.viewHelpToolStripMenuItem1_Click); + viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; + viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; + viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + viewHelpToolStripMenuItem1.Text = "&View Help"; + viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click; // // toolStripMenuItem16 // - this.toolStripMenuItem16.Name = "toolStripMenuItem16"; - this.toolStripMenuItem16.Size = new System.Drawing.Size(143, 6); + toolStripMenuItem16.Name = "toolStripMenuItem16"; + toolStripMenuItem16.Size = new System.Drawing.Size(143, 6); // // aboutToolStripMenuItem1 // - this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; - this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); - this.aboutToolStripMenuItem1.Text = "&About"; - this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); - // - // contextMenuStrip1 - // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addDirectoryToolStripMenuItem, - this.addFileToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(148, 48); - // - // addDirectoryToolStripMenuItem - // - this.addDirectoryToolStripMenuItem.Name = "addDirectoryToolStripMenuItem"; - this.addDirectoryToolStripMenuItem.Size = new System.Drawing.Size(147, 22); - this.addDirectoryToolStripMenuItem.Text = "&Add Directory"; - this.addDirectoryToolStripMenuItem.Click += new System.EventHandler(this.addDirectoryToolStripMenuItem_Click); - // - // addFileToolStripMenuItem - // - this.addFileToolStripMenuItem.Name = "addFileToolStripMenuItem"; - this.addFileToolStripMenuItem.Size = new System.Drawing.Size(147, 22); - this.addFileToolStripMenuItem.Text = "Add &File"; - this.addFileToolStripMenuItem.Click += new System.EventHandler(this.addFileToolStripMenuItem_Click); - // - // folderBrowserDialog1 - // - this.folderBrowserDialog1.ShowNewFolderButton = false; - // - // openFileDialog1 - // - this.openFileDialog1.Filter = "All files (*.*)|*.*"; + aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; + aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); + aboutToolStripMenuItem1.Text = "&About"; + aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click; // // label1 // - this.label1.Location = new System.Drawing.Point(13, 154); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(101, 33); - this.label1.TabIndex = 40; - this.label1.Text = "Search Paths"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label1.Location = new System.Drawing.Point(13, 36); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(101, 33); + label1.TabIndex = 40; + label1.Text = "Search Path"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // button1 // - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&Close"; - this.button1.Location = new System.Drawing.Point(296, 705); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(149, 37); - this.button1.TabIndex = 6; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); + button1.AcceptButton = null; + button1.ActiveImage = null; + button1.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + button1.BackColor = System.Drawing.Color.Transparent; + button1.EnableMenuOnClick = false; + button1.EnableReactiveVisual = true; + button1.HoverImage = null; + button1.IdleImage = null; + button1.LabelText = "&Close"; + button1.Location = new System.Drawing.Point(296, 545); + button1.Margin = new System.Windows.Forms.Padding(10, 0, 10, 10); + button1.Name = "button1"; + button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + button1.Size = new System.Drawing.Size(149, 37); + button1.TabIndex = 6; + button1.TabStop = false; + button1.MouseClick += button1_MouseClick; // // tHorizontalSeparator2 // - this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator2.Location = new System.Drawing.Point(8, 673); - this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(5760, 22); - this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator2.Name = "tHorizontalSeparator2"; - this.tHorizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator2.Size = new System.Drawing.Size(448, 22); - this.tHorizontalSeparator2.TabIndex = 42; - this.tHorizontalSeparator2.TabStop = false; + tHorizontalSeparator2.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator2.Location = new System.Drawing.Point(8, 513); + tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(0, 10, 0, 0); + tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(5760, 22); + tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator2.Name = "tHorizontalSeparator2"; + tHorizontalSeparator2.Size = new System.Drawing.Size(448, 22); + tHorizontalSeparator2.TabIndex = 42; + tHorizontalSeparator2.TabStop = false; // // textBox1 // - this.textBox1.AcceptButton = null; - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox1.HighlightImage = null; - this.textBox1.Location = new System.Drawing.Point(127, 36); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.NormalImage = null; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 9, 9, 9); - this.textBox1.Size = new System.Drawing.Size(318, 34); - this.textBox1.TabIndex = 0; - this.textBox1.UseSystemPasswordChar = false; + textBox1.AcceptButton = null; + textBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + textBox1.BackColor = System.Drawing.Color.Transparent; + textBox1.ClearedValue = ""; + textBox1.EnableReactiveVisual = true; + textBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + textBox1.HighlightImage = (System.Drawing.Image)resources.GetObject("textBox1.HighlightImage"); + textBox1.Location = new System.Drawing.Point(127, 78); + textBox1.Margin = new System.Windows.Forms.Padding(10, 10, 10, 0); + textBox1.Name = "textBox1"; + textBox1.NormalImage = (System.Drawing.Image)resources.GetObject("textBox1.NormalImage"); + textBox1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + textBox1.Size = new System.Drawing.Size(318, 32); + textBox1.TabIndex = 0; + textBox1.TabStop = false; + textBox1.UseSystemPasswordChar = false; // // tHorizontalSeparator1 // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(8, 122); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(5760, 22); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.Size = new System.Drawing.Size(448, 22); - this.tHorizontalSeparator1.TabIndex = 45; - this.tHorizontalSeparator1.TabStop = false; - // - // button4 - // - this.button4.ActiveImage = null; - this.button4.BackColor = System.Drawing.Color.Transparent; - this.button4.HoverImage = null; - this.button4.IdleImage = null; - this.button4.LabelText = "&Clear"; - this.button4.Location = new System.Drawing.Point(296, 154); - this.button4.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button4.Name = "button4"; - this.button4.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button4.Size = new System.Drawing.Size(149, 33); - this.button4.TabIndex = 3; - this.button4.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button4_MouseClick); - // - // button3 - // - this.button3.ActiveImage = null; - this.button3.BackColor = System.Drawing.Color.Transparent; - this.button3.ContextMenuStrip = this.contextMenuStrip1; - this.button3.HoverImage = null; - this.button3.IdleImage = null; - this.button3.LabelText = "&Add"; - this.button3.Location = new System.Drawing.Point(127, 154); - this.button3.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button3.Name = "button3"; - this.button3.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button3.Size = new System.Drawing.Size(149, 33); - this.button3.TabIndex = 2; - // - // memoBox1 - // - this.memoBox1.AllowDrop = true; - this.memoBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.memoBox1.BackColor = System.Drawing.Color.Transparent; - this.memoBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.memoBox1.Location = new System.Drawing.Point(13, 203); - this.memoBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); - this.memoBox1.Name = "memoBox1"; - this.memoBox1.Padding = new System.Windows.Forms.Padding(10, 10, 3, 9); - this.memoBox1.ReadOnly = false; - this.memoBox1.Size = new System.Drawing.Size(432, 464); - this.memoBox1.TabIndex = 4; - this.memoBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.memoBox1_DragDrop); - this.memoBox1.DragOver += new System.Windows.Forms.DragEventHandler(this.memoBox1_DragOver); + tHorizontalSeparator1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator1.Location = new System.Drawing.Point(8, 164); + tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(0, 10, 0, 0); + tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(5760, 22); + tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator1.Name = "tHorizontalSeparator1"; + tHorizontalSeparator1.Size = new System.Drawing.Size(448, 22); + tHorizontalSeparator1.TabIndex = 45; + tHorizontalSeparator1.TabStop = false; // // button5 // - this.button5.ActiveImage = null; - this.button5.BackColor = System.Drawing.Color.Transparent; - this.button5.HoverImage = null; - this.button5.IdleImage = null; - this.button5.LabelText = "&Run Next"; - this.button5.Location = new System.Drawing.Point(127, 705); - this.button5.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button5.Name = "button5"; - this.button5.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button5.Size = new System.Drawing.Size(149, 37); - this.button5.TabIndex = 5; - this.button5.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button5_MouseClick); + button5.AcceptButton = null; + button5.ActiveImage = null; + button5.BackColor = System.Drawing.Color.Transparent; + button5.EnableMenuOnClick = false; + button5.EnableReactiveVisual = true; + button5.HoverImage = null; + button5.IdleImage = null; + button5.LabelText = "&Run Next"; + button5.Location = new System.Drawing.Point(127, 309); + button5.Margin = new System.Windows.Forms.Padding(10, 0, 10, 10); + button5.Name = "button5"; + button5.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + button5.Size = new System.Drawing.Size(149, 33); + button5.TabIndex = 5; + button5.TabStop = false; + button5.MouseClick += button5_MouseClick; // // openFileDialog2 // - this.openFileDialog2.DefaultExt = "jsonfig"; - this.openFileDialog2.Filter = "Session files (*.jsonfig)|*.jsonfig"; + openFileDialog2.DefaultExt = "jsonfig"; + openFileDialog2.Filter = "Session files (*.jsonfig)|*.jsonfig"; // // saveFileDialog1 // - this.saveFileDialog1.DefaultExt = "jsonfig"; - this.saveFileDialog1.Filter = "Session files (*.jsonfig)|*.jsonfig"; + saveFileDialog1.DefaultExt = "jsonfig"; + saveFileDialog1.Filter = "Session files (*.jsonfig)|*.jsonfig"; + // + // progressBar2 + // + progressBar2.AcceptButton = null; + progressBar2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + progressBar2.BackColor = System.Drawing.Color.Transparent; + progressBar2.BarColour = System.Drawing.Color.FromArgb(79, 193, 203); + progressBar2.BarTextColour = System.Drawing.Color.Black; + progressBar2.EnableReactiveVisual = false; + progressBar2.Font = new System.Drawing.Font("Segoe UI", 9F); + progressBar2.Location = new System.Drawing.Point(127, 215); + progressBar2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + progressBar2.Maximum = 100; + progressBar2.Minimum = 0; + progressBar2.Name = "progressBar2"; + progressBar2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + progressBar2.ProgressText = "50/100"; + progressBar2.ShowProgressText = true; + progressBar2.Size = new System.Drawing.Size(318, 20); + progressBar2.TabIndex = 46; + progressBar2.TabStop = false; + progressBar2.Value = 50; + // + // progressBar1 + // + progressBar1.AcceptButton = null; + progressBar1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + progressBar1.BackColor = System.Drawing.Color.Transparent; + progressBar1.BarColour = System.Drawing.Color.FromArgb(79, 202, 130); + progressBar1.BarTextColour = System.Drawing.Color.Black; + progressBar1.EnableReactiveVisual = false; + progressBar1.Font = new System.Drawing.Font("Segoe UI", 9F); + progressBar1.Location = new System.Drawing.Point(127, 192); + progressBar1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6); + progressBar1.Maximum = 100; + progressBar1.Minimum = 0; + progressBar1.Name = "progressBar1"; + progressBar1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + progressBar1.ProgressText = "50/100"; + progressBar1.ShowProgressText = true; + progressBar1.Size = new System.Drawing.Size(318, 20); + progressBar1.TabIndex = 47; + progressBar1.TabStop = false; + progressBar1.Value = 50; + // + // label3 + // + label3.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + label3.AutoEllipsis = true; + label3.Location = new System.Drawing.Point(127, 256); + label3.Margin = new System.Windows.Forms.Padding(0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(318, 15); + label3.TabIndex = 49; + label3.Text = "label3"; + // + // label4 + // + label4.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + label4.Location = new System.Drawing.Point(127, 241); + label4.Margin = new System.Windows.Forms.Padding(0); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(318, 15); + label4.TabIndex = 48; + label4.Text = "label4"; + // + // tHorizontalSeparator3 + // + tHorizontalSeparator3.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator3.Location = new System.Drawing.Point(8, 281); + tHorizontalSeparator3.Margin = new System.Windows.Forms.Padding(0, 10, 0, 0); + tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(5760, 22); + tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator3.Name = "tHorizontalSeparator3"; + tHorizontalSeparator3.Size = new System.Drawing.Size(448, 22); + tHorizontalSeparator3.TabIndex = 50; + tHorizontalSeparator3.TabStop = false; + // + // label2 + // + label2.Location = new System.Drawing.Point(13, 192); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(101, 33); + label2.TabIndex = 51; + label2.Text = "Search Engine"; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBox2 + // + textBox2.AcceptButton = null; + textBox2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right; + textBox2.BackColor = System.Drawing.Color.Transparent; + textBox2.EnableReactiveVisual = true; + textBox2.Font = new System.Drawing.Font("Segoe UI", 9F); + textBox2.HighlightImage = null; + textBox2.Location = new System.Drawing.Point(127, 36); + textBox2.Margin = new System.Windows.Forms.Padding(10, 10, 10, 0); + textBox2.Name = "textBox2"; + textBox2.NormalImage = null; + textBox2.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + textBox2.Size = new System.Drawing.Size(318, 32); + textBox2.TabIndex = 52; + textBox2.TabStop = false; + textBox2.UseSystemPasswordChar = false; + textBox2.OnButtonClick += textBox2_OnButtonClick; + // + // button4 + // + button4.AcceptButton = null; + button4.ActiveImage = null; + button4.BackColor = System.Drawing.Color.Transparent; + button4.EnableMenuOnClick = false; + button4.EnableReactiveVisual = true; + button4.HoverImage = null; + button4.IdleImage = null; + button4.LabelText = "Save File &List"; + button4.Location = new System.Drawing.Point(296, 309); + button4.Margin = new System.Windows.Forms.Padding(10, 0, 10, 10); + button4.Name = "button4"; + button4.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); + button4.Size = new System.Drawing.Size(149, 33); + button4.TabIndex = 53; + button4.TabStop = false; + button4.MouseClick += button4_MouseClick; // // MainForm // - this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); - this.ClientSize = new System.Drawing.Size(464, 761); - this.Controls.Add(this.button5); - this.Controls.Add(this.memoBox1); - this.Controls.Add(this.button3); - this.Controls.Add(this.button4); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.tHorizontalSeparator2); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.Controls.Add(this.menuStrip1); - this.Controls.Add(this.label2); - this.Controls.Add(this.label9); - this.Controls.Add(this.pictureBox1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "MainForm"; - this.Text = "Random File Runner"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.contextMenuStrip1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - + AllowDrop = true; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + BackColor = System.Drawing.Color.FromArgb(250, 250, 250); + ClientSize = new System.Drawing.Size(464, 601); + Controls.Add(button4); + Controls.Add(textBox2); + Controls.Add(label2); + Controls.Add(tHorizontalSeparator3); + Controls.Add(label3); + Controls.Add(label4); + Controls.Add(progressBar2); + Controls.Add(progressBar1); + Controls.Add(button5); + Controls.Add(tHorizontalSeparator1); + Controls.Add(textBox1); + Controls.Add(button2); + Controls.Add(tHorizontalSeparator2); + Controls.Add(button1); + Controls.Add(label1); + Controls.Add(menuStrip1); + Controls.Add(label9); + Controls.Add(pictureBox1); + Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); + MinimumSize = new System.Drawing.Size(480, 480); + Name = "MainForm"; + Text = "Random File Runner"; + ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); } #endregion - private RyzStudio.Windows.ThemedForms.TButton button1; + private RyzStudio.Windows.ThemedForms.ThButton button1; private System.Windows.Forms.PictureBox pictureBox1; - private RyzStudio.Windows.ThemedForms.TButton button2; + private RyzStudio.Windows.ThemedForms.ThButton button2; private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.Label label9; - private RyzStudio.Windows.ThemedForms.TButton button4; - private System.Windows.Forms.Label label2; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; @@ -461,20 +495,21 @@ namespace RandomFileRunner private System.Windows.Forms.ToolStripMenuItem viewHelpToolStripMenuItem1; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem16; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1; - private RyzStudio.Windows.ThemedForms.TMemoBox memoBox1; - private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; - private System.Windows.Forms.ToolStripMenuItem addDirectoryToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem addFileToolStripMenuItem; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; - private System.Windows.Forms.OpenFileDialog openFileDialog1; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; private System.Windows.Forms.Label label1; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2; - private RyzStudio.Windows.ThemedForms.TClearableTextBox textBox1; - private RyzStudio.Windows.ThemedForms.TMenuButton button3; - private RyzStudio.Windows.ThemedForms.TButton button5; + private RyzStudio.Windows.ThemedForms.ButtonTextBox.ThClearableTextBox textBox1; + private RyzStudio.Windows.ThemedForms.ThButton button5; private System.Windows.Forms.OpenFileDialog openFileDialog2; private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private RyzStudio.Windows.ThemedForms.ThProgressBar progressBar2; + private RyzStudio.Windows.ThemedForms.ThProgressBar progressBar1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator3; + private System.Windows.Forms.Label label2; + private RyzStudio.Windows.ThemedForms.ThButtonTextBox textBox2; + private RyzStudio.Windows.ThemedForms.ThButton button4; } } diff --git a/MainForm.cs b/MainForm.cs index f14fe13..c767755 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -1,65 +1,67 @@ -using RyzStudio.IO; -using RyzStudio.Windows.Forms; -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; -using System.Runtime.InteropServices; +using System.Linq; using System.Text.Json; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using RyzStudio.IO; +using RyzStudio.Runtime.InteropServices; +using RyzStudio.Windows.Forms; +using Application = System.Windows.Forms.Application; namespace RandomFileRunner { public partial class MainForm : Form { - [DllImport("user32.dll")] - protected static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk); + private readonly Random _randy; + private readonly FileSearcher _fileSearcher; + private CancellationTokenSource _cancellationToken = new CancellationTokenSource(); - [DllImport("user32.dll")] - protected static extern bool UnregisterHotKey(IntPtr hWnd, int id); + private bool _isBusy = false; - //protected const int MOD_NONE = 0x0000; - //protected const int MOD_ALT = 0x1; - //protected const int MOD_CONTROL = 0x2; - //protected const int MOD_SHIFT = 0x4; - //protected const int MOD_WIN = 0x8; - protected const int WM_HOTKEY = 0x312; - protected const int WM_QUERYENDSESSION = 0x0011; - - - protected readonly Random randy = new Random(); - protected CancellationTokenSource cancellationToken = new CancellationTokenSource(); - - protected OptionsForm optionsForm = null; - protected bool isBusy = false; - protected bool requestCancel = false; - - protected List foundFiles = null; - protected Process currentProcess = null; + private List _searchPaths = new List(); + private List _foundFiles = new List(); + private Process _currentProcess = null; public MainForm() { InitializeComponent(); - textBox1.Text = "*.*"; - memoBox1.TextBox.WordWrap = false; + textBox2.SetIcon("search"); + textBox2.TextBox.ReadOnly = true; + + _randy = new Random(); + _fileSearcher = new FileSearcher(); + _fileSearcher.OnDirectoryFound += fileSearcher_OnDirectoryFound; + _fileSearcher.OnFileFound += fileSearcher_OnFileFound; + _fileSearcher.OnSearchCompleted += fileSearcher_OnSearchCompleted; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + this.ClearSession(); } protected async override void OnShown(EventArgs e) { base.OnShown(e); - string[] commandLineArgs = Environment.GetCommandLineArgs(); + var args = RyzStudio.Windows.Forms.Application.GetCommandLine(); - string jsonfigFilename = null; - if (string.IsNullOrWhiteSpace(jsonfigFilename)) jsonfigFilename = ParseOpenFile_FromCMD(commandLineArgs); - if (string.IsNullOrWhiteSpace(jsonfigFilename)) jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); + string jsonfigFilename = args.Where(x => (x.Key.Equals("o") || x.Key.Equals("open"))).Select(x => x.Value).FirstOrDefault(); + if (string.IsNullOrWhiteSpace(jsonfigFilename)) + { + jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig"); + } - if (!string.IsNullOrWhiteSpace(jsonfigFilename) && File.Exists(jsonfigFilename)) + if (!string.IsNullOrWhiteSpace(jsonfigFilename) && System.IO.File.Exists(jsonfigFilename)) { await LoadSessionFile(jsonfigFilename); } @@ -75,15 +77,18 @@ namespace RandomFileRunner return; } - if (this.CurrentSession.ClosePrevOnNext) CloseCurrentProcess(currentProcess); + if (this.CurrentSession.ClosePrevOnNext) + { + CloseCurrentProcess(_currentProcess); + } if (this.CurrentSession.NextHotKey != null) { if (this.CurrentSession.NextHotKey.KeyCode != Keys.None) { -//#if !DEBUG - UnregisterHotKey((IntPtr)Handle, 1); -//#endif + //#if !DEBUG + User32.UnregisterHotKey((IntPtr)Handle, 1); + //#endif } } } @@ -92,8 +97,11 @@ namespace RandomFileRunner { switch (m.Msg) { - case WM_HOTKEY: - if (m.WParam.ToInt32() == 1) button5_MouseClick(null, null); + case User32.WM_HOTKEY: + if (m.WParam.ToInt32() == 1) + { + button5_MouseClick(null, null); + } break; //case WM_QUERYENDSESSION: @@ -102,7 +110,8 @@ namespace RandomFileRunner // Application.Exit(); // break; - default: break; + default: + break; } base.WndProc(ref m); @@ -111,40 +120,34 @@ namespace RandomFileRunner public bool IsBusy { - get => isBusy; + get => _isBusy; set { - isBusy = value; + _isBusy = value; - ThreadControl.SetValue(pictureBox1, (isBusy ? UIcon.GetImage("loading_block") : null)); - ThreadControl.SetEnable(textBox1, !isBusy); - //ThreadControl.SetEnable(button2, !isBusy); - button2.LabelText = (isBusy? "&Cancel" : "&Search"); - ThreadControl.SetEnable(button3, !isBusy); - ThreadControl.SetEnable(button4, !isBusy); - ThreadControl.SetEnable(memoBox1, !isBusy); - ThreadControl.SetEnable(button5, !isBusy); - //ThreadControl.SetEnable(button1, !isBusy); + UIControl.SetValue(pictureBox1, (_isBusy ? UIResource.loading_block : null)); + UIControl.SetEnable(textBox1, !_isBusy); + button2.LabelText = (_isBusy ? "&Cancel" : "&Search"); + UIControl.SetEnable(button5, !_isBusy); + UIControl.SetEnable(button4, !_isBusy); } } public AppSession CurrentSession { get; set; } = new AppSession(); - - protected bool SearchDirecory_OnFound(string file, ulong searchCount, int searchQueue) + public List SearchPaths { - if (!string.IsNullOrWhiteSpace(file)) + get => _searchPaths; + set { - foundFiles.Add(file); + _searchPaths = value; + + textBox2.Text = string.Join(", ", _searchPaths.ToArray()); } - - //ThreadControl.SetText(label2, foundFiles.Count.ToString()); - ThreadControl.SetText(label2, foundFiles.Count.ToString("#,#", System.Globalization.CultureInfo.CurrentCulture) + Environment.NewLine + searchQueue.ToString("#,#", System.Globalization.CultureInfo.CurrentCulture)); - - return true; } + #region Main Menu /// /// New @@ -155,9 +158,15 @@ namespace RandomFileRunner { await Task.Run(() => { - if (this.IsBusy) return; + if (this.IsBusy) + { + return; + } - if (this.CurrentSession.ClosePrevOnNext) CloseCurrentProcess(currentProcess); + if (this.CurrentSession.ClosePrevOnNext) + { + CloseCurrentProcess(_currentProcess); + } ClearSession(); }); @@ -170,7 +179,10 @@ namespace RandomFileRunner /// private async void openToolStripMenuItem_Click(object sender, EventArgs e) { - if (this.IsBusy) return; + if (this.IsBusy) + { + return; + } if (openFileDialog2.ShowDialog() == DialogResult.OK) { @@ -185,7 +197,14 @@ namespace RandomFileRunner /// private async void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { - if (this.IsBusy) return; + if (this.IsBusy) + { + return; + } + + saveFileDialog1.Title = "Save session"; + saveFileDialog1.Filter = "Session files (*.jsonfig)|*.jsonfig"; + saveFileDialog1.DefaultExt = "jsonfig"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { @@ -210,9 +229,12 @@ namespace RandomFileRunner /// private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { - if (this.IsBusy) return; + if (this.IsBusy) + { + return; + } - if (optionsForm == null) optionsForm = new OptionsForm(this.CurrentSession); + var optionsForm = new OptionsForm(this.CurrentSession); if (optionsForm.ShowDialog() == DialogResult.OK) { this.CurrentSession = optionsForm.Session; @@ -228,18 +250,7 @@ namespace RandomFileRunner /// private void viewHelpToolStripMenuItem1_Click(object sender, EventArgs e) { - try - { - System.Diagnostics.Process.Start(new ProcessStartInfo() - { - FileName = AppResource.AppHelpURL, - UseShellExecute = true - }); - } - catch - { - // do nothing - } + RyzStudio.Diagnostics.Process.Execute(AppResource.AppHelpURL); } /// @@ -252,6 +263,65 @@ namespace RandomFileRunner MessageBox.Show(Application.ProductName + " v" + Application.ProductVersion, "About", MessageBoxButtons.OK, MessageBoxIcon.Information); } + #endregion + + #region Search Engine + + private async Task fileSearcher_OnFileFound(FileSearcher sender, string searchPath, string fileName) + { + await Task.Run(() => + { + _foundFiles.Add(fileName); + + UIControl.SetText(label3, Path.GetFileName(fileName)); + + progressBar2.Maximum = (sender.FileCount + sender.NoAccessFileCount); + progressBar2.Value = sender.FileCount; + }); + } + + private async Task fileSearcher_OnDirectoryFound(FileSearcher sender, string searchPath, string directoryName) + { + await Task.Run(() => + { + UIControl.SetText(label4, Path.GetFileName(directoryName)); + + progressBar1.Maximum = sender.DirectoryCount; + progressBar1.Value = sender.BufferLevel; + }); + } + + private async Task fileSearcher_OnSearchCompleted(FileSearcher sender, TimeSpan elapsedTime) + { + await Task.Run(() => + { + UIControl.SetText(label4, $"Done in {Math.Floor(elapsedTime.TotalMinutes)}m {elapsedTime.Seconds}s"); + UIControl.SetText(label3, ((_foundFiles.Count <= 0) ? "0" : _foundFiles.Count.ToString("#,#", System.Globalization.CultureInfo.CurrentCulture)) + " File" + ((_foundFiles.Count == 1) ? "" : "s") + " Found"); + + progressBar1.Value = sender.BufferLevel; + progressBar2.Value = sender.FileCount; + }); + } + + #endregion + + + private void textBox2_OnButtonClick(object sender, EventArgs e) + { + if (this.IsBusy) + { + return; + } + + var form = new MemoBoxForm(); + + form.Lines = SearchPaths; + + if (form.ShowDialog() == DialogResult.OK) + { + SearchPaths = form.Lines; + } + } /// /// Search @@ -260,138 +330,61 @@ namespace RandomFileRunner /// private async void button2_MouseClick(object sender, MouseEventArgs e) { - await Task.Run(async () => + if (this.IsBusy) { - if (this.IsBusy) - { - requestCancel = true; - button2.LabelText = "&Cancelling..."; - cancellationToken.Cancel(); + button2.LabelText = "&Cancelling..."; + _cancellationToken.Cancel(); - return; - } - - this.IsBusy = true; - requestCancel = false; - - foundFiles = new List(); - cancellationToken = new CancellationTokenSource(); - currentProcess = null; - - if (!string.IsNullOrWhiteSpace(memoBox1.Text)) - { - string[] itemList = memoBox1.Text?.Trim().Split('\n'); - for (int i = 0; i < itemList.Length; i++) - { - if (string.IsNullOrWhiteSpace(itemList[i])) continue; - if (requestCancel) break; - - string item = itemList[i]?.Trim(); - - if (File.Exists(item)) - { - if (AccessibleDirectory.IsFileAccessible(item)) - { - foundFiles.Add(item); - ThreadControl.SetText(label2, foundFiles.Count.ToString()); - - continue; - } - } - - if (Directory.Exists(item)) - { - await AccessibleDirectory.GetFilesAsync(item, textBox1.Text, this.CurrentSession.SearchTopDirectoryOnly, SearchDirecory_OnFound, cancellationToken.Token); - - ThreadControl.SetText(label2, foundFiles.Count.ToString()); - - continue; - } - } - } - - ThreadControl.SetText(label2, ((foundFiles.Count <= 0) ? "0" :foundFiles.Count.ToString("#,#", System.Globalization.CultureInfo.CurrentCulture)) + " File" + ((foundFiles.Count == 1) ? "" : "s") + " Found"); - - this.IsBusy = false; - requestCancel = false; - }); - } - - /// - /// Add directory - /// - /// - /// - private void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e) - { - if (this.IsBusy) return; - - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) - { - AddSearchItem(folderBrowserDialog1.SelectedPath); - } - } - - /// - /// Add file - /// - /// - /// - private void addFileToolStripMenuItem_Click(object sender, EventArgs e) - { - if (this.IsBusy) return; - - if (openFileDialog1.ShowDialog() == DialogResult.OK) - { - AddSearchItem(openFileDialog1.FileName); - } - } - - /// - /// Clear - /// - /// - /// - private void button4_MouseClick(object sender, MouseEventArgs e) - { - if (this.IsBusy) return; - - memoBox1.Text = string.Empty; - } - - private void memoBox1_DragOver(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop)) - { - if (this.IsBusy) - { - e.Effect = DragDropEffects.None; - } - else - { - e.Effect = DragDropEffects.Copy; - } - } - else - { - e.Effect = DragDropEffects.None; - } - } - - private void memoBox1_DragDrop(object sender, DragEventArgs e) - { - if (this.IsBusy) return; - - string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; - if (fileList == null) - { return; } - foreach (string item in fileList) + this.IsBusy = true; + + progressBar1.ShowProgressText = true; + progressBar2.ShowProgressText = true; + + _foundFiles = new List(); + _cancellationToken = new CancellationTokenSource(); + _currentProcess = null; + + _fileSearcher.FileSearchPattern = textBox1.Text; + _fileSearcher.SearchPath = new List(); + + await Task.Run(() => { - AddSearchItem(item); + foreach (var item in SearchPaths) + { + if (_cancellationToken.IsCancellationRequested) + { + break; + } + + if (System.IO.File.Exists(item)) + { + _foundFiles.Add(item); + + continue; + } + + if (System.IO.Directory.Exists(item)) + { + _fileSearcher.SearchPath.Add(item); + + continue; + } + } + + UIControl.SetText(label3, ((_foundFiles.Count <= 0) ? "0" : _foundFiles.Count.ToString("#,#", System.Globalization.CultureInfo.CurrentCulture)) + " File" + ((_foundFiles.Count == 1) ? "" : "s") + " Found"); + }); + + if (_fileSearcher.SearchPath.Count > 0) + { + await _fileSearcher.Search(_cancellationToken.Token); } + + this.IsBusy = false; + + _cancellationToken = new CancellationTokenSource(); } /// @@ -401,24 +394,37 @@ namespace RandomFileRunner /// private async void button5_MouseClick(object sender, MouseEventArgs e) { + if (this.IsBusy) + { + return; + } + + if (_foundFiles.Count <= 0) + { + return; + } + await Task.Run(() => { - if (this.IsBusy) return; - if (foundFiles.Count <= 0) return; - //this.IsBusy = true; - if (this.CurrentSession == null) this.CurrentSession = new AppSession(); + if (this.CurrentSession == null) + { + this.CurrentSession = new AppSession(); + } - if (this.CurrentSession.ClosePrevOnNext) CloseCurrentProcess(currentProcess); + if (this.CurrentSession.ClosePrevOnNext) + { + CloseCurrentProcess(_currentProcess); + } string filename = null; // retry 8 times for (int i = 0; i < this.CurrentSession.RetryOnError; i++) { - filename = foundFiles[randy.Next(0, (foundFiles.Count - 1))]; - if (File.Exists(filename)) + filename = _foundFiles[_randy.Next(0, (_foundFiles.Count - 1))]; + if (System.IO.File.Exists(filename)) { continue; } @@ -428,23 +434,47 @@ namespace RandomFileRunner if (!string.IsNullOrWhiteSpace(filename)) { - ProcessStartInfo psi = new ProcessStartInfo(filename); - psi.UseShellExecute = true; - - try - { - currentProcess = Process.Start(psi); - } - catch (Exception) - { - // do nothing - } + RyzStudio.Diagnostics.Process.Execute(filename); } //this.IsBusy = false; }); } + /// + /// Save File List + /// + /// + /// + private async void button4_MouseClick(object sender, MouseEventArgs e) + { + if (this.IsBusy) + { + return; + } + + if (_foundFiles.Count <= 0) + { + return; + } + + saveFileDialog1.Title = "Save File List"; + saveFileDialog1.Filter = "Text files (*.txt)|*.txt"; + saveFileDialog1.DefaultExt = "txt"; + + if (saveFileDialog1.ShowDialog() == DialogResult.OK) + { + try + { + await System.IO.File.WriteAllTextAsync(saveFileDialog1.FileName, string.Join(Environment.NewLine, _foundFiles.ToArray())); + } + catch (Exception exc) + { + MessageBox.Show(exc.Message, "Save File List"); + } + } + } + /// /// Close /// @@ -456,24 +486,16 @@ namespace RandomFileRunner } - protected void AddSearchItem(string line) - { - memoBox1.Text = memoBox1.Text.Trim(); - - // above line-break - if (!string.IsNullOrWhiteSpace(memoBox1.Text)) memoBox1.Text += Environment.NewLine; - - memoBox1.Text += line + Environment.NewLine; - } - private void CloseCurrentProcess(Process p) { - if (p == null) return; + if (p == null) + { + return; + } try { p.CloseMainWindow(); - //p.Close(); } catch (Exception) { @@ -483,166 +505,83 @@ namespace RandomFileRunner private void InvalidateHotKey() { -//#if !DEBUG - if (this.InvokeRequired) + //#if !DEBUG + UIControl.Invoke(this, (x) => { - this.Invoke(new MethodInvoker(() => - { - UnregisterHotKey((IntPtr)Handle, 1); - })); - } - else - { - UnregisterHotKey((IntPtr)Handle, 1); - } -//#endif + User32.UnregisterHotKey((IntPtr)Handle, 1); + }); + //#endif if (this.CurrentSession.NextHotKey != null) { if (this.CurrentSession.NextHotKey.KeyCode != Keys.None) { -//#if !DEBUG - if (this.InvokeRequired) + //#if !DEBUG + UIControl.Invoke(this, (x) => { - this.Invoke(new MethodInvoker(() => - { - RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.NextHotKey.ModifierCode, this.CurrentSession.NextHotKey.Key); - })); - } - else - { - RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.NextHotKey.ModifierCode, this.CurrentSession.NextHotKey.Key); - } -//#endif + User32.RegisterHotKey((IntPtr)Handle, 1, this.CurrentSession.NextHotKey.ModifierCode, this.CurrentSession.NextHotKey.Key); + }); + //#endif } } } private void ClearSession() { - foundFiles = new List(); - currentProcess = null; + _foundFiles = new List(); + _currentProcess = null; + textBox1.Text = "*.*"; - ThreadControl.SetText(label2, "0"); - memoBox1.Text = string.Empty; + + progressBar1.Clear(0, 0, 0); + progressBar2.Clear(0, 0, 0); + + UIControl.SetText(label4, ""); + UIControl.SetText(label3, ""); } protected async Task LoadSessionFile(string filename) { await Task.Run(() => { - if (string.IsNullOrWhiteSpace(filename)) return; - if (!File.Exists(filename)) return; - - string sourceCode = null; - - try - { - sourceCode = File.ReadAllText(filename); - } - catch (Exception exc) - { - MessageBox.Show(exc.Message, "Load session"); - return; - } - - if (string.IsNullOrWhiteSpace(sourceCode)) - { - return; - } - - // load options - var options = new JsonSerializerOptions(); - //options.Converters.Add(new JsonPointConverter()); - //options.Converters.Add(new JsonSizeConverter()); - - try - { - this.CurrentSession = JsonSerializer.Deserialize(sourceCode, options); - } - catch (Exception exc) - { - MessageBox.Show("Unable to read session", "Load session"); - return; - } - - if (this.CurrentSession == null) this.CurrentSession = new AppSession(); + this.CurrentSession = RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile(filename) ?? new AppSession(); ClearSession(); textBox1.Text = (string.IsNullOrWhiteSpace(this.CurrentSession.SearchFilePattern) ? "*" : this.CurrentSession.SearchFilePattern?.Trim()); - if (this.CurrentSession.SearchItems != null) - { - foreach (string item in this.CurrentSession.SearchItems) - { - AddSearchItem(item); - } - } + SearchPaths = this.CurrentSession?.SearchItems ?? new List(); // hotkey InvalidateHotKey(); }); } - protected string ParseOpenFile_FromCMD(string[] args) - { - if (args.Length <= 1) - { - return null; - } - - int i = 1; - while (true) - { - if (i > (args.Length - 1)) - { - break; - } - - switch (args[i].Trim().ToLower()) - { - case "-o": - case "-open": - if ((i + 1) > (args.Length - 1)) break; - - string openFilename = args[(i + 1)]; - if (string.IsNullOrWhiteSpace(openFilename)) break; - if (!File.Exists(openFilename)) break; - - return openFilename; - - i++; - break; - } - - i++; - } - - return null; - } - protected async Task SaveSessionFile(string filename) { + if (string.IsNullOrWhiteSpace(filename)) + { + return; + } + + if (this.CurrentSession == null) + { + this.CurrentSession = new AppSession(); + } + await Task.Run(() => { - if (string.IsNullOrWhiteSpace(filename)) return; - - if (this.CurrentSession == null) this.CurrentSession = new AppSession(); this.CurrentSession.SearchFilePattern = textBox1.Text; this.CurrentSession.SearchItems = new List(); - if (!string.IsNullOrWhiteSpace(memoBox1.Text)) + foreach (var item in SearchPaths) { - foreach (string item in memoBox1.Text?.Trim().Split('\n')) + if (string.IsNullOrWhiteSpace(item)) { - if (string.IsNullOrWhiteSpace(item)) - { - continue; - } - - this.CurrentSession.SearchItems.Add(item?.Trim()); + continue; } + + this.CurrentSession.SearchItems.Add(item.Trim()); } string sourceCode = null; @@ -659,7 +598,7 @@ namespace RandomFileRunner try { - File.WriteAllText(filename, sourceCode); + System.IO.File.WriteAllText(filename, sourceCode); } catch (Exception exc) { @@ -670,4 +609,4 @@ namespace RandomFileRunner } } -} +} \ No newline at end of file diff --git a/MainForm.resx b/MainForm.resx index 493f7a2..765abba 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -1,4 +1,64 @@ - + + + @@ -63,15 +123,27 @@ 716, 17 - - 831, 17 - - - 986, 17 - - - 1155, 17 - + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAAN5JREFUOE/tUzsKwkAUXLCyFMHjeIvdB4Gk8ALamU4rsbLaTWz0AOYGOYMewTqe + QLEQnZc8WRMSsBYHhrzPzJBin2pC60PPGLs3xl3Bp5DrHe9E1g2tHUH8QMjKmGReketyZkRWh9abfhTZ + YRimI4jWRPYSBMngkzzjHWtYyx6xK4X0Anz/7rcsxM4BdoxBTuTOqCdEaUyU6DrTuNqxxuXsEXsFDLfg + UdpOsIa10nr8A34p4CRtJ1jTGoC3PsPiBi78ETXplqzBwU3F5sHHgWWGJ3rHt+3tg+Uu84ek1AsYYd8q + EsfwCwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAANFJREFUOE/tkzEKAjEURANWliJ4HG+h9l5AO7fTSjyCxWpCIBB2b+AZ9AjW6wlc + LGSdWb9Elw1YiwOP/Pw/E1Ikqqksyzpa670x5goqgfWOM7HFhfAE5jvWNdYFkZq9sdg+laZp13vfBwOY + NjBfnHO9d9jjjB56mZG4UhgW4HXdbykkXl97iMYBnFFPrbUJGDVIOKOHXmYk/hSaW3CUbVT00CvboP8B + v3TASbZR0RM7YA5KsAT1J2phBUq8wpnEgvg5MMwxvGFte/uVzPLwkZR6AInAKK6aICfTAAAAAElFTkSu + QmCC + + 1155, 17 @@ -81,7 +153,6 @@ 52 - AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA diff --git a/MemoBoxForm.cs b/MemoBoxForm.cs new file mode 100644 index 0000000..9b94c33 --- /dev/null +++ b/MemoBoxForm.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using RyzStudio.Windows.ThemedForms; + +namespace RandomFileRunner +{ + public class MemoBoxForm : Form + { + private ThButton button1; + private ThMemoBox memoBox1; + private ThButton button3; + private ThButton button4; + private ContextMenuStrip contextMenuStrip1; + private System.ComponentModel.IContainer components; + private ToolStripMenuItem addDirectoryToolStripMenuItem; + private ToolStripMenuItem addFileToolStripMenuItem; + private FolderBrowserDialog folderBrowserDialog1; + private OpenFileDialog openFileDialog1; + private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; + + + public MemoBoxForm() : base() + { + InitializeComponent(); + + memoBox1.TextBox.WordWrap = false; + } + + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + button1 = new ThButton(); + tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + memoBox1 = new ThMemoBox(); + button3 = new ThButton(); + contextMenuStrip1 = new ContextMenuStrip(components); + addDirectoryToolStripMenuItem = new ToolStripMenuItem(); + addFileToolStripMenuItem = new ToolStripMenuItem(); + button4 = new ThButton(); + folderBrowserDialog1 = new FolderBrowserDialog(); + openFileDialog1 = new OpenFileDialog(); + contextMenuStrip1.SuspendLayout(); + SuspendLayout(); + // + // button1 + // + button1.AcceptButton = null; + button1.ActiveImage = null; + button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + button1.BackColor = System.Drawing.Color.Transparent; + button1.EnableMenuOnClick = false; + button1.EnableReactiveVisual = true; + button1.HoverImage = null; + button1.IdleImage = null; + button1.LabelText = "&Save"; + button1.Location = new System.Drawing.Point(241, 469); + button1.Margin = new Padding(10, 0, 10, 10); + button1.Name = "button1"; + button1.Padding = new Padding(4, 4, 3, 3); + button1.Size = new System.Drawing.Size(128, 32); + button1.TabIndex = 4; + button1.TabStop = false; + button1.MouseClick += button1_MouseClick; + // + // tHorizontalSeparator1 + // + tHorizontalSeparator1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); + tHorizontalSeparator1.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator1.Name = "tHorizontalSeparator1"; + tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); + tHorizontalSeparator1.TabIndex = 188; + tHorizontalSeparator1.TabStop = false; + // + // memoBox1 + // + memoBox1.AcceptButton = null; + memoBox1.AllowDrop = true; + memoBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + memoBox1.BackColor = System.Drawing.Color.Transparent; + memoBox1.EnableReactiveVisual = true; + memoBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + memoBox1.Location = new System.Drawing.Point(10, 70); + memoBox1.Margin = new Padding(10, 6, 10, 6); + memoBox1.Name = "memoBox1"; + memoBox1.Padding = new Padding(4, 4, 3, 3); + memoBox1.ReadOnly = false; + memoBox1.ScrollBars = ScrollBars.Vertical; + memoBox1.Size = new System.Drawing.Size(364, 361); + memoBox1.TabIndex = 191; + memoBox1.TabStop = false; + memoBox1.WordWrap = false; + // + // button3 + // + button3.AcceptButton = null; + button3.ActiveImage = null; + button3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + button3.BackColor = System.Drawing.Color.Transparent; + button3.ContextMenuStrip = contextMenuStrip1; + button3.EnableMenuOnClick = true; + button3.EnableReactiveVisual = true; + button3.HoverImage = null; + button3.IdleImage = null; + button3.LabelText = "&Add"; + button3.Location = new System.Drawing.Point(10, 21); + button3.Margin = new Padding(10, 0, 10, 10); + button3.Name = "button3"; + button3.Padding = new Padding(4, 4, 3, 3); + button3.Size = new System.Drawing.Size(177, 33); + button3.TabIndex = 189; + button3.TabStop = false; + // + // contextMenuStrip1 + // + contextMenuStrip1.Items.AddRange(new ToolStripItem[] { addDirectoryToolStripMenuItem, addFileToolStripMenuItem }); + contextMenuStrip1.Name = "contextMenuStrip1"; + contextMenuStrip1.Size = new System.Drawing.Size(148, 48); + // + // addDirectoryToolStripMenuItem + // + addDirectoryToolStripMenuItem.Name = "addDirectoryToolStripMenuItem"; + addDirectoryToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + addDirectoryToolStripMenuItem.Text = "&Add Directory"; + addDirectoryToolStripMenuItem.Click += addDirectoryToolStripMenuItem_Click; + // + // addFileToolStripMenuItem + // + addFileToolStripMenuItem.Name = "addFileToolStripMenuItem"; + addFileToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + addFileToolStripMenuItem.Text = "Add &File"; + addFileToolStripMenuItem.Click += addFileToolStripMenuItem_Click; + // + // button4 + // + button4.AcceptButton = null; + button4.ActiveImage = null; + button4.Anchor = AnchorStyles.Top | AnchorStyles.Right; + button4.BackColor = System.Drawing.Color.Transparent; + button4.EnableMenuOnClick = false; + button4.EnableReactiveVisual = true; + button4.HoverImage = null; + button4.IdleImage = null; + button4.LabelText = "&Clear"; + button4.Location = new System.Drawing.Point(197, 21); + button4.Margin = new Padding(10, 0, 10, 10); + button4.Name = "button4"; + button4.Padding = new Padding(4, 4, 3, 3); + button4.Size = new System.Drawing.Size(177, 33); + button4.TabIndex = 190; + button4.TabStop = false; + button4.MouseClick += button4_MouseClick; + // + // folderBrowserDialog1 + // + folderBrowserDialog1.ShowNewFolderButton = false; + // + // openFileDialog1 + // + openFileDialog1.Filter = "All files (*.*)|*.*"; + // + // MemoBoxForm + // + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(384, 521); + Controls.Add(memoBox1); + Controls.Add(button3); + Controls.Add(button4); + Controls.Add(tHorizontalSeparator1); + Controls.Add(button1); + MinimumSize = new System.Drawing.Size(400, 560); + Name = "MemoBoxForm"; + ShowIcon = false; + ShowInTaskbar = false; + Text = "Manage Search Paths"; + contextMenuStrip1.ResumeLayout(false); + ResumeLayout(false); + } + + protected override void OnShown(EventArgs e) + { + base.OnShown(e); + + this.DialogResult = System.Windows.Forms.DialogResult.None; + } + + + public List Lines + { + get => memoBox1.Lines; + set + { + memoBox1.TextBox.Lines = value.ToArray(); + } + } + + + private void button1_MouseClick(object sender, MouseEventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + /// + /// Add Directory. + /// + /// + /// + private void addDirectoryToolStripMenuItem_Click(object sender, EventArgs e) + { + if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) + { + memoBox1.TextBox.AddLine(folderBrowserDialog1.SelectedPath); + } + } + + /// + /// Add File. + /// + /// + /// + private void addFileToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + memoBox1.TextBox.AddLine(openFileDialog1.FileName); + } + } + + /// + /// Clear. + /// + /// + /// + private void button4_MouseClick(object sender, MouseEventArgs e) + { + memoBox1.Text = string.Empty; + } + + } +} \ No newline at end of file diff --git a/MemoBoxForm.resx b/MemoBoxForm.resx new file mode 100644 index 0000000..b56ae18 --- /dev/null +++ b/MemoBoxForm.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 831, 17 + + + 986, 17 + + + 1155, 17 + + \ No newline at end of file diff --git a/OptionsForm.cs b/OptionsForm.cs index aa4bb05..4640e24 100644 --- a/OptionsForm.cs +++ b/OptionsForm.cs @@ -1,19 +1,21 @@ using RyzStudio.Windows.ThemedForms; +using RyzStudio.Windows.ThemedForms.ButtonTextBox; +using RyzStudio.Windows.ThemedForms.PickerBox; using System; using System.Windows.Forms; namespace RandomFileRunner { - public class OptionsForm : TDialogForm + public class OptionsForm : Form { - private TButton button1; - private TYesNoPickerBox pickerBox1; + private ThButton button1; + private ThYesNoPickerBox pickerBox1; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label8; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1; - private TNumericPickerBox pickerBox2; - private TKeyCodeTextBox textBox1; - private TYesNoPickerBox pickerBox3; + private ThNumericPickerBox pickerBox2; + private ThKeyCodeTextBox textBox1; + private ThYesNoPickerBox pickerBox3; private Label label1; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator3; private Label label2; @@ -29,230 +31,244 @@ namespace RandomFileRunner private void InitializeComponent() { - RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results results1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox.Results(); - this.button1 = new RyzStudio.Windows.ThemedForms.TButton(); - this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label6 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TNumericPickerBox(); - this.textBox1 = new RyzStudio.Windows.ThemedForms.TKeyCodeTextBox(); - this.pickerBox3 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox(); - this.label1 = new System.Windows.Forms.Label(); - this.tHorizontalSeparator3 = new RyzStudio.Windows.Forms.THorizontalSeparator(); - this.label2 = new System.Windows.Forms.Label(); - this.SuspendLayout(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm)); + ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results(); + button1 = new ThButton(); + pickerBox1 = new ThYesNoPickerBox(); + label6 = new Label(); + label8 = new Label(); + tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + pickerBox2 = new ThNumericPickerBox(); + textBox1 = new ThKeyCodeTextBox(); + pickerBox3 = new ThYesNoPickerBox(); + label1 = new Label(); + tHorizontalSeparator3 = new RyzStudio.Windows.Forms.THorizontalSeparator(); + label2 = new Label(); + SuspendLayout(); // // button1 // - this.button1.ActiveImage = null; - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.BackColor = System.Drawing.Color.Transparent; - this.button1.HoverImage = null; - this.button1.IdleImage = null; - this.button1.LabelText = "&Save"; - this.button1.Location = new System.Drawing.Point(241, 469); - this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.button1.Name = "button1"; - this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3); - this.button1.Size = new System.Drawing.Size(128, 32); - this.button1.TabIndex = 4; - this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick); + button1.AcceptButton = null; + button1.ActiveImage = null; + button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + button1.BackColor = System.Drawing.Color.Transparent; + button1.EnableMenuOnClick = false; + button1.EnableReactiveVisual = true; + button1.HoverImage = null; + button1.IdleImage = null; + button1.LabelText = "&Save"; + button1.Location = new System.Drawing.Point(241, 469); + button1.Margin = new Padding(10, 0, 10, 10); + button1.Name = "button1"; + button1.Padding = new Padding(4, 4, 3, 3); + button1.Size = new System.Drawing.Size(128, 32); + button1.TabIndex = 4; + button1.TabStop = false; + button1.MouseClick += button1_MouseClick; // // pickerBox1 // - this.pickerBox1.AcceptButton = null; - this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox1.BackColor = System.Drawing.Color.Transparent; - this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox1.Location = new System.Drawing.Point(285, 21); - this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox1.Name = "pickerBox1"; - this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox1.Size = new System.Drawing.Size(84, 35); - this.pickerBox1.TabIndex = 0; - this.pickerBox1.Value = true; + pickerBox1.AcceptButton = null; + pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; + pickerBox1.BackColor = System.Drawing.Color.Transparent; + pickerBox1.EnableReactiveVisual = true; + pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + pickerBox1.Location = new System.Drawing.Point(285, 21); + pickerBox1.Margin = new Padding(10, 10, 10, 0); + pickerBox1.Name = "pickerBox1"; + pickerBox1.Padding = new Padding(4, 4, 3, 3); + pickerBox1.SelectedIndex = 1; + pickerBox1.Size = new System.Drawing.Size(84, 35); + pickerBox1.TabIndex = 0; + pickerBox1.TabStop = false; + pickerBox1.Value = true; // // label6 // - this.label6.AutoSize = true; - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.ForeColor = System.Drawing.SystemColors.ControlText; - this.label6.Location = new System.Drawing.Point(10, 85); - this.label6.Margin = new System.Windows.Forms.Padding(0); - this.label6.Name = "label6"; - this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label6.Size = new System.Drawing.Size(81, 34); - this.label6.TabIndex = 182; - this.label6.Text = "Retry On Error"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label6.AutoSize = true; + label6.BackColor = System.Drawing.Color.Transparent; + label6.ForeColor = System.Drawing.SystemColors.ControlText; + label6.Location = new System.Drawing.Point(10, 85); + label6.Margin = new Padding(0); + label6.Name = "label6"; + label6.Padding = new Padding(0, 9, 0, 10); + label6.Size = new System.Drawing.Size(81, 34); + label6.TabIndex = 182; + label6.Text = "Retry On Error"; + label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label8 // - this.label8.AutoSize = true; - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.ForeColor = System.Drawing.SystemColors.ControlText; - this.label8.Location = new System.Drawing.Point(10, 21); - this.label8.Margin = new System.Windows.Forms.Padding(0); - this.label8.Name = "label8"; - this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label8.Size = new System.Drawing.Size(143, 34); - this.label8.TabIndex = 186; - this.label8.Text = "Search Top Directory Only"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label8.AutoSize = true; + label8.BackColor = System.Drawing.Color.Transparent; + label8.ForeColor = System.Drawing.SystemColors.ControlText; + label8.Location = new System.Drawing.Point(10, 21); + label8.Margin = new Padding(0); + label8.Name = "label8"; + label8.Padding = new Padding(0, 9, 0, 10); + label8.Size = new System.Drawing.Size(143, 34); + label8.TabIndex = 186; + label8.Text = "Search Top Directory Only"; + label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tHorizontalSeparator1 // - this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); - this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator1.Name = "tHorizontalSeparator1"; - this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator1.TabIndex = 188; - this.tHorizontalSeparator1.TabStop = false; + tHorizontalSeparator1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437); + tHorizontalSeparator1.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator1.Name = "tHorizontalSeparator1"; + tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22); + tHorizontalSeparator1.TabIndex = 188; + tHorizontalSeparator1.TabStop = false; // // tHorizontalSeparator2 // - this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59); - this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator2.Name = "tHorizontalSeparator2"; - this.tHorizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator2.TabIndex = 190; - this.tHorizontalSeparator2.TabStop = false; + tHorizontalSeparator2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59); + tHorizontalSeparator2.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator2.Name = "tHorizontalSeparator2"; + tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22); + tHorizontalSeparator2.TabIndex = 190; + tHorizontalSeparator2.TabStop = false; // // pickerBox2 // - this.pickerBox2.AcceptButton = null; - this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox2.BackColor = System.Drawing.Color.Transparent; - this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox2.Location = new System.Drawing.Point(285, 85); - this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox2.Name = "pickerBox2"; - this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox2.Size = new System.Drawing.Size(84, 35); - this.pickerBox2.TabIndex = 1; - this.pickerBox2.Value = 0; + pickerBox2.AcceptButton = null; + pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right; + pickerBox2.BackColor = System.Drawing.Color.Transparent; + pickerBox2.EnableReactiveVisual = true; + pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F); + pickerBox2.Location = new System.Drawing.Point(285, 85); + pickerBox2.Margin = new Padding(10, 10, 10, 0); + pickerBox2.MaxDropDownItems = 10; + pickerBox2.Maximum = 50; + pickerBox2.Minimum = 0; + pickerBox2.Name = "pickerBox2"; + pickerBox2.Padding = new Padding(4, 4, 3, 3); + pickerBox2.SelectedIndex = 0; + pickerBox2.Size = new System.Drawing.Size(84, 35); + pickerBox2.TabIndex = 1; + pickerBox2.TabStop = false; + pickerBox2.Value = 0; // // textBox1 // - this.textBox1.AcceptButton = null; - this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.textBox1.BackColor = System.Drawing.Color.Transparent; - this.textBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.textBox1.HighlightImage = null; + textBox1.AcceptButton = null; + textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; + textBox1.BackColor = System.Drawing.Color.Transparent; + textBox1.EnableReactiveVisual = true; + textBox1.Font = new System.Drawing.Font("Segoe UI", 9F); + textBox1.HighlightImage = (System.Drawing.Image)resources.GetObject("textBox1.HighlightImage"); results1.IsAlt = false; results1.IsCtrl = false; results1.IsShift = false; - results1.Key = System.Windows.Forms.Keys.None; - this.textBox1.KeyCodeResults = results1; - this.textBox1.Location = new System.Drawing.Point(241, 197); - this.textBox1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10); - this.textBox1.Name = "textBox1"; - this.textBox1.NormalImage = null; - this.textBox1.Padding = new System.Windows.Forms.Padding(10, 9, 9, 9); - this.textBox1.Size = new System.Drawing.Size(128, 34); - this.textBox1.TabIndex = 3; - this.textBox1.UseSystemPasswordChar = false; + results1.Key = Keys.None; + textBox1.KeyCodeResults = results1; + textBox1.Location = new System.Drawing.Point(241, 197); + textBox1.Margin = new Padding(10, 10, 10, 0); + textBox1.Name = "textBox1"; + textBox1.NormalImage = (System.Drawing.Image)resources.GetObject("textBox1.NormalImage"); + textBox1.Padding = new Padding(4, 4, 3, 3); + textBox1.Size = new System.Drawing.Size(128, 32); + textBox1.TabIndex = 3; + textBox1.TabStop = false; + textBox1.UseSystemPasswordChar = false; // // pickerBox3 // - this.pickerBox3.AcceptButton = null; - this.pickerBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pickerBox3.BackColor = System.Drawing.Color.Transparent; - this.pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.pickerBox3.Location = new System.Drawing.Point(285, 127); - this.pickerBox3.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4); - this.pickerBox3.Name = "pickerBox3"; - this.pickerBox3.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5); - this.pickerBox3.Size = new System.Drawing.Size(84, 35); - this.pickerBox3.TabIndex = 2; - this.pickerBox3.Value = true; + pickerBox3.AcceptButton = null; + pickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right; + pickerBox3.BackColor = System.Drawing.Color.Transparent; + pickerBox3.EnableReactiveVisual = true; + pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F); + pickerBox3.Location = new System.Drawing.Point(285, 127); + pickerBox3.Margin = new Padding(10, 10, 10, 0); + pickerBox3.Name = "pickerBox3"; + pickerBox3.Padding = new Padding(4, 4, 3, 3); + pickerBox3.SelectedIndex = 1; + pickerBox3.Size = new System.Drawing.Size(84, 35); + pickerBox3.TabIndex = 2; + pickerBox3.TabStop = false; + pickerBox3.Value = true; // // label1 // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.ForeColor = System.Drawing.SystemColors.ControlText; - this.label1.Location = new System.Drawing.Point(10, 127); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label1.Size = new System.Drawing.Size(169, 34); - this.label1.TabIndex = 196; - this.label1.Text = "Close Current Process On Next"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label1.AutoSize = true; + label1.BackColor = System.Drawing.Color.Transparent; + label1.ForeColor = System.Drawing.SystemColors.ControlText; + label1.Location = new System.Drawing.Point(10, 127); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Padding = new Padding(0, 9, 0, 10); + label1.Size = new System.Drawing.Size(169, 34); + label1.TabIndex = 196; + label1.Text = "Close Current Process On Next"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tHorizontalSeparator3 // - this.tHorizontalSeparator3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0); - this.tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent; - this.tHorizontalSeparator3.Location = new System.Drawing.Point(10, 165); - this.tHorizontalSeparator3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10); - this.tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(4920, 2); - this.tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22); - this.tHorizontalSeparator3.Name = "tHorizontalSeparator3"; - this.tHorizontalSeparator3.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10); - this.tHorizontalSeparator3.Size = new System.Drawing.Size(364, 22); - this.tHorizontalSeparator3.TabIndex = 197; - this.tHorizontalSeparator3.TabStop = false; + tHorizontalSeparator3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0); + tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent; + tHorizontalSeparator3.Location = new System.Drawing.Point(10, 165); + tHorizontalSeparator3.Margin = new Padding(0, 10, 0, 0); + tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(4920, 2); + tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22); + tHorizontalSeparator3.Name = "tHorizontalSeparator3"; + tHorizontalSeparator3.Size = new System.Drawing.Size(364, 22); + tHorizontalSeparator3.TabIndex = 197; + tHorizontalSeparator3.TabStop = false; // // label2 // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.ForeColor = System.Drawing.SystemColors.ControlText; - this.label2.Location = new System.Drawing.Point(10, 197); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10); - this.label2.Size = new System.Drawing.Size(123, 34); - this.label2.TabIndex = 198; - this.label2.Text = "Next File Shortcut Key"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + label2.AutoSize = true; + label2.BackColor = System.Drawing.Color.Transparent; + label2.ForeColor = System.Drawing.SystemColors.ControlText; + label2.Location = new System.Drawing.Point(10, 197); + label2.Margin = new Padding(0); + label2.Name = "label2"; + label2.Padding = new Padding(0, 9, 0, 10); + label2.Size = new System.Drawing.Size(123, 34); + label2.TabIndex = 198; + label2.Text = "Next File Shortcut Key"; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // OptionsForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 521); - this.Controls.Add(this.label2); - this.Controls.Add(this.tHorizontalSeparator3); - this.Controls.Add(this.label1); - this.Controls.Add(this.pickerBox3); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.pickerBox2); - this.Controls.Add(this.tHorizontalSeparator2); - this.Controls.Add(this.tHorizontalSeparator1); - this.Controls.Add(this.label8); - this.Controls.Add(this.pickerBox1); - this.Controls.Add(this.label6); - this.Controls.Add(this.button1); - this.MinimumSize = new System.Drawing.Size(400, 560); - this.Name = "OptionsForm"; - this.Text = "Options"; - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(384, 521); + Controls.Add(label2); + Controls.Add(tHorizontalSeparator3); + Controls.Add(label1); + Controls.Add(pickerBox3); + Controls.Add(textBox1); + Controls.Add(pickerBox2); + Controls.Add(tHorizontalSeparator2); + Controls.Add(tHorizontalSeparator1); + Controls.Add(label8); + Controls.Add(pickerBox1); + Controls.Add(label6); + Controls.Add(button1); + MinimumSize = new System.Drawing.Size(400, 560); + Name = "OptionsForm"; + ShowIcon = false; + ShowInTaskbar = false; + Text = "Options"; + ResumeLayout(false); + PerformLayout(); } protected override void OnShown(EventArgs e) @@ -262,7 +278,8 @@ namespace RandomFileRunner this.DialogResult = System.Windows.Forms.DialogResult.None; pickerBox1.Value = this.Session.SearchTopDirectoryOnly; - pickerBox2.Clear(0, 20, this.Session.RetryOnError); + pickerBox2.Value = this.Session.RetryOnError; + //pickerBox2.Clear.Clear(0, 20, this.Session.RetryOnError); pickerBox3.Value = this.Session.ClosePrevOnNext; if (this.Session.NextHotKey != null) textBox1.UpdateKeyCode(this.Session.NextHotKey.IsCtrl, this.Session.NextHotKey.IsAlt, this.Session.NextHotKey.IsShift, this.Session.NextHotKey.KeyCode); } diff --git a/OptionsForm.resx b/OptionsForm.resx index f298a7b..0386da6 100644 --- a/OptionsForm.resx +++ b/OptionsForm.resx @@ -1,4 +1,64 @@ - + + + @@ -57,4 +117,25 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAAN5JREFUOE/tUzsKwkAUXLCyFMHjeIvdB4Gk8ALamU4rsbLaTWz0AOYGOYMewTqe + QLEQnZc8WRMSsBYHhrzPzJBin2pC60PPGLs3xl3Bp5DrHe9E1g2tHUH8QMjKmGReketyZkRWh9abfhTZ + YRimI4jWRPYSBMngkzzjHWtYyx6xK4X0Anz/7rcsxM4BdoxBTuTOqCdEaUyU6DrTuNqxxuXsEXsFDLfg + UdpOsIa10nr8A34p4CRtJ1jTGoC3PsPiBi78ETXplqzBwU3F5sHHgWWGJ3rHt+3tg+Uu84ek1AsYYd8q + EsfwCwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAANFJREFUOE/tkzEKAjEURANWliJ4HG+h9l5AO7fTSjyCxWpCIBB2b+AZ9AjW6wlc + LGSdWb9Elw1YiwOP/Pw/E1Ikqqksyzpa670x5goqgfWOM7HFhfAE5jvWNdYFkZq9sdg+laZp13vfBwOY + NjBfnHO9d9jjjB56mZG4UhgW4HXdbykkXl97iMYBnFFPrbUJGDVIOKOHXmYk/hSaW3CUbVT00CvboP8B + v3TASbZR0RM7YA5KsAT1J2phBUq8wpnEgvg5MMwxvGFte/uVzPLwkZR6AInAKK6aICfTAAAAAElFTkSu + QmCC + + \ No newline at end of file diff --git a/Program.cs b/Program.cs index 517cd8c..5b6afe8 100644 --- a/Program.cs +++ b/Program.cs @@ -12,8 +12,6 @@ namespace RandomFileRunner [STAThread] static void Main() { - UIcon.UIResource = typeof(UIResource); - Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/RandomFileRunner.csproj b/RandomFileRunner.csproj index 5c65dd7..0232102 100644 --- a/RandomFileRunner.csproj +++ b/RandomFileRunner.csproj @@ -2,7 +2,7 @@ WinExe - net5.0-windows + net8.0-windows8.0 true randomfilerunner Ray Lam @@ -11,7 +11,7 @@ Ray Lam favicon.ico true - 0.1.2.065 + 1.1.0.074 @@ -35,6 +35,7 @@ + @@ -50,9 +51,8 @@ - - References\RyzStudio3.dll - + + @@ -61,6 +61,9 @@ True AppResource.resx + + Form + True True diff --git a/References/RyzStudio.8.1.0.719.nupkg b/References/RyzStudio.8.1.0.719.nupkg new file mode 100644 index 0000000..0866936 Binary files /dev/null and b/References/RyzStudio.8.1.0.719.nupkg differ diff --git a/References/RyzStudio.Windows.Forms.8.1.0.719.nupkg b/References/RyzStudio.Windows.Forms.8.1.0.719.nupkg new file mode 100644 index 0000000..2b83ffb Binary files /dev/null and b/References/RyzStudio.Windows.Forms.8.1.0.719.nupkg differ diff --git a/References/RyzStudio3.dll b/References/RyzStudio3.dll deleted file mode 100644 index 20a3f94..0000000 Binary files a/References/RyzStudio3.dll and /dev/null differ diff --git a/build.bat b/build.bat index f18db46..ce52a2f 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ rmdir /s /q "bin\Release\64\" dotnet publish skye.sln -r win-x64 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\64\" -rmdir /s /q "bin\Release\86\" -dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\" \ No newline at end of file +REM rmdir /s /q "bin\Release\86\" +REM dotnet publish skye.sln -r win-x86 -c Release /p:PublishSingleFile=true /p:SelfContained=false /p:PublishReadyToRunfalse=true /p:PublishDir="bin\Release\86\" \ No newline at end of file diff --git a/skye.sln b/skye.sln index 5d1886a..ac0e32f 100644 --- a/skye.sln +++ b/skye.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31702.278 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35004.147 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RandomFileRunner", "RandomFileRunner.csproj", "{5F301DDB-6E01-4492-BABC-E134722EF0AC}" EndProject