[WIP] First StartProgram UserControl

First attempt at using a customer User
Control to make it easier to create dynamic
list of start programs to kick off before the
main program is started.

I already have the ability within the data model
to store and track multiple start programs... the
difficulty is in making the WninForms UI handle
a dynamic number of start programs. This is the
basic construction of it, but it needs a LOT of UI
work.
This commit is contained in:
Terry MacDonald 2021-05-08 22:59:38 +12:00
parent 4ec7829a43
commit 1d752a1021
7 changed files with 480 additions and 731 deletions

View File

@ -166,6 +166,12 @@
<Compile Include="UIForms\ShortcutLibraryForm.Designer.cs">
<DependentUpon>ShortcutLibraryForm.cs</DependentUpon>
</Compile>
<Compile Include="UIForms\StartProgramControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UIForms\StartProgramControl.Designer.cs">
<DependentUpon>StartProgramControl.cs</DependentUpon>
</Compile>
<Compile Include="Validators.cs" />
<Compile Include="DisplayRepresentation.cs" />
<Compile Include="InterProcess\IPCClient.cs" />
@ -230,6 +236,9 @@
<DependentUpon>ShortcutLibraryForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UIForms\StartProgramControl.resx">
<DependentUpon>StartProgramControl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />

View File

@ -68,42 +68,7 @@ namespace DisplayMagician.UIForms
this.rb_change_audio = new System.Windows.Forms.RadioButton();
this.rb_no_change_audio = new System.Windows.Forms.RadioButton();
this.tabp_before = new System.Windows.Forms.TabPage();
this.pnl_start_program4 = new System.Windows.Forms.Panel();
this.cb_dont_start_if_running4 = new System.Windows.Forms.CheckBox();
this.cb_start_program4 = new System.Windows.Forms.CheckBox();
this.txt_start_program4 = new System.Windows.Forms.TextBox();
this.cb_start_program_close4 = new System.Windows.Forms.CheckBox();
this.btn_start_program4 = new System.Windows.Forms.Button();
this.txt_start_program_args4 = new System.Windows.Forms.TextBox();
this.cb_start_program_pass_args4 = new System.Windows.Forms.CheckBox();
this.lbl_start_program4 = new System.Windows.Forms.Label();
this.pnl_start_program3 = new System.Windows.Forms.Panel();
this.cb_dont_start_if_running3 = new System.Windows.Forms.CheckBox();
this.cb_start_program3 = new System.Windows.Forms.CheckBox();
this.txt_start_program3 = new System.Windows.Forms.TextBox();
this.cb_start_program_close3 = new System.Windows.Forms.CheckBox();
this.btn_start_program3 = new System.Windows.Forms.Button();
this.txt_start_program_args3 = new System.Windows.Forms.TextBox();
this.cb_start_program_pass_args3 = new System.Windows.Forms.CheckBox();
this.lbl_start_program3 = new System.Windows.Forms.Label();
this.pnl_start_program2 = new System.Windows.Forms.Panel();
this.cb_dont_start_if_running2 = new System.Windows.Forms.CheckBox();
this.cb_start_program2 = new System.Windows.Forms.CheckBox();
this.txt_start_program2 = new System.Windows.Forms.TextBox();
this.cb_start_program_close2 = new System.Windows.Forms.CheckBox();
this.btn_start_program2 = new System.Windows.Forms.Button();
this.txt_start_program_args2 = new System.Windows.Forms.TextBox();
this.cb_start_program_pass_args2 = new System.Windows.Forms.CheckBox();
this.lbl_start_program2 = new System.Windows.Forms.Label();
this.pnl_start_program1 = new System.Windows.Forms.Panel();
this.cb_dont_start_if_running1 = new System.Windows.Forms.CheckBox();
this.cb_start_program1 = new System.Windows.Forms.CheckBox();
this.txt_start_program1 = new System.Windows.Forms.TextBox();
this.cb_start_program_close1 = new System.Windows.Forms.CheckBox();
this.btn_start_program1 = new System.Windows.Forms.Button();
this.txt_start_program_args1 = new System.Windows.Forms.TextBox();
this.cb_start_program_pass_args1 = new System.Windows.Forms.CheckBox();
this.lbl_start_program1 = new System.Windows.Forms.Label();
this.pnl_start_programs = new System.Windows.Forms.Panel();
this.tabp_game = new System.Windows.Forms.TabPage();
this.lbl_no_game_libraries = new System.Windows.Forms.Label();
this.p_standalone = new System.Windows.Forms.Panel();
@ -164,10 +129,6 @@ namespace DisplayMagician.UIForms
this.gb_audio_volume.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nud_audio_volume)).BeginInit();
this.tabp_before.SuspendLayout();
this.pnl_start_program4.SuspendLayout();
this.pnl_start_program3.SuspendLayout();
this.pnl_start_program2.SuspendLayout();
this.pnl_start_program1.SuspendLayout();
this.tabp_game.SuspendLayout();
this.p_standalone.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nud_timeout_executable)).BeginInit();
@ -655,10 +616,7 @@ namespace DisplayMagician.UIForms
// tabp_before
//
this.tabp_before.BackColor = System.Drawing.Color.Black;
this.tabp_before.Controls.Add(this.pnl_start_program4);
this.tabp_before.Controls.Add(this.pnl_start_program3);
this.tabp_before.Controls.Add(this.pnl_start_program2);
this.tabp_before.Controls.Add(this.pnl_start_program1);
this.tabp_before.Controls.Add(this.pnl_start_programs);
this.tabp_before.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabp_before.ForeColor = System.Drawing.Color.White;
this.tabp_before.Location = new System.Drawing.Point(4, 32);
@ -668,417 +626,14 @@ namespace DisplayMagician.UIForms
this.tabp_before.TabIndex = 1;
this.tabp_before.Text = "3. Choose what happens before";
//
// pnl_start_program4
//
this.pnl_start_program4.Controls.Add(this.cb_dont_start_if_running4);
this.pnl_start_program4.Controls.Add(this.cb_start_program4);
this.pnl_start_program4.Controls.Add(this.txt_start_program4);
this.pnl_start_program4.Controls.Add(this.cb_start_program_close4);
this.pnl_start_program4.Controls.Add(this.btn_start_program4);
this.pnl_start_program4.Controls.Add(this.txt_start_program_args4);
this.pnl_start_program4.Controls.Add(this.cb_start_program_pass_args4);
this.pnl_start_program4.Controls.Add(this.lbl_start_program4);
this.pnl_start_program4.Location = new System.Drawing.Point(48, 443);
this.pnl_start_program4.Name = "pnl_start_program4";
this.pnl_start_program4.Size = new System.Drawing.Size(959, 124);
this.pnl_start_program4.TabIndex = 19;
//
// cb_dont_start_if_running4
//
this.cb_dont_start_if_running4.AutoSize = true;
this.cb_dont_start_if_running4.ForeColor = System.Drawing.Color.White;
this.cb_dont_start_if_running4.Location = new System.Drawing.Point(167, 82);
this.cb_dont_start_if_running4.Name = "cb_dont_start_if_running4";
this.cb_dont_start_if_running4.Size = new System.Drawing.Size(289, 24);
this.cb_dont_start_if_running4.TabIndex = 20;
this.cb_dont_start_if_running4.Text = "Don\'t start if program already running";
this.cb_dont_start_if_running4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_dont_start_if_running4.UseVisualStyleBackColor = true;
this.cb_dont_start_if_running4.Visible = false;
//
// cb_start_program4
//
this.cb_start_program4.Location = new System.Drawing.Point(21, 18);
this.cb_start_program4.Name = "cb_start_program4";
this.cb_start_program4.Size = new System.Drawing.Size(15, 14);
this.cb_start_program4.TabIndex = 18;
this.cb_start_program4.UseVisualStyleBackColor = true;
this.cb_start_program4.CheckedChanged += new System.EventHandler(this.cb_start_program4_CheckedChanged);
//
// txt_start_program4
//
this.txt_start_program4.Location = new System.Drawing.Point(300, 11);
this.txt_start_program4.Name = "txt_start_program4";
this.txt_start_program4.Size = new System.Drawing.Size(535, 26);
this.txt_start_program4.TabIndex = 17;
this.txt_start_program4.Visible = false;
//
// cb_start_program_close4
//
this.cb_start_program_close4.AutoSize = true;
this.cb_start_program_close4.ForeColor = System.Drawing.Color.White;
this.cb_start_program_close4.Location = new System.Drawing.Point(547, 82);
this.cb_start_program_close4.Name = "cb_start_program_close4";
this.cb_start_program_close4.Size = new System.Drawing.Size(398, 24);
this.cb_start_program_close4.TabIndex = 16;
this.cb_start_program_close4.Text = "Close started program when you finish playing Game";
this.cb_start_program_close4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_close4.UseVisualStyleBackColor = true;
this.cb_start_program_close4.Visible = false;
//
// btn_start_program4
//
this.btn_start_program4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_start_program4.ForeColor = System.Drawing.Color.White;
this.btn_start_program4.Location = new System.Drawing.Point(851, 10);
this.btn_start_program4.Name = "btn_start_program4";
this.btn_start_program4.Size = new System.Drawing.Size(85, 27);
this.btn_start_program4.TabIndex = 15;
this.btn_start_program4.Text = "Choose";
this.btn_start_program4.UseVisualStyleBackColor = true;
this.btn_start_program4.Visible = false;
this.btn_start_program4.Click += new System.EventHandler(this.btn_start_program4_Click);
//
// txt_start_program_args4
//
this.txt_start_program_args4.Location = new System.Drawing.Point(397, 50);
this.txt_start_program_args4.Name = "txt_start_program_args4";
this.txt_start_program_args4.Size = new System.Drawing.Size(540, 26);
this.txt_start_program_args4.TabIndex = 14;
this.txt_start_program_args4.Visible = false;
//
// cb_start_program_pass_args4
//
this.cb_start_program_pass_args4.AutoSize = true;
this.cb_start_program_pass_args4.ForeColor = System.Drawing.Color.White;
this.cb_start_program_pass_args4.Location = new System.Drawing.Point(167, 52);
this.cb_start_program_pass_args4.Name = "cb_start_program_pass_args4";
this.cb_start_program_pass_args4.Size = new System.Drawing.Size(228, 24);
this.cb_start_program_pass_args4.TabIndex = 13;
this.cb_start_program_pass_args4.Text = "Pass arguments to program:";
this.cb_start_program_pass_args4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_pass_args4.UseVisualStyleBackColor = true;
this.cb_start_program_pass_args4.Visible = false;
this.cb_start_program_pass_args4.CheckedChanged += new System.EventHandler(this.cb_start_program_pass_args4_CheckedChanged);
//
// lbl_start_program4
//
this.lbl_start_program4.AutoSize = true;
this.lbl_start_program4.Location = new System.Drawing.Point(46, 14);
this.lbl_start_program4.Name = "lbl_start_program4";
this.lbl_start_program4.Size = new System.Drawing.Size(244, 20);
this.lbl_start_program4.TabIndex = 0;
this.lbl_start_program4.Text = "Choose a program to start fourth:";
this.lbl_start_program4.Click += new System.EventHandler(this.lbl_start_program4_Click);
//
// pnl_start_program3
//
this.pnl_start_program3.Controls.Add(this.cb_dont_start_if_running3);
this.pnl_start_program3.Controls.Add(this.cb_start_program3);
this.pnl_start_program3.Controls.Add(this.txt_start_program3);
this.pnl_start_program3.Controls.Add(this.cb_start_program_close3);
this.pnl_start_program3.Controls.Add(this.btn_start_program3);
this.pnl_start_program3.Controls.Add(this.txt_start_program_args3);
this.pnl_start_program3.Controls.Add(this.cb_start_program_pass_args3);
this.pnl_start_program3.Controls.Add(this.lbl_start_program3);
this.pnl_start_program3.Location = new System.Drawing.Point(48, 306);
this.pnl_start_program3.Name = "pnl_start_program3";
this.pnl_start_program3.Size = new System.Drawing.Size(959, 124);
this.pnl_start_program3.TabIndex = 18;
//
// cb_dont_start_if_running3
//
this.cb_dont_start_if_running3.AutoSize = true;
this.cb_dont_start_if_running3.ForeColor = System.Drawing.Color.White;
this.cb_dont_start_if_running3.Location = new System.Drawing.Point(167, 82);
this.cb_dont_start_if_running3.Name = "cb_dont_start_if_running3";
this.cb_dont_start_if_running3.Size = new System.Drawing.Size(289, 24);
this.cb_dont_start_if_running3.TabIndex = 20;
this.cb_dont_start_if_running3.Text = "Don\'t start if program already running";
this.cb_dont_start_if_running3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_dont_start_if_running3.UseVisualStyleBackColor = true;
this.cb_dont_start_if_running3.Visible = false;
//
// cb_start_program3
//
this.cb_start_program3.Location = new System.Drawing.Point(21, 18);
this.cb_start_program3.Name = "cb_start_program3";
this.cb_start_program3.Size = new System.Drawing.Size(15, 14);
this.cb_start_program3.TabIndex = 18;
this.cb_start_program3.UseVisualStyleBackColor = true;
this.cb_start_program3.CheckedChanged += new System.EventHandler(this.cb_start_program3_CheckedChanged);
//
// txt_start_program3
//
this.txt_start_program3.Location = new System.Drawing.Point(300, 11);
this.txt_start_program3.Name = "txt_start_program3";
this.txt_start_program3.Size = new System.Drawing.Size(535, 26);
this.txt_start_program3.TabIndex = 17;
this.txt_start_program3.Visible = false;
//
// cb_start_program_close3
//
this.cb_start_program_close3.AutoSize = true;
this.cb_start_program_close3.ForeColor = System.Drawing.Color.White;
this.cb_start_program_close3.Location = new System.Drawing.Point(547, 82);
this.cb_start_program_close3.Name = "cb_start_program_close3";
this.cb_start_program_close3.Size = new System.Drawing.Size(398, 24);
this.cb_start_program_close3.TabIndex = 16;
this.cb_start_program_close3.Text = "Close started program when you finish playing Game";
this.cb_start_program_close3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_close3.UseVisualStyleBackColor = true;
this.cb_start_program_close3.Visible = false;
//
// btn_start_program3
//
this.btn_start_program3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_start_program3.ForeColor = System.Drawing.Color.White;
this.btn_start_program3.Location = new System.Drawing.Point(851, 10);
this.btn_start_program3.Name = "btn_start_program3";
this.btn_start_program3.Size = new System.Drawing.Size(85, 27);
this.btn_start_program3.TabIndex = 15;
this.btn_start_program3.Text = "Choose";
this.btn_start_program3.UseVisualStyleBackColor = true;
this.btn_start_program3.Visible = false;
this.btn_start_program3.Click += new System.EventHandler(this.btn_start_program3_Click);
//
// txt_start_program_args3
//
this.txt_start_program_args3.Location = new System.Drawing.Point(397, 50);
this.txt_start_program_args3.Name = "txt_start_program_args3";
this.txt_start_program_args3.Size = new System.Drawing.Size(540, 26);
this.txt_start_program_args3.TabIndex = 14;
this.txt_start_program_args3.Visible = false;
//
// cb_start_program_pass_args3
//
this.cb_start_program_pass_args3.AutoSize = true;
this.cb_start_program_pass_args3.ForeColor = System.Drawing.Color.White;
this.cb_start_program_pass_args3.Location = new System.Drawing.Point(167, 52);
this.cb_start_program_pass_args3.Name = "cb_start_program_pass_args3";
this.cb_start_program_pass_args3.Size = new System.Drawing.Size(228, 24);
this.cb_start_program_pass_args3.TabIndex = 13;
this.cb_start_program_pass_args3.Text = "Pass arguments to program:";
this.cb_start_program_pass_args3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_pass_args3.UseVisualStyleBackColor = true;
this.cb_start_program_pass_args3.Visible = false;
this.cb_start_program_pass_args3.CheckedChanged += new System.EventHandler(this.cb_start_program_pass_args3_CheckedChanged);
//
// lbl_start_program3
//
this.lbl_start_program3.AutoSize = true;
this.lbl_start_program3.Location = new System.Drawing.Point(46, 14);
this.lbl_start_program3.Name = "lbl_start_program3";
this.lbl_start_program3.Size = new System.Drawing.Size(233, 20);
this.lbl_start_program3.TabIndex = 0;
this.lbl_start_program3.Text = "Choose a program to start third:";
this.lbl_start_program3.Click += new System.EventHandler(this.lbl_start_program3_Click);
//
// pnl_start_program2
//
this.pnl_start_program2.Controls.Add(this.cb_dont_start_if_running2);
this.pnl_start_program2.Controls.Add(this.cb_start_program2);
this.pnl_start_program2.Controls.Add(this.txt_start_program2);
this.pnl_start_program2.Controls.Add(this.cb_start_program_close2);
this.pnl_start_program2.Controls.Add(this.btn_start_program2);
this.pnl_start_program2.Controls.Add(this.txt_start_program_args2);
this.pnl_start_program2.Controls.Add(this.cb_start_program_pass_args2);
this.pnl_start_program2.Controls.Add(this.lbl_start_program2);
this.pnl_start_program2.Location = new System.Drawing.Point(48, 167);
this.pnl_start_program2.Name = "pnl_start_program2";
this.pnl_start_program2.Size = new System.Drawing.Size(959, 124);
this.pnl_start_program2.TabIndex = 18;
//
// cb_dont_start_if_running2
//
this.cb_dont_start_if_running2.AutoSize = true;
this.cb_dont_start_if_running2.ForeColor = System.Drawing.Color.White;
this.cb_dont_start_if_running2.Location = new System.Drawing.Point(167, 82);
this.cb_dont_start_if_running2.Name = "cb_dont_start_if_running2";
this.cb_dont_start_if_running2.Size = new System.Drawing.Size(289, 24);
this.cb_dont_start_if_running2.TabIndex = 19;
this.cb_dont_start_if_running2.Text = "Don\'t start if program already running";
this.cb_dont_start_if_running2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_dont_start_if_running2.UseVisualStyleBackColor = true;
this.cb_dont_start_if_running2.Visible = false;
//
// cb_start_program2
//
this.cb_start_program2.Location = new System.Drawing.Point(21, 18);
this.cb_start_program2.Name = "cb_start_program2";
this.cb_start_program2.Size = new System.Drawing.Size(15, 14);
this.cb_start_program2.TabIndex = 18;
this.cb_start_program2.UseVisualStyleBackColor = true;
this.cb_start_program2.CheckedChanged += new System.EventHandler(this.cb_start_program2_CheckedChanged);
//
// txt_start_program2
//
this.txt_start_program2.Location = new System.Drawing.Point(301, 11);
this.txt_start_program2.Name = "txt_start_program2";
this.txt_start_program2.Size = new System.Drawing.Size(534, 26);
this.txt_start_program2.TabIndex = 17;
this.txt_start_program2.Visible = false;
//
// cb_start_program_close2
//
this.cb_start_program_close2.AutoSize = true;
this.cb_start_program_close2.ForeColor = System.Drawing.Color.White;
this.cb_start_program_close2.Location = new System.Drawing.Point(547, 82);
this.cb_start_program_close2.Name = "cb_start_program_close2";
this.cb_start_program_close2.Size = new System.Drawing.Size(398, 24);
this.cb_start_program_close2.TabIndex = 16;
this.cb_start_program_close2.Text = "Close started program when you finish playing Game";
this.cb_start_program_close2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_close2.UseVisualStyleBackColor = true;
this.cb_start_program_close2.Visible = false;
//
// btn_start_program2
//
this.btn_start_program2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_start_program2.ForeColor = System.Drawing.Color.White;
this.btn_start_program2.Location = new System.Drawing.Point(852, 10);
this.btn_start_program2.Name = "btn_start_program2";
this.btn_start_program2.Size = new System.Drawing.Size(85, 27);
this.btn_start_program2.TabIndex = 15;
this.btn_start_program2.Text = "Choose";
this.btn_start_program2.UseVisualStyleBackColor = true;
this.btn_start_program2.Visible = false;
this.btn_start_program2.Click += new System.EventHandler(this.btn_start_program2_Click);
//
// txt_start_program_args2
//
this.txt_start_program_args2.Location = new System.Drawing.Point(397, 50);
this.txt_start_program_args2.Name = "txt_start_program_args2";
this.txt_start_program_args2.Size = new System.Drawing.Size(540, 26);
this.txt_start_program_args2.TabIndex = 14;
this.txt_start_program_args2.Visible = false;
//
// cb_start_program_pass_args2
//
this.cb_start_program_pass_args2.AutoSize = true;
this.cb_start_program_pass_args2.ForeColor = System.Drawing.Color.White;
this.cb_start_program_pass_args2.Location = new System.Drawing.Point(167, 52);
this.cb_start_program_pass_args2.Name = "cb_start_program_pass_args2";
this.cb_start_program_pass_args2.Size = new System.Drawing.Size(228, 24);
this.cb_start_program_pass_args2.TabIndex = 13;
this.cb_start_program_pass_args2.Text = "Pass arguments to program:";
this.cb_start_program_pass_args2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_pass_args2.UseVisualStyleBackColor = true;
this.cb_start_program_pass_args2.Visible = false;
this.cb_start_program_pass_args2.CheckedChanged += new System.EventHandler(this.cb_start_program_pass_args2_CheckedChanged);
//
// lbl_start_program2
//
this.lbl_start_program2.AutoSize = true;
this.lbl_start_program2.Location = new System.Drawing.Point(46, 14);
this.lbl_start_program2.Name = "lbl_start_program2";
this.lbl_start_program2.Size = new System.Drawing.Size(254, 20);
this.lbl_start_program2.TabIndex = 0;
this.lbl_start_program2.Text = "Choose a program to start second:";
this.lbl_start_program2.Click += new System.EventHandler(this.lbl_start_program2_Click);
//
// pnl_start_program1
//
this.pnl_start_program1.Controls.Add(this.cb_dont_start_if_running1);
this.pnl_start_program1.Controls.Add(this.cb_start_program1);
this.pnl_start_program1.Controls.Add(this.txt_start_program1);
this.pnl_start_program1.Controls.Add(this.cb_start_program_close1);
this.pnl_start_program1.Controls.Add(this.btn_start_program1);
this.pnl_start_program1.Controls.Add(this.txt_start_program_args1);
this.pnl_start_program1.Controls.Add(this.cb_start_program_pass_args1);
this.pnl_start_program1.Controls.Add(this.lbl_start_program1);
this.pnl_start_program1.Location = new System.Drawing.Point(48, 28);
this.pnl_start_program1.Name = "pnl_start_program1";
this.pnl_start_program1.Size = new System.Drawing.Size(959, 124);
this.pnl_start_program1.TabIndex = 0;
//
// cb_dont_start_if_running1
//
this.cb_dont_start_if_running1.AutoSize = true;
this.cb_dont_start_if_running1.ForeColor = System.Drawing.Color.White;
this.cb_dont_start_if_running1.Location = new System.Drawing.Point(167, 82);
this.cb_dont_start_if_running1.Name = "cb_dont_start_if_running1";
this.cb_dont_start_if_running1.Size = new System.Drawing.Size(289, 24);
this.cb_dont_start_if_running1.TabIndex = 18;
this.cb_dont_start_if_running1.Text = "Don\'t start if program already running";
this.cb_dont_start_if_running1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_dont_start_if_running1.UseVisualStyleBackColor = true;
this.cb_dont_start_if_running1.Visible = false;
//
// cb_start_program1
//
this.cb_start_program1.Location = new System.Drawing.Point(21, 18);
this.cb_start_program1.Name = "cb_start_program1";
this.cb_start_program1.Size = new System.Drawing.Size(15, 14);
this.cb_start_program1.TabIndex = 0;
this.cb_start_program1.UseVisualStyleBackColor = true;
this.cb_start_program1.CheckedChanged += new System.EventHandler(this.cb_start_program1_CheckedChanged);
//
// txt_start_program1
//
this.txt_start_program1.Location = new System.Drawing.Point(300, 11);
this.txt_start_program1.Name = "txt_start_program1";
this.txt_start_program1.Size = new System.Drawing.Size(535, 26);
this.txt_start_program1.TabIndex = 17;
this.txt_start_program1.Visible = false;
//
// cb_start_program_close1
//
this.cb_start_program_close1.AutoSize = true;
this.cb_start_program_close1.ForeColor = System.Drawing.Color.White;
this.cb_start_program_close1.Location = new System.Drawing.Point(547, 82);
this.cb_start_program_close1.Name = "cb_start_program_close1";
this.cb_start_program_close1.Size = new System.Drawing.Size(398, 24);
this.cb_start_program_close1.TabIndex = 16;
this.cb_start_program_close1.Text = "Close started program when you finish playing Game";
this.cb_start_program_close1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_close1.UseVisualStyleBackColor = true;
this.cb_start_program_close1.Visible = false;
//
// btn_start_program1
//
this.btn_start_program1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_start_program1.ForeColor = System.Drawing.Color.White;
this.btn_start_program1.Location = new System.Drawing.Point(851, 10);
this.btn_start_program1.Name = "btn_start_program1";
this.btn_start_program1.Size = new System.Drawing.Size(85, 27);
this.btn_start_program1.TabIndex = 15;
this.btn_start_program1.Text = "Choose";
this.btn_start_program1.UseVisualStyleBackColor = true;
this.btn_start_program1.Visible = false;
this.btn_start_program1.Click += new System.EventHandler(this.btn_start_program1_Click);
//
// txt_start_program_args1
//
this.txt_start_program_args1.Location = new System.Drawing.Point(397, 50);
this.txt_start_program_args1.Name = "txt_start_program_args1";
this.txt_start_program_args1.Size = new System.Drawing.Size(540, 26);
this.txt_start_program_args1.TabIndex = 14;
this.txt_start_program_args1.Visible = false;
//
// cb_start_program_pass_args1
//
this.cb_start_program_pass_args1.AutoSize = true;
this.cb_start_program_pass_args1.ForeColor = System.Drawing.Color.White;
this.cb_start_program_pass_args1.Location = new System.Drawing.Point(167, 52);
this.cb_start_program_pass_args1.Name = "cb_start_program_pass_args1";
this.cb_start_program_pass_args1.Size = new System.Drawing.Size(228, 24);
this.cb_start_program_pass_args1.TabIndex = 13;
this.cb_start_program_pass_args1.Text = "Pass arguments to program:";
this.cb_start_program_pass_args1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_pass_args1.UseVisualStyleBackColor = true;
this.cb_start_program_pass_args1.Visible = false;
this.cb_start_program_pass_args1.CheckedChanged += new System.EventHandler(this.cb_start_program_pass_args1_CheckedChanged);
//
// lbl_start_program1
//
this.lbl_start_program1.AutoSize = true;
this.lbl_start_program1.Location = new System.Drawing.Point(46, 14);
this.lbl_start_program1.Name = "lbl_start_program1";
this.lbl_start_program1.Size = new System.Drawing.Size(228, 20);
this.lbl_start_program1.TabIndex = 0;
this.lbl_start_program1.Text = "Choose a program to start first:";
this.lbl_start_program1.Click += new System.EventHandler(this.lbl_start_program1_Click);
// pnl_start_programs
//
this.pnl_start_programs.AutoScroll = true;
this.pnl_start_programs.BackColor = System.Drawing.Color.White;
this.pnl_start_programs.Location = new System.Drawing.Point(58, 65);
this.pnl_start_programs.Name = "pnl_start_programs";
this.pnl_start_programs.Size = new System.Drawing.Size(987, 507);
this.pnl_start_programs.TabIndex = 2;
//
// tabp_game
//
@ -1745,14 +1300,6 @@ namespace DisplayMagician.UIForms
this.gb_audio_volume.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nud_audio_volume)).EndInit();
this.tabp_before.ResumeLayout(false);
this.pnl_start_program4.ResumeLayout(false);
this.pnl_start_program4.PerformLayout();
this.pnl_start_program3.ResumeLayout(false);
this.pnl_start_program3.PerformLayout();
this.pnl_start_program2.ResumeLayout(false);
this.pnl_start_program2.PerformLayout();
this.pnl_start_program1.ResumeLayout(false);
this.pnl_start_program1.PerformLayout();
this.tabp_game.ResumeLayout(false);
this.tabp_game.PerformLayout();
this.p_standalone.ResumeLayout(false);
@ -1820,38 +1367,6 @@ namespace DisplayMagician.UIForms
private System.Windows.Forms.Label lbl_shortcut_name;
private System.Windows.Forms.Button btn_exe_to_start;
private System.Windows.Forms.CheckBox cb_autosuggest;
private System.Windows.Forms.Panel pnl_start_program1;
private System.Windows.Forms.Label lbl_start_program1;
private System.Windows.Forms.Panel pnl_start_program4;
private System.Windows.Forms.TextBox txt_start_program4;
private System.Windows.Forms.CheckBox cb_start_program_close4;
private System.Windows.Forms.Button btn_start_program4;
private System.Windows.Forms.TextBox txt_start_program_args4;
private System.Windows.Forms.CheckBox cb_start_program_pass_args4;
private System.Windows.Forms.Label lbl_start_program4;
private System.Windows.Forms.Panel pnl_start_program3;
private System.Windows.Forms.TextBox txt_start_program3;
private System.Windows.Forms.CheckBox cb_start_program_close3;
private System.Windows.Forms.Button btn_start_program3;
private System.Windows.Forms.TextBox txt_start_program_args3;
private System.Windows.Forms.CheckBox cb_start_program_pass_args3;
private System.Windows.Forms.Label lbl_start_program3;
private System.Windows.Forms.Panel pnl_start_program2;
private System.Windows.Forms.TextBox txt_start_program2;
private System.Windows.Forms.CheckBox cb_start_program_close2;
private System.Windows.Forms.Button btn_start_program2;
private System.Windows.Forms.TextBox txt_start_program_args2;
private System.Windows.Forms.CheckBox cb_start_program_pass_args2;
private System.Windows.Forms.Label lbl_start_program2;
private System.Windows.Forms.TextBox txt_start_program1;
private System.Windows.Forms.CheckBox cb_start_program_close1;
private System.Windows.Forms.Button btn_start_program1;
private System.Windows.Forms.TextBox txt_start_program_args1;
private System.Windows.Forms.CheckBox cb_start_program_pass_args1;
private System.Windows.Forms.CheckBox cb_start_program4;
private System.Windows.Forms.CheckBox cb_start_program3;
private System.Windows.Forms.CheckBox cb_start_program2;
private System.Windows.Forms.CheckBox cb_start_program1;
private System.Windows.Forms.TabPage tabp_audio;
private System.Windows.Forms.GroupBox gb_display_after;
private System.Windows.Forms.RadioButton rb_switch_display_permanent;
@ -1883,10 +1398,6 @@ namespace DisplayMagician.UIForms
private System.Windows.Forms.RadioButton rb_switch_capture_permanent;
private System.Windows.Forms.RadioButton rb_switch_capture_temp;
private System.Windows.Forms.Label lbl_no_game_libraries;
private System.Windows.Forms.CheckBox cb_dont_start_if_running4;
private System.Windows.Forms.CheckBox cb_dont_start_if_running3;
private System.Windows.Forms.CheckBox cb_dont_start_if_running2;
private System.Windows.Forms.CheckBox cb_dont_start_if_running1;
private System.Windows.Forms.Label lbl_disabled_shortcut_audio_chipset;
private System.Windows.Forms.Label lbl_no_active_audio_devices;
private System.Windows.Forms.Label lbl_no_active_capture_devices;
@ -1895,5 +1406,6 @@ namespace DisplayMagician.UIForms
private System.Windows.Forms.CheckBox cb_wait_alternative_game;
private System.Windows.Forms.Button btn_hotkey;
private System.Windows.Forms.Label lbl_hotkey_assigned;
private System.Windows.Forms.Panel pnl_start_programs;
}
}

