# HG changeset patch
# User StephaneLenclud
# Date 1469796390 -7200
# Node ID 7c631055b94bf0db8205fb1565dfb709438c8ea9
# Parent 6a84d8282226b82382e0924ac4f5ce49e7831e38
Adding event test button.
diff -r 6a84d8282226 -r 7c631055b94b Server/FormMain.Designer.cs
--- a/Server/FormMain.Designer.cs Fri Jul 29 14:33:47 2016 +0200
+++ b/Server/FormMain.Designer.cs Fri Jul 29 14:46:30 2016 +0200
@@ -129,6 +129,7 @@
this.labelFontHeight = new System.Windows.Forms.Label();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
+ this.buttonEventTest = new System.Windows.Forms.Button();
this.panelDisplay.SuspendLayout();
this.iTableLayoutPanel.SuspendLayout();
this.statusStrip.SuspendLayout();
@@ -973,6 +974,7 @@
//
// tabPageEvent
//
+ this.tabPageEvent.Controls.Add(this.buttonEventTest);
this.tabPageEvent.Controls.Add(this.buttonActionEdit);
this.tabPageEvent.Controls.Add(this.buttonActionMoveUp);
this.tabPageEvent.Controls.Add(this.buttonActionMoveDown);
@@ -1187,6 +1189,17 @@
//
this.openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
//
+ // buttonEventTest
+ //
+ this.buttonEventTest.Enabled = false;
+ this.buttonEventTest.Location = new System.Drawing.Point(6, 122);
+ this.buttonEventTest.Name = "buttonEventTest";
+ this.buttonEventTest.Size = new System.Drawing.Size(96, 23);
+ this.buttonEventTest.TabIndex = 26;
+ this.buttonEventTest.Text = "Test Event";
+ this.buttonEventTest.UseVisualStyleBackColor = true;
+ this.buttonEventTest.Click += new System.EventHandler(this.buttonEventTest_Click);
+ //
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1330,6 +1343,7 @@
private System.Windows.Forms.Button buttonActionMoveDown;
private System.Windows.Forms.Button buttonActionTest;
private System.Windows.Forms.Button buttonActionEdit;
+ private System.Windows.Forms.Button buttonEventTest;
}
}
diff -r 6a84d8282226 -r 7c631055b94b Server/FormMain.cs
--- a/Server/FormMain.cs Fri Jul 29 14:33:47 2016 +0200
+++ b/Server/FormMain.cs Fri Jul 29 14:46:30 2016 +0200
@@ -2863,7 +2863,7 @@
SharpLib.Ear.Action a = CurrentAction();
if (a != null)
{
- Console.WriteLine("Action test run");
+ Console.WriteLine("Action testing:");
a.Execute();
}
iTreeViewEvents.Focus();
@@ -2930,6 +2930,21 @@
///
+ ///
+ ///
+ ///
+ ///
+ private void buttonEventTest_Click(object sender, EventArgs e)
+ {
+ Event earEvent = CurrentEvent();
+ if (earEvent != null)
+ {
+ Console.WriteLine("Event testing:");
+ earEvent.Trigger();
+ }
+ }
+
+ ///
/// Manages events and actions buttons according to selected item in event tree.
///
///
@@ -2937,7 +2952,9 @@
private void iTreeViewEvents_AfterSelect(object sender, TreeViewEventArgs e)
{
//Enable buttons according to selected item
- buttonActionAdd.Enabled = CurrentEvent() != null;
+ buttonActionAdd.Enabled =
+ buttonEventTest.Enabled =
+ CurrentEvent() != null;
SharpLib.Ear.Action currentAction = CurrentAction();
//If an action is selected enable the following buttons
diff -r 6a84d8282226 -r 7c631055b94b SharpLibEar/Action.cs
--- a/SharpLibEar/Action.cs Fri Jul 29 14:33:47 2016 +0200
+++ b/SharpLibEar/Action.cs Fri Jul 29 14:46:30 2016 +0200
@@ -16,7 +16,7 @@
public void Execute()
{
- Console.WriteLine("Executing action: " + Brief());
+ Console.WriteLine("Action executing: " + Brief());
DoExecute();
}
diff -r 6a84d8282226 -r 7c631055b94b SharpLibEar/Event.cs
--- a/SharpLibEar/Event.cs Fri Jul 29 14:33:47 2016 +0200
+++ b/SharpLibEar/Event.cs Fri Jul 29 14:46:30 2016 +0200
@@ -29,7 +29,7 @@
public override void Trigger()
{
- Console.WriteLine("Event '" + Name + "' triggered.");
+ Console.WriteLine("Event triggered: " + Name);
foreach (Action action in Actions)
{
action.Execute();