Adding Events tab.
authorStephaneLenclud
Sat, 23 Jul 2016 19:22:56 +0200
changeset 21196f8b4dc4300
parent 210 83dd86e73448
child 212 1a0791daa243
Adding Events tab.
Server/FormEditAction.Designer.cs
Server/FormEditAction.cs
Server/FormEditAction.resx
Server/MainForm.Designer.cs
Server/MainForm.cs
Server/MainForm.resx
Server/SharpDisplayManager.csproj
SharpLibEar/Action.cs
SharpLibEar/EventActionManager.cs
SharpLibEar/EventMonitorPowerOff.cs
SharpLibEar/EventMonitorPowerOn.cs
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Server/FormEditAction.Designer.cs	Sat Jul 23 19:22:56 2016 +0200
     1.3 @@ -0,0 +1,104 @@
     1.4 +namespace SharpDisplayManager
     1.5 +{
     1.6 +    partial class FormEditAction
     1.7 +    {
     1.8 +        /// <summary>
     1.9 +        /// Required designer variable.
    1.10 +        /// </summary>
    1.11 +        private System.ComponentModel.IContainer components = null;
    1.12 +
    1.13 +        /// <summary>
    1.14 +        /// Clean up any resources being used.
    1.15 +        /// </summary>
    1.16 +        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    1.17 +        protected override void Dispose(bool disposing)
    1.18 +        {
    1.19 +            if (disposing && (components != null))
    1.20 +            {
    1.21 +                components.Dispose();
    1.22 +            }
    1.23 +            base.Dispose(disposing);
    1.24 +        }
    1.25 +
    1.26 +        #region Windows Form Designer generated code
    1.27 +
    1.28 +        /// <summary>
    1.29 +        /// Required method for Designer support - do not modify
    1.30 +        /// the contents of this method with the code editor.
    1.31 +        /// </summary>
    1.32 +        private void InitializeComponent()
    1.33 +        {
    1.34 +            this.comboBoxActionType = new System.Windows.Forms.ComboBox();
    1.35 +            this.labelActionType = new System.Windows.Forms.Label();
    1.36 +            this.buttonOk = new System.Windows.Forms.Button();
    1.37 +            this.buttonCancel = new System.Windows.Forms.Button();
    1.38 +            this.SuspendLayout();
    1.39 +            // 
    1.40 +            // comboBoxActionType
    1.41 +            // 
    1.42 +            this.comboBoxActionType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    1.43 +            this.comboBoxActionType.FormattingEnabled = true;
    1.44 +            this.comboBoxActionType.Location = new System.Drawing.Point(55, 12);
    1.45 +            this.comboBoxActionType.Name = "comboBoxActionType";
    1.46 +            this.comboBoxActionType.Size = new System.Drawing.Size(333, 21);
    1.47 +            this.comboBoxActionType.TabIndex = 18;
    1.48 +            // 
    1.49 +            // labelActionType
    1.50 +            // 
    1.51 +            this.labelActionType.AutoSize = true;
    1.52 +            this.labelActionType.Location = new System.Drawing.Point(12, 15);
    1.53 +            this.labelActionType.Name = "labelActionType";
    1.54 +            this.labelActionType.Size = new System.Drawing.Size(37, 13);
    1.55 +            this.labelActionType.TabIndex = 20;
    1.56 +            this.labelActionType.Text = "Type :";
    1.57 +            // 
    1.58 +            // buttonOk
    1.59 +            // 
    1.60 +            this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
    1.61 +            this.buttonOk.Location = new System.Drawing.Point(12, 55);
    1.62 +            this.buttonOk.Name = "buttonOk";
    1.63 +            this.buttonOk.Size = new System.Drawing.Size(75, 23);
    1.64 +            this.buttonOk.TabIndex = 21;
    1.65 +            this.buttonOk.Text = "Ok";
    1.66 +            this.buttonOk.UseVisualStyleBackColor = true;
    1.67 +            this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
    1.68 +            // 
    1.69 +            // buttonCancel
    1.70 +            // 
    1.71 +            this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    1.72 +            this.buttonCancel.Location = new System.Drawing.Point(93, 55);
    1.73 +            this.buttonCancel.Name = "buttonCancel";
    1.74 +            this.buttonCancel.Size = new System.Drawing.Size(75, 23);
    1.75 +            this.buttonCancel.TabIndex = 22;
    1.76 +            this.buttonCancel.Text = "Cancel";
    1.77 +            this.buttonCancel.UseVisualStyleBackColor = true;
    1.78 +            // 
    1.79 +            // FormEditAction
    1.80 +            // 
    1.81 +            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    1.82 +            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    1.83 +            this.ClientSize = new System.Drawing.Size(400, 86);
    1.84 +            this.Controls.Add(this.buttonCancel);
    1.85 +            this.Controls.Add(this.buttonOk);
    1.86 +            this.Controls.Add(this.labelActionType);
    1.87 +            this.Controls.Add(this.comboBoxActionType);
    1.88 +            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
    1.89 +            this.MaximizeBox = false;
    1.90 +            this.MinimizeBox = false;
    1.91 +            this.Name = "FormEditAction";
    1.92 +            this.Text = "Edit action";
    1.93 +            this.Load += new System.EventHandler(this.FormEditAction_Load);
    1.94 +            this.Validating += new System.ComponentModel.CancelEventHandler(this.FormEditAction_Validating);
    1.95 +            this.ResumeLayout(false);
    1.96 +            this.PerformLayout();
    1.97 +
    1.98 +        }
    1.99 +
   1.100 +        #endregion
   1.101 +
   1.102 +        private System.Windows.Forms.ComboBox comboBoxActionType;
   1.103 +        private System.Windows.Forms.Label labelActionType;
   1.104 +        private System.Windows.Forms.Button buttonOk;
   1.105 +        private System.Windows.Forms.Button buttonCancel;
   1.106 +    }
   1.107 +}
   1.108 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Server/FormEditAction.cs	Sat Jul 23 19:22:56 2016 +0200
     2.3 @@ -0,0 +1,45 @@
     2.4 +using System;
     2.5 +using System.Collections.Generic;
     2.6 +using System.ComponentModel;
     2.7 +using System.Data;
     2.8 +using System.Drawing;
     2.9 +using System.Linq;
    2.10 +using System.Text;
    2.11 +using System.Threading.Tasks;
    2.12 +using System.Windows.Forms;
    2.13 +using SharpLib.Ear;
    2.14 +
    2.15 +namespace SharpDisplayManager
    2.16 +{
    2.17 +    public partial class FormEditAction : Form
    2.18 +    {
    2.19 +        public SharpLib.Ear.Action Action = null;
    2.20 +
    2.21 +        public FormEditAction()
    2.22 +        {
    2.23 +            InitializeComponent();
    2.24 +        }
    2.25 +
    2.26 +        private void FormEditAction_Load(object sender, EventArgs e)
    2.27 +        {
    2.28 +            //Populate registered actions
    2.29 +            foreach (string key in EventActionManager.Current.ActionTypes.Keys)
    2.30 +            {
    2.31 +                Type t = EventActionManager.Current.ActionTypes[key];
    2.32 +                comboBoxActionType.Items.Add(t);                
    2.33 +            }
    2.34 +
    2.35 +            comboBoxActionType.SelectedIndex = 0;
    2.36 +        }
    2.37 +
    2.38 +        private void buttonOk_Click(object sender, EventArgs e)
    2.39 +        {
    2.40 +            Action = (SharpLib.Ear.Action)Activator.CreateInstance((Type)comboBoxActionType.SelectedItem);
    2.41 +        }
    2.42 +
    2.43 +        private void FormEditAction_Validating(object sender, CancelEventArgs e)
    2.44 +        {
    2.45 +
    2.46 +        }
    2.47 +    }
    2.48 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Server/FormEditAction.resx	Sat Jul 23 19:22:56 2016 +0200
     3.3 @@ -0,0 +1,120 @@
     3.4 +<?xml version="1.0" encoding="utf-8"?>
     3.5 +<root>
     3.6 +  <!-- 
     3.7 +    Microsoft ResX Schema 
     3.8 +    
     3.9 +    Version 2.0
    3.10 +    
    3.11 +    The primary goals of this format is to allow a simple XML format 
    3.12 +    that is mostly human readable. The generation and parsing of the 
    3.13 +    various data types are done through the TypeConverter classes 
    3.14 +    associated with the data types.
    3.15 +    
    3.16 +    Example:
    3.17 +    
    3.18 +    ... ado.net/XML headers & schema ...
    3.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
    3.20 +    <resheader name="version">2.0</resheader>
    3.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    3.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    3.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    3.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    3.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    3.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
    3.27 +    </data>
    3.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    3.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    3.30 +        <comment>This is a comment</comment>
    3.31 +    </data>
    3.32 +                
    3.33 +    There are any number of "resheader" rows that contain simple 
    3.34 +    name/value pairs.
    3.35 +    
    3.36 +    Each data row contains a name, and value. The row also contains a 
    3.37 +    type or mimetype. Type corresponds to a .NET class that support 
    3.38 +    text/value conversion through the TypeConverter architecture. 
    3.39 +    Classes that don't support this are serialized and stored with the 
    3.40 +    mimetype set.
    3.41 +    
    3.42 +    The mimetype is used for serialized objects, and tells the 
    3.43 +    ResXResourceReader how to depersist the object. This is currently not 
    3.44 +    extensible. For a given mimetype the value must be set accordingly:
    3.45 +    
    3.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
    3.47 +    that the ResXResourceWriter will generate, however the reader can 
    3.48 +    read any of the formats listed below.
    3.49 +    
    3.50 +    mimetype: application/x-microsoft.net.object.binary.base64
    3.51 +    value   : The object must be serialized with 
    3.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    3.53 +            : and then encoded with base64 encoding.
    3.54 +    
    3.55 +    mimetype: application/x-microsoft.net.object.soap.base64
    3.56 +    value   : The object must be serialized with 
    3.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
    3.58 +            : and then encoded with base64 encoding.
    3.59 +
    3.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
    3.61 +    value   : The object must be serialized into a byte array 
    3.62 +            : using a System.ComponentModel.TypeConverter
    3.63 +            : and then encoded with base64 encoding.
    3.64 +    -->
    3.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    3.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    3.67 +    <xsd:element name="root" msdata:IsDataSet="true">
    3.68 +      <xsd:complexType>
    3.69 +        <xsd:choice maxOccurs="unbounded">
    3.70 +          <xsd:element name="metadata">
    3.71 +            <xsd:complexType>
    3.72 +              <xsd:sequence>
    3.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    3.74 +              </xsd:sequence>
    3.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
    3.76 +              <xsd:attribute name="type" type="xsd:string" />
    3.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
    3.78 +              <xsd:attribute ref="xml:space" />
    3.79 +            </xsd:complexType>
    3.80 +          </xsd:element>
    3.81 +          <xsd:element name="assembly">
    3.82 +            <xsd:complexType>
    3.83 +              <xsd:attribute name="alias" type="xsd:string" />
    3.84 +              <xsd:attribute name="name" type="xsd:string" />
    3.85 +            </xsd:complexType>
    3.86 +          </xsd:element>
    3.87 +          <xsd:element name="data">
    3.88 +            <xsd:complexType>
    3.89 +              <xsd:sequence>
    3.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    3.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    3.92 +              </xsd:sequence>
    3.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    3.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    3.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    3.96 +              <xsd:attribute ref="xml:space" />
    3.97 +            </xsd:complexType>
    3.98 +          </xsd:element>
    3.99 +          <xsd:element name="resheader">
   3.100 +            <xsd:complexType>
   3.101 +              <xsd:sequence>
   3.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   3.103 +              </xsd:sequence>
   3.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
   3.105 +            </xsd:complexType>
   3.106 +          </xsd:element>
   3.107 +        </xsd:choice>
   3.108 +      </xsd:complexType>
   3.109 +    </xsd:element>
   3.110 +  </xsd:schema>
   3.111 +  <resheader name="resmimetype">
   3.112 +    <value>text/microsoft-resx</value>
   3.113 +  </resheader>
   3.114 +  <resheader name="version">
   3.115 +    <value>2.0</value>
   3.116 +  </resheader>
   3.117 +  <resheader name="reader">
   3.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   3.119 +  </resheader>
   3.120 +  <resheader name="writer">
   3.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   3.122 +  </resheader>
   3.123 +</root>
   3.124 \ No newline at end of file
     4.1 --- a/Server/MainForm.Designer.cs	Sat Jul 23 16:00:04 2016 +0200
     4.2 +++ b/Server/MainForm.Designer.cs	Sat Jul 23 19:22:56 2016 +0200
     4.3 @@ -112,6 +112,10 @@
     4.4              this.checkBoxCecEnabled = new System.Windows.Forms.CheckBox();
     4.5              this.labelHdmiPort = new System.Windows.Forms.Label();
     4.6              this.comboBoxHdmiPort = new System.Windows.Forms.ComboBox();
     4.7 +            this.tabPageEvent = new System.Windows.Forms.TabPage();
     4.8 +            this.buttonDeleteAction = new System.Windows.Forms.Button();
     4.9 +            this.buttonAddAction = new System.Windows.Forms.Button();
    4.10 +            this.iTreeViewEvents = new System.Windows.Forms.TreeView();
    4.11              this.tabPageApp = new System.Windows.Forms.TabPage();
    4.12              this.checkBoxStartMinimized = new System.Windows.Forms.CheckBox();
    4.13              this.checkBoxMinimizeToTray = new System.Windows.Forms.CheckBox();
    4.14 @@ -138,6 +142,7 @@
    4.15              ((System.ComponentModel.ISupportInitialize)(this.pictureBoxGreenStart)).BeginInit();
    4.16              this.tabPageCec.SuspendLayout();
    4.17              this.groupBoxCecLogOptions.SuspendLayout();
    4.18 +            this.tabPageEvent.SuspendLayout();
    4.19              this.tabPageApp.SuspendLayout();
    4.20              this.tabPageLogs.SuspendLayout();
    4.21              this.SuspendLayout();
    4.22 @@ -566,6 +571,7 @@
    4.23              this.tabControl.Controls.Add(this.tabPageAudio);
    4.24              this.tabControl.Controls.Add(this.tabPageInput);
    4.25              this.tabControl.Controls.Add(this.tabPageCec);
    4.26 +            this.tabControl.Controls.Add(this.tabPageEvent);
    4.27              this.tabControl.Controls.Add(this.tabPageApp);
    4.28              this.tabControl.Controls.Add(this.tabPageLogs);
    4.29              this.tabControl.Location = new System.Drawing.Point(12, 125);
    4.30 @@ -1000,6 +1006,48 @@
    4.31              this.comboBoxHdmiPort.TabIndex = 19;
    4.32              this.comboBoxHdmiPort.SelectedIndexChanged += new System.EventHandler(this.comboBoxHdmiPort_SelectedIndexChanged);
    4.33              // 
    4.34 +            // tabPageEvent
    4.35 +            // 
    4.36 +            this.tabPageEvent.Controls.Add(this.buttonDeleteAction);
    4.37 +            this.tabPageEvent.Controls.Add(this.buttonAddAction);
    4.38 +            this.tabPageEvent.Controls.Add(this.iTreeViewEvents);
    4.39 +            this.tabPageEvent.Location = new System.Drawing.Point(4, 22);
    4.40 +            this.tabPageEvent.Name = "tabPageEvent";
    4.41 +            this.tabPageEvent.Padding = new System.Windows.Forms.Padding(3);
    4.42 +            this.tabPageEvent.Size = new System.Drawing.Size(752, 385);
    4.43 +            this.tabPageEvent.TabIndex = 9;
    4.44 +            this.tabPageEvent.Text = "Events";
    4.45 +            this.tabPageEvent.UseVisualStyleBackColor = true;
    4.46 +            // 
    4.47 +            // buttonDeleteAction
    4.48 +            // 
    4.49 +            this.buttonDeleteAction.Location = new System.Drawing.Point(6, 35);
    4.50 +            this.buttonDeleteAction.Name = "buttonDeleteAction";
    4.51 +            this.buttonDeleteAction.Size = new System.Drawing.Size(96, 23);
    4.52 +            this.buttonDeleteAction.TabIndex = 21;
    4.53 +            this.buttonDeleteAction.Text = "Delete Action";
    4.54 +            this.buttonDeleteAction.UseVisualStyleBackColor = true;
    4.55 +            // 
    4.56 +            // buttonAddAction
    4.57 +            // 
    4.58 +            this.buttonAddAction.Location = new System.Drawing.Point(6, 6);
    4.59 +            this.buttonAddAction.Name = "buttonAddAction";
    4.60 +            this.buttonAddAction.Size = new System.Drawing.Size(96, 23);
    4.61 +            this.buttonAddAction.TabIndex = 20;
    4.62 +            this.buttonAddAction.Text = "Add Action";
    4.63 +            this.buttonAddAction.UseVisualStyleBackColor = true;
    4.64 +            this.buttonAddAction.Click += new System.EventHandler(this.buttonAddAction_Click);
    4.65 +            // 
    4.66 +            // iTreeViewEvents
    4.67 +            // 
    4.68 +            this.iTreeViewEvents.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    4.69 +            | System.Windows.Forms.AnchorStyles.Left) 
    4.70 +            | System.Windows.Forms.AnchorStyles.Right)));
    4.71 +            this.iTreeViewEvents.Location = new System.Drawing.Point(111, 3);
    4.72 +            this.iTreeViewEvents.Name = "iTreeViewEvents";
    4.73 +            this.iTreeViewEvents.Size = new System.Drawing.Size(638, 376);
    4.74 +            this.iTreeViewEvents.TabIndex = 1;
    4.75 +            // 
    4.76              // tabPageApp
    4.77              // 
    4.78              this.tabPageApp.Controls.Add(this.checkBoxStartMinimized);
    4.79 @@ -1163,6 +1211,7 @@
    4.80              this.tabPageCec.PerformLayout();
    4.81              this.groupBoxCecLogOptions.ResumeLayout(false);
    4.82              this.groupBoxCecLogOptions.PerformLayout();
    4.83 +            this.tabPageEvent.ResumeLayout(false);
    4.84              this.tabPageApp.ResumeLayout(false);
    4.85              this.tabPageApp.PerformLayout();
    4.86              this.tabPageLogs.ResumeLayout(false);
    4.87 @@ -1258,6 +1307,10 @@
    4.88          private System.Windows.Forms.CheckBox checkBoxCecLogNotice;
    4.89          private System.Windows.Forms.CheckBox checkBoxCecLogTraffic;
    4.90          private System.Windows.Forms.CheckBox checkBoxCecLogNoPoll;
    4.91 +        private System.Windows.Forms.TabPage tabPageEvent;
    4.92 +        private System.Windows.Forms.TreeView iTreeViewEvents;
    4.93 +        private System.Windows.Forms.Button buttonDeleteAction;
    4.94 +        private System.Windows.Forms.Button buttonAddAction;
    4.95      }
    4.96  }
    4.97  
     5.1 --- a/Server/MainForm.cs	Sat Jul 23 16:00:04 2016 +0200
     5.2 +++ b/Server/MainForm.cs	Sat Jul 23 19:22:56 2016 +0200
     5.3 @@ -210,6 +210,8 @@
     5.4              OnWndProc += iCecManager.OnWndProc;
     5.5              ResetCec();
     5.6  
     5.7 +            //Setup Events
     5.8 +            SetupEvents();
     5.9  
    5.10              //Setup notification icon
    5.11              SetupTrayIcon();
    5.12 @@ -285,6 +287,30 @@
    5.13  
    5.14  		}
    5.15  
    5.16 +        /// <summary>
    5.17 +        /// 
    5.18 +        /// </summary>
    5.19 +        private void SetupEvents()
    5.20 +        {
    5.21 +            //Reset our tree
    5.22 +            iTreeViewEvents.Nodes.Clear();
    5.23 +            //Populate registered events
    5.24 +            foreach (string key in EventActionManager.Current.Events.Keys)
    5.25 +            {
    5.26 +                Event e = EventActionManager.Current.Events[key];
    5.27 +                TreeNode eventNode = iTreeViewEvents.Nodes.Add(key,e.Name);
    5.28 +                eventNode.Tag = e;
    5.29 +                eventNode.Nodes.Add(key + ".Description", e.Description);
    5.30 +                TreeNode actionsNodes = eventNode.Nodes.Add(key + ".Actions", "Actions");
    5.31 +
    5.32 +                foreach (SharpLib.Ear.Action a in e.Actions)
    5.33 +                {
    5.34 +                    actionsNodes.Nodes.Add(a.Name);
    5.35 +                }
    5.36 +            }
    5.37 +
    5.38 +        }
    5.39 +
    5.40  		/// <summary>
    5.41  		/// Called when our display is closed.
    5.42  		/// </summary>
    5.43 @@ -2625,5 +2651,23 @@
    5.44          {
    5.45              SetupCecLogLevel();
    5.46          }
    5.47 +
    5.48 +        private void buttonAddAction_Click(object sender, EventArgs e)
    5.49 +        {
    5.50 +            Event ear = (Event)iTreeViewEvents.SelectedNode.Tag;
    5.51 +            if (ear == null)
    5.52 +            {
    5.53 +                //Must select event node
    5.54 +                return;
    5.55 +            }
    5.56 +
    5.57 +            FormEditAction ea = new FormEditAction();
    5.58 +            DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
    5.59 +            if (res == DialogResult.OK)
    5.60 +            {
    5.61 +                ear.Actions.Add(ea.Action);
    5.62 +                SetupEvents();
    5.63 +            }
    5.64 +        }
    5.65      }
    5.66  }
     6.1 --- a/Server/MainForm.resx	Sat Jul 23 16:00:04 2016 +0200
     6.2 +++ b/Server/MainForm.resx	Sat Jul 23 19:22:56 2016 +0200
     6.3 @@ -185,9 +185,6 @@
     6.4          WSC3/b/CbwiR/gNzbuWksIMBOAAAAABJRU5ErkJggg==
     6.5  </value>
     6.6    </data>
     6.7 -  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     6.8 -    <value>315, 17</value>
     6.9 -  </metadata>
    6.10    <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    6.11      <value>405, 17</value>
    6.12    </metadata>
     7.1 --- a/Server/SharpDisplayManager.csproj	Sat Jul 23 16:00:04 2016 +0200
     7.2 +++ b/Server/SharpDisplayManager.csproj	Sat Jul 23 19:22:56 2016 +0200
     7.3 @@ -157,6 +157,12 @@
     7.4      <Compile Include="CecClient.cs" />
     7.5      <Compile Include="ConsumerElectronicControl.cs" />
     7.6      <Compile Include="ClientData.cs" />
     7.7 +    <Compile Include="FormEditAction.cs">
     7.8 +      <SubType>Form</SubType>
     7.9 +    </Compile>
    7.10 +    <Compile Include="FormEditAction.Designer.cs">
    7.11 +      <DependentUpon>FormEditAction.cs</DependentUpon>
    7.12 +    </Compile>
    7.13      <Compile Include="FxControl.cs">
    7.14        <SubType>UserControl</SubType>
    7.15      </Compile>
    7.16 @@ -193,6 +199,9 @@
    7.17      <Compile Include="Win32API.cs" />
    7.18      <Compile Include="WindowsHook.cs" />
    7.19      <Compile Include="WndProcRetHook.cs" />
    7.20 +    <EmbeddedResource Include="FormEditAction.resx">
    7.21 +      <DependentUpon>FormEditAction.cs</DependentUpon>
    7.22 +    </EmbeddedResource>
    7.23      <EmbeddedResource Include="FxControl.resx">
    7.24        <DependentUpon>FxControl.cs</DependentUpon>
    7.25      </EmbeddedResource>
     8.1 --- a/SharpLibEar/Action.cs	Sat Jul 23 16:00:04 2016 +0200
     8.2 +++ b/SharpLibEar/Action.cs	Sat Jul 23 19:22:56 2016 +0200
     8.3 @@ -12,6 +12,12 @@
     8.4      {
     8.5          public abstract void Execute();
     8.6  
     8.7 +        public string Name {
     8.8 +            //Get the name of this object action attribute
     8.9 +            get { return Utils.Reflection.GetAttribute<AttributeAction>(GetType()).Name; }
    8.10 +            private set { }
    8.11 +        }
    8.12 +
    8.13          public int CompareTo(object obj)
    8.14          {
    8.15              //Sort by action name
     9.1 --- a/SharpLibEar/EventActionManager.cs	Sat Jul 23 16:00:04 2016 +0200
     9.2 +++ b/SharpLibEar/EventActionManager.cs	Sat Jul 23 19:22:56 2016 +0200
     9.3 @@ -14,7 +14,7 @@
     9.4      {
     9.5          public static EventActionManager Current = null;
     9.6          public IDictionary<string, Type> ActionTypes;
     9.7 -        private IDictionary<string, Event> Events;
     9.8 +        public readonly IDictionary<string, Event> Events;
     9.9  
    9.10          public EventActionManager()
    9.11          {
    10.1 --- a/SharpLibEar/EventMonitorPowerOff.cs	Sat Jul 23 16:00:04 2016 +0200
    10.2 +++ b/SharpLibEar/EventMonitorPowerOff.cs	Sat Jul 23 19:22:56 2016 +0200
    10.3 @@ -11,7 +11,7 @@
    10.4          public EventMonitorPowerOff()
    10.5          {
    10.6              Name = "Monitor Power Off";
    10.7 -            Description = "";
    10.8 +            Description = "Windows is powering off your monitor.";
    10.9          }
   10.10      }
   10.11  
    11.1 --- a/SharpLibEar/EventMonitorPowerOn.cs	Sat Jul 23 16:00:04 2016 +0200
    11.2 +++ b/SharpLibEar/EventMonitorPowerOn.cs	Sat Jul 23 19:22:56 2016 +0200
    11.3 @@ -11,7 +11,7 @@
    11.4          public EventMonitorPowerOn()
    11.5          {
    11.6              Name = "Monitor Power On";
    11.7 -            Description = "";
    11.8 +            Description = "Windows is powering on your monitor.";
    11.9          }
   11.10  
   11.11      }