View File

@ -26,7 +26,7 @@ namespace DisplayMagician.UIForms
private ProfileAdaptor _profileAdaptor;
//private List<ProfileItem> _loadedProfiles = new List<ProfileItem>();
private ProfileItem _profileToUse= null;
private ProfileItem _profileToUse = null;
private GameStruct _gameToUse;
private Executable _executableToUse;
private ShortcutPermanence _displayPermanence = ShortcutPermanence.Temporary;
@ -47,7 +47,7 @@ namespace DisplayMagician.UIForms
private bool _loadedShortcut = false;
private bool _autoName = true;
private string _gameId = "0";
private string _uuid = "";
private string _uuid = "";
private CoreAudioController audioController = null;
private List<CoreAudioDevice> audioDevices = null;
private CoreAudioDevice selectedAudioDevice = null;
@ -76,7 +76,7 @@ namespace DisplayMagician.UIForms
ilv_saved_profiles.SetRenderer(new ProfileILVRenderer());
}
catch(Exception ex)
catch (Exception ex)
{
logger.Error(ex, $"ShortcutForm/ShortcutForm: Exception while trying to setup the game ImageListView and set the render.");
}
@ -92,7 +92,8 @@ namespace DisplayMagician.UIForms
{
logger.Warn(ex, $"ShortcutForm/ShortcutForm: Exception while trying to initialise CoreAudioController in ShortcutForm. Audio Chipset on your computer is not supported. You will be unable to set audio settings.");
}
}
}
public ShortcutItem Shortcut
{
@ -453,8 +454,10 @@ namespace DisplayMagician.UIForms
_capturePermanence = ShortcutPermanence.Temporary;
}
// Save the start program 1
StartProgram myStartProgram = new StartProgram
/*StartProgram myStartProgram = new StartProgram
{
Priority = 1,
Enabled = cb_start_program1.Checked,
@ -500,7 +503,7 @@ namespace DisplayMagician.UIForms
CloseOnFinish = cb_start_program_close4.Checked,
DontStartIfAlreadyRunning = cb_dont_start_if_running4.Checked
};
_startPrograms.Add(myStartProgram);
_startPrograms.Add(myStartProgram); */
// Now we create the Shortcut Object ready to save
// If we're launching a game
@ -1155,10 +1158,21 @@ namespace DisplayMagician.UIForms
if (_shortcutToEdit.StartPrograms is List<StartProgram> && _shortcutToEdit.StartPrograms.Count > 0)
{
foreach (StartProgram myStartProgram in _shortcutToEdit.StartPrograms)
int x = 0;
int y = 0;
// Order the inital list in order of priority
foreach (StartProgram myStartProgram in _shortcutToEdit.StartPrograms.OrderBy(sp => sp.Priority))
{
// Update the 4 programs to start
StartProgramControl startProgramControl = new StartProgramControl(myStartProgram);
startProgramControl.Location = new Point(x, y);
startProgramControl.BringToFront();
startProgramControl.Margin = DefaultMargin;
startProgramControl.Width = pnl_start_programs.Width;
pnl_start_programs.Controls.Add(startProgramControl);
y += startProgramControl.Height;
/*// Update the 4 programs to start
switch (myStartProgram.Priority)
{
case 1:
@ -1194,7 +1208,7 @@ namespace DisplayMagician.UIForms
cb_dont_start_if_running4.Checked = myStartProgram.DontStartIfAlreadyRunning;
break;
}
}*/
}
}
@ -1613,194 +1627,7 @@ namespace DisplayMagician.UIForms
}
return textToReturn;
}
private void btn_start_program1_Click(object sender, EventArgs e)
{
txt_start_program1.Text = getExeFile();
}
private void btn_start_program2_Click(object sender, EventArgs e)
{
txt_start_program2.Text = getExeFile();
}
private void btn_start_program3_Click(object sender, EventArgs e)
{
txt_start_program3.Text = getExeFile();
}
private void btn_start_program4_Click(object sender, EventArgs e)
{
txt_start_program4.Text = getExeFile();
}
private void cb_start_program1_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 1 fields
if (cb_start_program1.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program1.Visible = true;
btn_start_program1.Visible = true;
cb_start_program_pass_args1.Visible = true;
cb_start_program_close1.Visible = true;
cb_dont_start_if_running1.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program1.Visible = false;
btn_start_program1.Visible = false;
cb_start_program_pass_args1.Visible = false;
cb_start_program_close1.Visible = false;
cb_dont_start_if_running1.Visible = false;
}
}
private void cb_start_program2_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 2 fields
if (cb_start_program2.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program2.Visible = true;
btn_start_program2.Visible = true;
cb_start_program_pass_args2.Visible = true;
cb_start_program_close2.Visible = true;
cb_dont_start_if_running2.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program2.Visible = false;
btn_start_program2.Visible = false;
cb_start_program_pass_args2.Visible = false;
cb_start_program_close2.Visible = false;
cb_dont_start_if_running2.Visible = false;
}
}
private void cb_start_program3_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 3 fields
if (cb_start_program3.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program3.Visible = true;
btn_start_program3.Visible = true;
cb_start_program_pass_args3.Visible = true;
cb_start_program_close3.Visible = true;
cb_dont_start_if_running3.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program3.Visible = false;
btn_start_program3.Visible = false;
cb_start_program_pass_args3.Visible = false;
cb_start_program_close3.Visible = false;
cb_dont_start_if_running3.Visible = false;
}
}
private void cb_start_program4_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 4 fields
if (cb_start_program4.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program4.Visible = true;
btn_start_program4.Visible = true;
cb_start_program_pass_args4.Visible = true;
cb_start_program_close4.Visible = true;
cb_dont_start_if_running4.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program4.Visible = false;
btn_start_program4.Visible = false;
cb_start_program_pass_args4.Visible = false;
cb_start_program_close4.Visible = false;
cb_dont_start_if_running4.Visible = false;
}
}
private void cb_start_program_pass_args1_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 1 fields
if (cb_start_program_pass_args1.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program_args1.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program_args1.Visible = false;
}
}
private void cb_start_program_pass_args2_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 2 fields
if (cb_start_program_pass_args2.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program_args2.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program_args2.Visible = false;
}
}
private void cb_start_program_pass_args3_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 3 fields
if (cb_start_program_pass_args3.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program_args3.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program_args3.Visible = false;
}
}
private void cb_start_program_pass_args4_CheckedChanged(object sender, EventArgs e)
{
if (_loadedShortcut)
_isUnsaved = true;
// Disable the start program 4 fields
if (cb_start_program_pass_args4.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program_args4.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program_args4.Visible = false;
}
}
private void rb_no_change_audio_CheckedChanged(object sender, EventArgs e)
{
if (rb_no_change_audio.Checked)
@ -2171,37 +1998,6 @@ namespace DisplayMagician.UIForms
_captureVolume = Convert.ToDecimal(nud_capture_volume.Value);
}
private void lbl_start_program1_Click(object sender, EventArgs e)
{
if (!cb_start_program1.Checked)
cb_start_program1.CheckState = CheckState.Checked;
else
cb_start_program1.CheckState = CheckState.Unchecked;
}
private void lbl_start_program2_Click(object sender, EventArgs e)
{
if (!cb_start_program2.Checked)
cb_start_program2.CheckState = CheckState.Checked;
else
cb_start_program2.CheckState = CheckState.Unchecked;
}
private void lbl_start_program3_Click(object sender, EventArgs e)
{
if (!cb_start_program3.Checked)
cb_start_program3.CheckState = CheckState.Checked;
else
cb_start_program3.CheckState = CheckState.Unchecked;
}
private void lbl_start_program4_Click(object sender, EventArgs e)
{
if (!cb_start_program4.Checked)
cb_start_program4.CheckState = CheckState.Checked;
else
cb_start_program4.CheckState = CheckState.Unchecked;
}
private void cb_wait_alternative_game_CheckedChanged(object sender, EventArgs e)
{
@ -2219,6 +2015,7 @@ namespace DisplayMagician.UIForms
}
}
private void btn_choose_alternative_game_Click(object sender, EventArgs e)
{
if (dialog_open.ShowDialog(this) == DialogResult.OK)

View File

@ -0,0 +1,182 @@

namespace DisplayMagician.UIForms
{
partial class StartProgramControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.cb_dont_start_if_running = new System.Windows.Forms.CheckBox();
this.txt_start_program = new System.Windows.Forms.TextBox();
this.cb_start_program_close = new System.Windows.Forms.CheckBox();
this.btn_start_program = new System.Windows.Forms.Button();
this.txt_start_program_args = new System.Windows.Forms.TextBox();
this.cb_start_program_pass_args = new System.Windows.Forms.CheckBox();
this.btn_delete = new System.Windows.Forms.Button();
this.cb_start_program = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// cb_dont_start_if_running
//
this.cb_dont_start_if_running.AutoSize = true;
this.cb_dont_start_if_running.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_dont_start_if_running.ForeColor = System.Drawing.Color.White;
this.cb_dont_start_if_running.Location = new System.Drawing.Point(135, 97);
this.cb_dont_start_if_running.Name = "cb_dont_start_if_running";
this.cb_dont_start_if_running.Size = new System.Drawing.Size(289, 24);
this.cb_dont_start_if_running.TabIndex = 26;
this.cb_dont_start_if_running.Text = "Don\'t start if program already running";
this.cb_dont_start_if_running.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_dont_start_if_running.UseVisualStyleBackColor = true;
this.cb_dont_start_if_running.Visible = false;
//
// txt_start_program
//
this.txt_start_program.BackColor = System.Drawing.Color.White;
this.txt_start_program.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_start_program.ForeColor = System.Drawing.Color.Black;
this.txt_start_program.Location = new System.Drawing.Point(268, 20);
this.txt_start_program.Name = "txt_start_program";
this.txt_start_program.Size = new System.Drawing.Size(535, 26);
this.txt_start_program.TabIndex = 25;
this.txt_start_program.Visible = false;
//
// cb_start_program_close
//
this.cb_start_program_close.AutoSize = true;
this.cb_start_program_close.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_start_program_close.ForeColor = System.Drawing.Color.White;
this.cb_start_program_close.Location = new System.Drawing.Point(515, 97);
this.cb_start_program_close.Name = "cb_start_program_close";
this.cb_start_program_close.Size = new System.Drawing.Size(398, 24);
this.cb_start_program_close.TabIndex = 24;
this.cb_start_program_close.Text = "Close started program when you finish playing Game";
this.cb_start_program_close.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_close.UseVisualStyleBackColor = true;
this.cb_start_program_close.Visible = false;
//
// btn_start_program
//
this.btn_start_program.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_start_program.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_start_program.ForeColor = System.Drawing.Color.White;
this.btn_start_program.Location = new System.Drawing.Point(819, 19);
this.btn_start_program.Name = "btn_start_program";
this.btn_start_program.Size = new System.Drawing.Size(85, 27);
this.btn_start_program.TabIndex = 23;
this.btn_start_program.Text = "Choose";
this.btn_start_program.UseVisualStyleBackColor = true;
this.btn_start_program.Visible = false;
this.btn_start_program.Click += new System.EventHandler(this.btn_start_program_Click);
//
// txt_start_program_args
//
this.txt_start_program_args.BackColor = System.Drawing.Color.White;
this.txt_start_program_args.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txt_start_program_args.ForeColor = System.Drawing.Color.Black;
this.txt_start_program_args.Location = new System.Drawing.Point(365, 60);
this.txt_start_program_args.Name = "txt_start_program_args";
this.txt_start_program_args.Size = new System.Drawing.Size(540, 26);
this.txt_start_program_args.TabIndex = 22;
this.txt_start_program_args.Visible = false;
//
// cb_start_program_pass_args
//
this.cb_start_program_pass_args.AutoSize = true;
this.cb_start_program_pass_args.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_start_program_pass_args.ForeColor = System.Drawing.Color.White;
this.cb_start_program_pass_args.Location = new System.Drawing.Point(135, 62);
this.cb_start_program_pass_args.Name = "cb_start_program_pass_args";
this.cb_start_program_pass_args.Size = new System.Drawing.Size(228, 24);
this.cb_start_program_pass_args.TabIndex = 21;
this.cb_start_program_pass_args.Text = "Pass arguments to program:";
this.cb_start_program_pass_args.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program_pass_args.UseVisualStyleBackColor = true;
this.cb_start_program_pass_args.Visible = false;
this.cb_start_program_pass_args.CheckedChanged += new System.EventHandler(this.cb_start_program_pass_args_CheckedChanged);
//
// btn_delete
//
this.btn_delete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_delete.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_delete.ForeColor = System.Drawing.Color.White;
this.btn_delete.Location = new System.Drawing.Point(933, 3);
this.btn_delete.Name = "btn_delete";
this.btn_delete.Size = new System.Drawing.Size(29, 27);
this.btn_delete.TabIndex = 27;
this.btn_delete.Text = "X";
this.btn_delete.UseVisualStyleBackColor = true;
this.btn_delete.Visible = false;
this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click);
//
// cb_start_program
//
this.cb_start_program.AutoSize = true;
this.cb_start_program.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_start_program.ForeColor = System.Drawing.Color.White;
this.cb_start_program.Location = new System.Drawing.Point(34, 21);
this.cb_start_program.Name = "cb_start_program";
this.cb_start_program.Size = new System.Drawing.Size(222, 24);
this.cb_start_program.TabIndex = 28;
this.cb_start_program.Text = "Start the following program:";
this.cb_start_program.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cb_start_program.UseVisualStyleBackColor = true;
this.cb_start_program.Visible = false;
this.cb_start_program.CheckedChanged += new System.EventHandler(this.cb_start_program_CheckedChanged);
//
// StartProgramControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.Controls.Add(this.cb_start_program);
this.Controls.Add(this.btn_delete);
this.Controls.Add(this.cb_dont_start_if_running);
this.Controls.Add(this.txt_start_program);
this.Controls.Add(this.cb_start_program_close);
this.Controls.Add(this.btn_start_program);
this.Controls.Add(this.txt_start_program_args);
this.Controls.Add(this.cb_start_program_pass_args);
this.ForeColor = System.Drawing.Color.White;
this.Name = "StartProgramControl";
this.Size = new System.Drawing.Size(965, 136);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox cb_dont_start_if_running;
private System.Windows.Forms.TextBox txt_start_program;
private System.Windows.Forms.CheckBox cb_start_program_close;
private System.Windows.Forms.Button btn_start_program;
private System.Windows.Forms.TextBox txt_start_program_args;
private System.Windows.Forms.CheckBox cb_start_program_pass_args;
private System.Windows.Forms.Button btn_delete;
private System.Windows.Forms.CheckBox cb_start_program;
}
}

