Adding test action button to edit action form.
Action.DoExecute now protected.
1.1 --- a/Server/Actions/ActionCecActiveSource.cs Fri Jul 29 13:09:38 2016 +0200
1.2 +++ b/Server/Actions/ActionCecActiveSource.cs Fri Jul 29 14:33:47 2016 +0200
1.3 @@ -25,7 +25,7 @@
1.4 /// <summary>
1.5 /// Set the defined device type as active source.
1.6 /// </summary>
1.7 - public override void DoExecute()
1.8 + protected override void DoExecute()
1.9 {
1.10 if (Cec.Client.Static == null)
1.11 {
2.1 --- a/Server/Actions/ActionCecClose.cs Fri Jul 29 13:09:38 2016 +0200
2.2 +++ b/Server/Actions/ActionCecClose.cs Fri Jul 29 14:33:47 2016 +0200
2.3 @@ -13,7 +13,7 @@
2.4 [AttributeAction(Id = "Cec.Close", Name = "CEC Close", Description = "Close CEC connection.")]
2.5 class ActionCecClose : SharpLib.Ear.Action
2.6 {
2.7 - public override void DoExecute()
2.8 + protected override void DoExecute()
2.9 {
2.10 if (Cec.Client.Static == null)
2.11 {
3.1 --- a/Server/Actions/ActionCecDevicePowerOn.cs Fri Jul 29 13:09:38 2016 +0200
3.2 +++ b/Server/Actions/ActionCecDevicePowerOn.cs Fri Jul 29 14:33:47 2016 +0200
3.3 @@ -26,7 +26,7 @@
3.4 /// <summary>
3.5 ///
3.6 /// </summary>
3.7 - public override void DoExecute()
3.8 + protected override void DoExecute()
3.9 {
3.10 if (Cec.Client.Static == null)
3.11 {
4.1 --- a/Server/Actions/ActionCecDeviceStandby.cs Fri Jul 29 13:09:38 2016 +0200
4.2 +++ b/Server/Actions/ActionCecDeviceStandby.cs Fri Jul 29 14:33:47 2016 +0200
4.3 @@ -26,7 +26,7 @@
4.4 /// <summary>
4.5 ///
4.6 /// </summary>
4.7 - public override void DoExecute()
4.8 + protected override void DoExecute()
4.9 {
4.10 if (Cec.Client.Static == null)
4.11 {
5.1 --- a/Server/Actions/ActionCecInactiveSource.cs Fri Jul 29 13:09:38 2016 +0200
5.2 +++ b/Server/Actions/ActionCecInactiveSource.cs Fri Jul 29 14:33:47 2016 +0200
5.3 @@ -13,7 +13,7 @@
5.4 [AttributeAction(Id = "Cec.InactiveSource", Name = "CEC Inactive Source", Description = "Set this CEC device as inactive source.")]
5.5 class ActionCecInactiveSource : SharpLib.Ear.Action
5.6 {
5.7 - public override void DoExecute()
5.8 + protected override void DoExecute()
5.9 {
5.10 if (Cec.Client.Static == null)
5.11 {
6.1 --- a/Server/Actions/ActionCecOpen.cs Fri Jul 29 13:09:38 2016 +0200
6.2 +++ b/Server/Actions/ActionCecOpen.cs Fri Jul 29 14:33:47 2016 +0200
6.3 @@ -13,7 +13,7 @@
6.4 [AttributeAction(Id = "Cec.Open", Name = "CEC Open", Description = "Open CEC connection.")]
6.5 class ActionCecOpen : SharpLib.Ear.Action
6.6 {
6.7 - public override void DoExecute()
6.8 + protected override void DoExecute()
6.9 {
6.10 if (Cec.Client.Static == null)
6.11 {
7.1 --- a/Server/Actions/ActionCecScan.cs Fri Jul 29 13:09:38 2016 +0200
7.2 +++ b/Server/Actions/ActionCecScan.cs Fri Jul 29 14:33:47 2016 +0200
7.3 @@ -14,7 +14,7 @@
7.4 [AttributeAction(Id = "Cec.Scan", Name = "CEC Scan", Description = "Scan devices on your CEC HDMI network.")]
7.5 class ActionCecScan : SharpLib.Ear.Action
7.6 {
7.7 - public override void DoExecute()
7.8 + protected override void DoExecute()
7.9 {
7.10 if (Cec.Client.Static == null)
7.11 {
8.1 --- a/Server/Actions/ActionCecUserControlPressed.cs Fri Jul 29 13:09:38 2016 +0200
8.2 +++ b/Server/Actions/ActionCecUserControlPressed.cs Fri Jul 29 14:33:47 2016 +0200
8.3 @@ -56,7 +56,7 @@
8.4 /// <summary>
8.5 ///
8.6 /// </summary>
8.7 - public override void DoExecute()
8.8 + protected override void DoExecute()
8.9 {
8.10 if (Cec.Client.Static == null)
8.11 {
9.1 --- a/Server/Actions/ActionCecUserControlReleased.cs Fri Jul 29 13:09:38 2016 +0200
9.2 +++ b/Server/Actions/ActionCecUserControlReleased.cs Fri Jul 29 14:33:47 2016 +0200
9.3 @@ -48,7 +48,7 @@
9.4 /// <summary>
9.5 ///
9.6 /// </summary>
9.7 - public override void DoExecute()
9.8 + protected override void DoExecute()
9.9 {
9.10 if (Cec.Client.Static == null)
9.11 {
10.1 --- a/Server/Actions/ActionDisplayMessage.cs Fri Jul 29 13:09:38 2016 +0200
10.2 +++ b/Server/Actions/ActionDisplayMessage.cs Fri Jul 29 14:33:47 2016 +0200
10.3 @@ -65,7 +65,7 @@
10.4 /// <summary>
10.5 ///
10.6 /// </summary>
10.7 - public override void DoExecute()
10.8 + protected override void DoExecute()
10.9 {
10.10 StartMessageClient();
10.11 }
11.1 --- a/Server/FormEditAction.Designer.cs Fri Jul 29 13:09:38 2016 +0200
11.2 +++ b/Server/FormEditAction.Designer.cs Fri Jul 29 14:33:47 2016 +0200
11.3 @@ -35,6 +35,7 @@
11.4 this.buttonCancel = new System.Windows.Forms.Button();
11.5 this.iTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
11.6 this.toolTip = new System.Windows.Forms.ToolTip(this.components);
11.7 + this.buttonTest = new System.Windows.Forms.Button();
11.8 this.SuspendLayout();
11.9 //
11.10 // comboBoxActionType
11.11 @@ -100,6 +101,17 @@
11.12 this.iTableLayoutPanel.Size = new System.Drawing.Size(312, 16);
11.13 this.iTableLayoutPanel.TabIndex = 23;
11.14 //
11.15 + // buttonTest
11.16 + //
11.17 + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
11.18 + this.buttonTest.Location = new System.Drawing.Point(252, 72);
11.19 + this.buttonTest.Name = "buttonTest";
11.20 + this.buttonTest.Size = new System.Drawing.Size(75, 23);
11.21 + this.buttonTest.TabIndex = 24;
11.22 + this.buttonTest.Text = "Test";
11.23 + this.buttonTest.UseVisualStyleBackColor = true;
11.24 + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click);
11.25 + //
11.26 // FormEditAction
11.27 //
11.28 this.AcceptButton = this.buttonOk;
11.29 @@ -109,6 +121,7 @@
11.30 this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
11.31 this.CancelButton = this.buttonCancel;
11.32 this.ClientSize = new System.Drawing.Size(339, 107);
11.33 + this.Controls.Add(this.buttonTest);
11.34 this.Controls.Add(this.iTableLayoutPanel);
11.35 this.Controls.Add(this.buttonCancel);
11.36 this.Controls.Add(this.buttonOk);
11.37 @@ -134,5 +147,6 @@
11.38 private System.Windows.Forms.Button buttonCancel;
11.39 private System.Windows.Forms.TableLayoutPanel iTableLayoutPanel;
11.40 private System.Windows.Forms.ToolTip toolTip;
11.41 + private System.Windows.Forms.Button buttonTest;
11.42 }
11.43 }
11.44 \ No newline at end of file
12.1 --- a/Server/FormEditAction.cs Fri Jul 29 13:09:38 2016 +0200
12.2 +++ b/Server/FormEditAction.cs Fri Jul 29 14:33:47 2016 +0200
12.3 @@ -316,5 +316,10 @@
12.4
12.5 }
12.6
12.7 + private void buttonTest_Click(object sender, EventArgs e)
12.8 + {
12.9 + FetchPropertiesValue(Action);
12.10 + Action.Execute();
12.11 + }
12.12 }
12.13 }
13.1 --- a/Server/FormMain.cs Fri Jul 29 13:09:38 2016 +0200
13.2 +++ b/Server/FormMain.cs Fri Jul 29 14:33:47 2016 +0200
13.3 @@ -2790,6 +2790,7 @@
13.4 }
13.5
13.6 FormEditAction ea = new FormEditAction();
13.7 + ea.Text = "Add action";
13.8 DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
13.9 if (res == DialogResult.OK)
13.10 {
13.11 @@ -2816,6 +2817,7 @@
13.12 }
13.13
13.14 FormEditAction ea = new FormEditAction();
13.15 + ea.Text = "Edit action";
13.16 ea.Action = selectedAction;
13.17 int actionIndex = iTreeViewEvents.SelectedNode.Index;
13.18 DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
14.1 --- a/SharpLibEar/Action.cs Fri Jul 29 13:09:38 2016 +0200
14.2 +++ b/SharpLibEar/Action.cs Fri Jul 29 14:33:47 2016 +0200
14.3 @@ -12,7 +12,7 @@
14.4 [KnownType("DerivedTypes")]
14.5 public abstract class Action: IComparable
14.6 {
14.7 - public abstract void DoExecute();
14.8 + protected abstract void DoExecute();
14.9
14.10 public void Execute()
14.11 {
15.1 --- a/SharpLibEar/ActionCallback.cs Fri Jul 29 13:09:38 2016 +0200
15.2 +++ b/SharpLibEar/ActionCallback.cs Fri Jul 29 14:33:47 2016 +0200
15.3 @@ -17,7 +17,7 @@
15.4 iCallback = aCallback;
15.5 }
15.6
15.7 - public override void DoExecute()
15.8 + protected override void DoExecute()
15.9 {
15.10 if (iCallback != null)
15.11 {
16.1 --- a/SharpLibEar/ActionSleep.cs Fri Jul 29 13:09:38 2016 +0200
16.2 +++ b/SharpLibEar/ActionSleep.cs Fri Jul 29 14:33:47 2016 +0200
16.3 @@ -43,7 +43,7 @@
16.4 }
16.5
16.6
16.7 - public override void DoExecute()
16.8 + protected override void DoExecute()
16.9 {
16.10 Thread.Sleep(TimeoutInMilliseconds);
16.11 }