View File

@ -0,0 +1,125 @@
using DisplayMagician.Resources;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DisplayMagician.UIForms
{
public partial class StartProgramControl : UserControl
{
public StartProgramControl()
{
InitializeComponent();
}
public StartProgramControl(StartProgram startProgram)
{
InitializeComponent();
// Now initialise the controls
txt_start_program.Text = startProgram.Executable;
txt_start_program.BackColor = Color.White;
txt_start_program.ForeColor = Color.Black;
txt_start_program.Visible= true;
txt_start_program.BringToFront();
cb_start_program.Checked = startProgram.Enabled;
txt_start_program.ForeColor = Color.White;
cb_start_program_pass_args.Checked = startProgram.ExecutableArgumentsRequired;
txt_start_program_args.Text = startProgram.Arguments;
cb_start_program_close.Checked = startProgram.CloseOnFinish;
cb_dont_start_if_running.Checked = startProgram.DontStartIfAlreadyRunning;
}
private void btn_start_program_Click(object sender, EventArgs e)
{
txt_start_program.Text = getExeFile();
}
private void cb_start_program_CheckedChanged(object sender, EventArgs e)
{
// Disable the start program 1 fields
if (cb_start_program.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program.Visible = true;
btn_start_program.Visible = true;
cb_start_program_pass_args.Visible = true;
cb_start_program_close.Visible = true;
cb_dont_start_if_running.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program.Visible = false;
btn_start_program.Visible = false;
cb_start_program_pass_args.Visible = false;
cb_start_program_close.Visible = false;
cb_dont_start_if_running.Visible = false;
}
}
private void cb_start_program_pass_args_CheckedChanged(object sender, EventArgs e)
{
// Disable the start program 1 fields
if (cb_start_program_pass_args.Checked)
{
// Enable the Executable Arguments Text field
txt_start_program_args.Visible = true;
}
else
{
// Disable the Executable Arguments Text field
txt_start_program_args.Visible = false;
}
}
private string getExeFile()
{
string textToReturn = "";
OpenFileDialog dialog_open = new OpenFileDialog();
if (dialog_open.ShowDialog(this) == DialogResult.OK)
{
if (File.Exists(dialog_open.FileName))
{
textToReturn = dialog_open.FileName;
dialog_open.FileName = string.Empty;
}
else
{
MessageBox.Show(
Language.Selected_file_is_not_a_valid_file,
Language.Executable,
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
}
return textToReturn;
}
private void lbl_start_program_Click(object sender, EventArgs e)
{
if (!cb_start_program.Checked)
cb_start_program.CheckState = CheckState.Checked;
else
cb_start_program.CheckState = CheckState.Unchecked;
}
private void btn_delete_Click(object sender, EventArgs e)
{
}
}
}

View File

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

View File

@ -38,9 +38,6 @@
<Component Id="cmpE8833A8E220525D7707A018B20CEDD87" Guid="{EBC27E33-6C4D-4612-BC5F-AC0A09DDD636}">
<File Id="filD4FD53D2FBF78674DBC3A1B446B44FC5" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\EDIDParser.dll" />
</Component>
<Component Id="cmp5590028E220525D7707A018B20CE3822" Guid="{EBC27E33-6C4D-4612-BD5F-DC0A09DDD559}">
<File Id="filD45593D2FBF78674DBC3A1B446B44559" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\HotkeyListener.dll" />
</Component>
<Component Id="cmp8C52E948AAB2D43DF696BB7D003A8E4B" Guid="{3C8F90C4-CFD5-4B8C-9929-44239BAECE94}">
<File Id="fil1965347683EC48A269FE672473CD04C2" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\HtmlAgilityPack.dll" />
</Component>
@ -77,7 +74,13 @@
<Component Id="cmpA7927FF61A499CF81EE0A562CDFEDEC7" Guid="{6D08FDFC-F2BA-462E-A678-6DAABBE3A2C8}">
<File Id="filD7DC5F43B3964ACECD7725F05E664960" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpC64ECA245317593760E42F3996F3A079" Guid="{AF290F63-703E-441F-86C8-2F00DADDEF9B}">
<Component Id="cmp5590028E220525D7707A018B20CE3822" Guid="{EBC27E33-6C4D-4612-BD5F-DC0A09DDD559}">
<File Id="filD45593D2FBF78674DBC3A1B446B44559" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\NHotkey.dll" />
</Component>
<Component Id="cmpFF90028E220525D7707A018B20CE3822" Guid="{EBC27E33-6C4D-4612-BD5F-FF0A09DDD559}">
<File Id="filDFF593D2FBF78674DBC3A1B446B44559" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\NHotkey.WindowsForms.dll" />
</Component>
<Component Id="cmpC64ECA245317593760E42F3996F3A079" Guid="{AF290F63-703E-441F-86C8-2F00DADDEF9B}">
<File Id="fil5299F0448E950048C778AA65A04FB498" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\NLog.dll" />
</Component>
<Component Id="cmp5CFF8A0C9C138424DA47E04F4B0986EB" Guid="{F5FC1F41-141E-4DDE-97D7-4D8E0BAF0578}">
@ -237,6 +240,7 @@
<!-- <ComponentRef Id="cmpB76F273FDED5EA841158E966B403CFC8" />
<ComponentRef Id="cmp7DD29D6442A6E450B2316729EA2C0F1D" />-->
<ComponentRef Id="cmp5590028E220525D7707A018B20CE3822" />
<ComponentRef Id="cmpFF90028E220525D7707A018B20CE3822" />
<ComponentRef Id="cmpA8825A49786C04320E75BCFC8E961667" />
<ComponentRef Id="cmp5069692C1912B298A026EA30A3823321" />
<ComponentRef Id="cmp650327FC006E09EDFC7039D6E7A6F340" />