Renaming main form.
authorStephaneLenclud
Fri, 29 Jul 2016 10:40:15 +0200
changeset 22691763ba41c0c
parent 225 6ccaa430aa23
child 227 4a03cc6f41b0
Renaming main form.
Server/FormMain.Designer.cs
Server/FormMain.Hid.cs
Server/FormMain.cs
Server/FormMain.resx
Server/MainForm.Designer.cs
Server/MainForm.Hid.cs
Server/MainForm.cs
Server/MainForm.resx
Server/Program.cs
Server/Session.cs
Server/SharpDisplayManager.csproj
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Server/FormMain.Designer.cs	Fri Jul 29 10:40:15 2016 +0200
     1.3 @@ -0,0 +1,1321 @@
     1.4 +namespace SharpDisplayManager
     1.5 +{
     1.6 +    partial class FormMain
     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)
    1.20 +            {
    1.21 +                if (iNotifyIcon != null)
    1.22 +                {
    1.23 +                    iNotifyIcon.Dispose();
    1.24 +                    iNotifyIcon = null;
    1.25 +                }
    1.26 +                
    1.27 +                if (components != null)
    1.28 +                {
    1.29 +                    components.Dispose();
    1.30 +                }
    1.31 +            }
    1.32 +            base.Dispose(disposing);
    1.33 +        }
    1.34 +
    1.35 +        #region Windows Form Designer generated code
    1.36 +
    1.37 +        /// <summary>
    1.38 +        /// Required method for Designer support - do not modify
    1.39 +        /// the contents of this method with the code editor.
    1.40 +        /// </summary>
    1.41 +        private void InitializeComponent()
    1.42 +        {
    1.43 +            this.components = new System.ComponentModel.Container();
    1.44 +            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
    1.45 +            this.panelDisplay = new System.Windows.Forms.Panel();
    1.46 +            this.iTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
    1.47 +            this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel();
    1.48 +            this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel();
    1.49 +            this.fontDialog = new System.Windows.Forms.FontDialog();
    1.50 +            this.timer = new System.Windows.Forms.Timer(this.components);
    1.51 +            this.statusStrip = new System.Windows.Forms.StatusStrip();
    1.52 +            this.toolStripStatusLabelConnect = new System.Windows.Forms.ToolStripStatusLabel();
    1.53 +            this.toolStripStatusLabelSpring = new System.Windows.Forms.ToolStripStatusLabel();
    1.54 +            this.toolStripStatusLabelPower = new System.Windows.Forms.ToolStripStatusLabel();
    1.55 +            this.toolStripStatusLabelFps = new System.Windows.Forms.ToolStripStatusLabel();
    1.56 +            this.tabPageClients = new System.Windows.Forms.TabPage();
    1.57 +            this.iCheckBoxStartIdleClient = new System.Windows.Forms.CheckBox();
    1.58 +            this.iButtonStartIdleClient = new System.Windows.Forms.Button();
    1.59 +            this.buttonCloseClients = new System.Windows.Forms.Button();
    1.60 +            this.buttonStartClient = new System.Windows.Forms.Button();
    1.61 +            this.iTreeViewClients = new System.Windows.Forms.TreeView();
    1.62 +            this.tabPageDisplay = new System.Windows.Forms.TabPage();
    1.63 +            this.buttonShowClock = new System.Windows.Forms.Button();
    1.64 +            this.buttonHideClock = new System.Windows.Forms.Button();
    1.65 +            this.buttonPowerOff = new System.Windows.Forms.Button();
    1.66 +            this.buttonPowerOn = new System.Windows.Forms.Button();
    1.67 +            this.labelTimerInterval = new System.Windows.Forms.Label();
    1.68 +            this.maskedTextBoxTimerInterval = new System.Windows.Forms.MaskedTextBox();
    1.69 +            this.comboBoxDisplayType = new System.Windows.Forms.ComboBox();
    1.70 +            this.buttonSuspend = new System.Windows.Forms.Button();
    1.71 +            this.checkBoxConnectOnStartup = new System.Windows.Forms.CheckBox();
    1.72 +            this.trackBarBrightness = new System.Windows.Forms.TrackBar();
    1.73 +            this.buttonFill = new System.Windows.Forms.Button();
    1.74 +            this.buttonClear = new System.Windows.Forms.Button();
    1.75 +            this.buttonClose = new System.Windows.Forms.Button();
    1.76 +            this.buttonOpen = new System.Windows.Forms.Button();
    1.77 +            this.buttonCapture = new System.Windows.Forms.Button();
    1.78 +            this.labelWarning = new System.Windows.Forms.Label();
    1.79 +            this.checkBoxFixedPitchFontOnly = new System.Windows.Forms.CheckBox();
    1.80 +            this.checkBoxShowBorders = new System.Windows.Forms.CheckBox();
    1.81 +            this.buttonFont = new System.Windows.Forms.Button();
    1.82 +            this.tabControl = new System.Windows.Forms.TabControl();
    1.83 +            this.tabPageDesign = new System.Windows.Forms.TabPage();
    1.84 +            this.labelScrollingSpeed = new System.Windows.Forms.Label();
    1.85 +            this.maskedTextBoxScrollingSpeed = new System.Windows.Forms.MaskedTextBox();
    1.86 +            this.labelScrollLoopSeparator = new System.Windows.Forms.Label();
    1.87 +            this.textBoxScrollLoopSeparator = new System.Windows.Forms.TextBox();
    1.88 +            this.labelMinFontSize = new System.Windows.Forms.Label();
    1.89 +            this.maskedTextBoxMinFontSize = new System.Windows.Forms.MaskedTextBox();
    1.90 +            this.checkBoxScaleToFit = new System.Windows.Forms.CheckBox();
    1.91 +            this.checkBoxInverseColors = new System.Windows.Forms.CheckBox();
    1.92 +            this.checkBoxReverseScreen = new System.Windows.Forms.CheckBox();
    1.93 +            this.tabPageAudio = new System.Windows.Forms.TabPage();
    1.94 +            this.labelDefaultAudioDevice = new System.Windows.Forms.Label();
    1.95 +            this.checkBoxShowVolumeLabel = new System.Windows.Forms.CheckBox();
    1.96 +            this.checkBoxMute = new System.Windows.Forms.CheckBox();
    1.97 +            this.trackBarMasterVolume = new System.Windows.Forms.TrackBar();
    1.98 +            this.tabPageInput = new System.Windows.Forms.TabPage();
    1.99 +            this.comboBoxOpticalDrives = new System.Windows.Forms.ComboBox();
   1.100 +            this.labelOpticalDriveEject = new System.Windows.Forms.Label();
   1.101 +            this.pictureBoxGreenStart = new System.Windows.Forms.PictureBox();
   1.102 +            this.labelStartFileName = new System.Windows.Forms.Label();
   1.103 +            this.buttonSelectFile = new System.Windows.Forms.Button();
   1.104 +            this.tabPageCec = new System.Windows.Forms.TabPage();
   1.105 +            this.groupBoxCecLogOptions = new System.Windows.Forms.GroupBox();
   1.106 +            this.checkBoxCecLogNoPoll = new System.Windows.Forms.CheckBox();
   1.107 +            this.checkBoxCecLogTraffic = new System.Windows.Forms.CheckBox();
   1.108 +            this.checkBoxCecLogDebug = new System.Windows.Forms.CheckBox();
   1.109 +            this.checkBoxCecLogNotice = new System.Windows.Forms.CheckBox();
   1.110 +            this.checkBoxCecLogError = new System.Windows.Forms.CheckBox();
   1.111 +            this.checkBoxCecLogWarning = new System.Windows.Forms.CheckBox();
   1.112 +            this.checkBoxCecEnabled = new System.Windows.Forms.CheckBox();
   1.113 +            this.labelHdmiPort = new System.Windows.Forms.Label();
   1.114 +            this.comboBoxHdmiPort = new System.Windows.Forms.ComboBox();
   1.115 +            this.tabPageEvent = new System.Windows.Forms.TabPage();
   1.116 +            this.buttonActionMoveUp = new System.Windows.Forms.Button();
   1.117 +            this.buttonActionMoveDown = new System.Windows.Forms.Button();
   1.118 +            this.buttonTestAction = new System.Windows.Forms.Button();
   1.119 +            this.buttonDeleteAction = new System.Windows.Forms.Button();
   1.120 +            this.buttonAddAction = new System.Windows.Forms.Button();
   1.121 +            this.iTreeViewEvents = new System.Windows.Forms.TreeView();
   1.122 +            this.tabPageApp = new System.Windows.Forms.TabPage();
   1.123 +            this.checkBoxStartMinimized = new System.Windows.Forms.CheckBox();
   1.124 +            this.checkBoxMinimizeToTray = new System.Windows.Forms.CheckBox();
   1.125 +            this.checkBoxAutoStart = new System.Windows.Forms.CheckBox();
   1.126 +            this.buttonUpdate = new System.Windows.Forms.Button();
   1.127 +            this.tabPageLogs = new System.Windows.Forms.TabPage();
   1.128 +            this.buttonClearLogs = new System.Windows.Forms.Button();
   1.129 +            this.richTextBoxLogs = new System.Windows.Forms.RichTextBox();
   1.130 +            this.labelFontWidth = new System.Windows.Forms.Label();
   1.131 +            this.labelFontHeight = new System.Windows.Forms.Label();
   1.132 +            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
   1.133 +            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
   1.134 +            this.panelDisplay.SuspendLayout();
   1.135 +            this.iTableLayoutPanel.SuspendLayout();
   1.136 +            this.statusStrip.SuspendLayout();
   1.137 +            this.tabPageClients.SuspendLayout();
   1.138 +            this.tabPageDisplay.SuspendLayout();
   1.139 +            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).BeginInit();
   1.140 +            this.tabControl.SuspendLayout();
   1.141 +            this.tabPageDesign.SuspendLayout();
   1.142 +            this.tabPageAudio.SuspendLayout();
   1.143 +            ((System.ComponentModel.ISupportInitialize)(this.trackBarMasterVolume)).BeginInit();
   1.144 +            this.tabPageInput.SuspendLayout();
   1.145 +            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxGreenStart)).BeginInit();
   1.146 +            this.tabPageCec.SuspendLayout();
   1.147 +            this.groupBoxCecLogOptions.SuspendLayout();
   1.148 +            this.tabPageEvent.SuspendLayout();
   1.149 +            this.tabPageApp.SuspendLayout();
   1.150 +            this.tabPageLogs.SuspendLayout();
   1.151 +            this.SuspendLayout();
   1.152 +            // 
   1.153 +            // panelDisplay
   1.154 +            // 
   1.155 +            this.panelDisplay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
   1.156 +            this.panelDisplay.Controls.Add(this.iTableLayoutPanel);
   1.157 +            this.panelDisplay.Location = new System.Drawing.Point(173, 40);
   1.158 +            this.panelDisplay.Margin = new System.Windows.Forms.Padding(0);
   1.159 +            this.panelDisplay.Name = "panelDisplay";
   1.160 +            this.panelDisplay.Size = new System.Drawing.Size(258, 66);
   1.161 +            this.panelDisplay.TabIndex = 12;
   1.162 +            // 
   1.163 +            // iTableLayoutPanel
   1.164 +            // 
   1.165 +            this.iTableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   1.166 +            | System.Windows.Forms.AnchorStyles.Left) 
   1.167 +            | System.Windows.Forms.AnchorStyles.Right)));
   1.168 +            this.iTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
   1.169 +            this.iTableLayoutPanel.BackColor = System.Drawing.SystemColors.ControlLightLight;
   1.170 +            this.iTableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
   1.171 +            this.iTableLayoutPanel.ColumnCount = 1;
   1.172 +            this.iTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
   1.173 +            this.iTableLayoutPanel.Controls.Add(this.marqueeLabelTop, 0, 0);
   1.174 +            this.iTableLayoutPanel.Controls.Add(this.marqueeLabelBottom, 0, 1);
   1.175 +            this.iTableLayoutPanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
   1.176 +            this.iTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
   1.177 +            this.iTableLayoutPanel.Margin = new System.Windows.Forms.Padding(0);
   1.178 +            this.iTableLayoutPanel.Name = "iTableLayoutPanel";
   1.179 +            this.iTableLayoutPanel.RowCount = 2;
   1.180 +            this.iTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   1.181 +            this.iTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   1.182 +            this.iTableLayoutPanel.Size = new System.Drawing.Size(256, 64);
   1.183 +            this.iTableLayoutPanel.TabIndex = 5;
   1.184 +            this.iTableLayoutPanel.SizeChanged += new System.EventHandler(this.tableLayoutPanel_SizeChanged);
   1.185 +            // 
   1.186 +            // marqueeLabelTop
   1.187 +            // 
   1.188 +            this.marqueeLabelTop.AutoEllipsis = true;
   1.189 +            this.marqueeLabelTop.AutoSize = true;
   1.190 +            this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent;
   1.191 +            this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill;
   1.192 +            this.marqueeLabelTop.Location = new System.Drawing.Point(1, 1);
   1.193 +            this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0);
   1.194 +            this.marqueeLabelTop.MinFontSize = 15F;
   1.195 +            this.marqueeLabelTop.Name = "marqueeLabelTop";
   1.196 +            this.marqueeLabelTop.OwnTimer = false;
   1.197 +            this.marqueeLabelTop.PixelsPerSecond = 64;
   1.198 +            this.marqueeLabelTop.ScaleToFit = true;
   1.199 +            this.marqueeLabelTop.Separator = "|";
   1.200 +            this.marqueeLabelTop.Size = new System.Drawing.Size(254, 30);
   1.201 +            this.marqueeLabelTop.TabIndex = 2;
   1.202 +            this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789";
   1.203 +            this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   1.204 +            this.marqueeLabelTop.UseCompatibleTextRendering = true;
   1.205 +            // 
   1.206 +            // marqueeLabelBottom
   1.207 +            // 
   1.208 +            this.marqueeLabelBottom.AutoEllipsis = true;
   1.209 +            this.marqueeLabelBottom.AutoSize = true;
   1.210 +            this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill;
   1.211 +            this.marqueeLabelBottom.Location = new System.Drawing.Point(1, 32);
   1.212 +            this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0);
   1.213 +            this.marqueeLabelBottom.MinFontSize = 15F;
   1.214 +            this.marqueeLabelBottom.Name = "marqueeLabelBottom";
   1.215 +            this.marqueeLabelBottom.OwnTimer = false;
   1.216 +            this.marqueeLabelBottom.PixelsPerSecond = 64;
   1.217 +            this.marqueeLabelBottom.ScaleToFit = true;
   1.218 +            this.marqueeLabelBottom.Separator = "|";
   1.219 +            this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 31);
   1.220 +            this.marqueeLabelBottom.TabIndex = 3;
   1.221 +            this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789";
   1.222 +            this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   1.223 +            this.marqueeLabelBottom.UseCompatibleTextRendering = true;
   1.224 +            // 
   1.225 +            // timer
   1.226 +            // 
   1.227 +            this.timer.Interval = 50;
   1.228 +            this.timer.Tick += new System.EventHandler(this.timer_Tick);
   1.229 +            // 
   1.230 +            // statusStrip
   1.231 +            // 
   1.232 +            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.233 +            this.toolStripStatusLabelConnect,
   1.234 +            this.toolStripStatusLabelSpring,
   1.235 +            this.toolStripStatusLabelPower,
   1.236 +            this.toolStripStatusLabelFps});
   1.237 +            this.statusStrip.Location = new System.Drawing.Point(0, 539);
   1.238 +            this.statusStrip.Name = "statusStrip";
   1.239 +            this.statusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
   1.240 +            this.statusStrip.Size = new System.Drawing.Size(784, 22);
   1.241 +            this.statusStrip.TabIndex = 1;
   1.242 +            this.statusStrip.Text = "statusStrip";
   1.243 +            // 
   1.244 +            // toolStripStatusLabelConnect
   1.245 +            // 
   1.246 +            this.toolStripStatusLabelConnect.Name = "toolStripStatusLabelConnect";
   1.247 +            this.toolStripStatusLabelConnect.Size = new System.Drawing.Size(86, 17);
   1.248 +            this.toolStripStatusLabelConnect.Text = "Not connected";
   1.249 +            // 
   1.250 +            // toolStripStatusLabelSpring
   1.251 +            // 
   1.252 +            this.toolStripStatusLabelSpring.Name = "toolStripStatusLabelSpring";
   1.253 +            this.toolStripStatusLabelSpring.Size = new System.Drawing.Size(633, 17);
   1.254 +            this.toolStripStatusLabelSpring.Spring = true;
   1.255 +            // 
   1.256 +            // toolStripStatusLabelPower
   1.257 +            // 
   1.258 +            this.toolStripStatusLabelPower.Name = "toolStripStatusLabelPower";
   1.259 +            this.toolStripStatusLabelPower.Size = new System.Drawing.Size(24, 17);
   1.260 +            this.toolStripStatusLabelPower.Text = "NA";
   1.261 +            // 
   1.262 +            // toolStripStatusLabelFps
   1.263 +            // 
   1.264 +            this.toolStripStatusLabelFps.Name = "toolStripStatusLabelFps";
   1.265 +            this.toolStripStatusLabelFps.Size = new System.Drawing.Size(26, 17);
   1.266 +            this.toolStripStatusLabelFps.Text = "FPS";
   1.267 +            // 
   1.268 +            // tabPageClients
   1.269 +            // 
   1.270 +            this.tabPageClients.Controls.Add(this.iCheckBoxStartIdleClient);
   1.271 +            this.tabPageClients.Controls.Add(this.iButtonStartIdleClient);
   1.272 +            this.tabPageClients.Controls.Add(this.buttonCloseClients);
   1.273 +            this.tabPageClients.Controls.Add(this.buttonStartClient);
   1.274 +            this.tabPageClients.Controls.Add(this.iTreeViewClients);
   1.275 +            this.tabPageClients.Location = new System.Drawing.Point(4, 22);
   1.276 +            this.tabPageClients.Name = "tabPageClients";
   1.277 +            this.tabPageClients.Padding = new System.Windows.Forms.Padding(3);
   1.278 +            this.tabPageClients.Size = new System.Drawing.Size(752, 385);
   1.279 +            this.tabPageClients.TabIndex = 2;
   1.280 +            this.tabPageClients.Text = "Clients";
   1.281 +            this.tabPageClients.UseVisualStyleBackColor = true;
   1.282 +            // 
   1.283 +            // iCheckBoxStartIdleClient
   1.284 +            // 
   1.285 +            this.iCheckBoxStartIdleClient.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.286 +            this.iCheckBoxStartIdleClient.AutoSize = true;
   1.287 +            this.iCheckBoxStartIdleClient.Location = new System.Drawing.Point(108, 340);
   1.288 +            this.iCheckBoxStartIdleClient.Name = "iCheckBoxStartIdleClient";
   1.289 +            this.iCheckBoxStartIdleClient.Size = new System.Drawing.Size(145, 17);
   1.290 +            this.iCheckBoxStartIdleClient.TabIndex = 22;
   1.291 +            this.iCheckBoxStartIdleClient.Text = "Start idle client on startup";
   1.292 +            this.iCheckBoxStartIdleClient.UseVisualStyleBackColor = true;
   1.293 +            this.iCheckBoxStartIdleClient.CheckedChanged += new System.EventHandler(this.checkBoxStartIdleClient_CheckedChanged);
   1.294 +            // 
   1.295 +            // iButtonStartIdleClient
   1.296 +            // 
   1.297 +            this.iButtonStartIdleClient.Location = new System.Drawing.Point(6, 35);
   1.298 +            this.iButtonStartIdleClient.Name = "iButtonStartIdleClient";
   1.299 +            this.iButtonStartIdleClient.Size = new System.Drawing.Size(96, 23);
   1.300 +            this.iButtonStartIdleClient.TabIndex = 21;
   1.301 +            this.iButtonStartIdleClient.Text = "Start Idle Client";
   1.302 +            this.iButtonStartIdleClient.UseVisualStyleBackColor = true;
   1.303 +            this.iButtonStartIdleClient.Click += new System.EventHandler(this.ButtonStartIdleClient_Click);
   1.304 +            // 
   1.305 +            // buttonCloseClients
   1.306 +            // 
   1.307 +            this.buttonCloseClients.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.308 +            this.buttonCloseClients.Location = new System.Drawing.Point(6, 336);
   1.309 +            this.buttonCloseClients.Name = "buttonCloseClients";
   1.310 +            this.buttonCloseClients.Size = new System.Drawing.Size(96, 23);
   1.311 +            this.buttonCloseClients.TabIndex = 20;
   1.312 +            this.buttonCloseClients.Text = "Close Clients";
   1.313 +            this.buttonCloseClients.UseVisualStyleBackColor = true;
   1.314 +            this.buttonCloseClients.Click += new System.EventHandler(this.buttonCloseClients_Click);
   1.315 +            // 
   1.316 +            // buttonStartClient
   1.317 +            // 
   1.318 +            this.buttonStartClient.Location = new System.Drawing.Point(6, 6);
   1.319 +            this.buttonStartClient.Name = "buttonStartClient";
   1.320 +            this.buttonStartClient.Size = new System.Drawing.Size(96, 23);
   1.321 +            this.buttonStartClient.TabIndex = 19;
   1.322 +            this.buttonStartClient.Text = "Start Test Client";
   1.323 +            this.buttonStartClient.UseVisualStyleBackColor = true;
   1.324 +            this.buttonStartClient.Click += new System.EventHandler(this.buttonStartClient_Click);
   1.325 +            // 
   1.326 +            // iTreeViewClients
   1.327 +            // 
   1.328 +            this.iTreeViewClients.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   1.329 +            | System.Windows.Forms.AnchorStyles.Left) 
   1.330 +            | System.Windows.Forms.AnchorStyles.Right)));
   1.331 +            this.iTreeViewClients.Location = new System.Drawing.Point(108, 6);
   1.332 +            this.iTreeViewClients.Name = "iTreeViewClients";
   1.333 +            this.iTreeViewClients.Size = new System.Drawing.Size(638, 328);
   1.334 +            this.iTreeViewClients.TabIndex = 0;
   1.335 +            this.iTreeViewClients.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewClients_AfterSelect);
   1.336 +            // 
   1.337 +            // tabPageDisplay
   1.338 +            // 
   1.339 +            this.tabPageDisplay.Controls.Add(this.buttonShowClock);
   1.340 +            this.tabPageDisplay.Controls.Add(this.buttonHideClock);
   1.341 +            this.tabPageDisplay.Controls.Add(this.buttonPowerOff);
   1.342 +            this.tabPageDisplay.Controls.Add(this.buttonPowerOn);
   1.343 +            this.tabPageDisplay.Controls.Add(this.labelTimerInterval);
   1.344 +            this.tabPageDisplay.Controls.Add(this.maskedTextBoxTimerInterval);
   1.345 +            this.tabPageDisplay.Controls.Add(this.comboBoxDisplayType);
   1.346 +            this.tabPageDisplay.Controls.Add(this.buttonSuspend);
   1.347 +            this.tabPageDisplay.Controls.Add(this.checkBoxConnectOnStartup);
   1.348 +            this.tabPageDisplay.Controls.Add(this.trackBarBrightness);
   1.349 +            this.tabPageDisplay.Controls.Add(this.buttonFill);
   1.350 +            this.tabPageDisplay.Controls.Add(this.buttonClear);
   1.351 +            this.tabPageDisplay.Controls.Add(this.buttonClose);
   1.352 +            this.tabPageDisplay.Controls.Add(this.buttonOpen);
   1.353 +            this.tabPageDisplay.Controls.Add(this.buttonCapture);
   1.354 +            this.tabPageDisplay.Location = new System.Drawing.Point(4, 22);
   1.355 +            this.tabPageDisplay.Name = "tabPageDisplay";
   1.356 +            this.tabPageDisplay.Padding = new System.Windows.Forms.Padding(3);
   1.357 +            this.tabPageDisplay.Size = new System.Drawing.Size(752, 385);
   1.358 +            this.tabPageDisplay.TabIndex = 0;
   1.359 +            this.tabPageDisplay.Text = "Display";
   1.360 +            this.tabPageDisplay.UseVisualStyleBackColor = true;
   1.361 +            // 
   1.362 +            // buttonShowClock
   1.363 +            // 
   1.364 +            this.buttonShowClock.Location = new System.Drawing.Point(6, 122);
   1.365 +            this.buttonShowClock.Name = "buttonShowClock";
   1.366 +            this.buttonShowClock.Size = new System.Drawing.Size(75, 23);
   1.367 +            this.buttonShowClock.TabIndex = 23;
   1.368 +            this.buttonShowClock.Text = "Show Clock";
   1.369 +            this.buttonShowClock.UseVisualStyleBackColor = true;
   1.370 +            this.buttonShowClock.Click += new System.EventHandler(this.buttonShowClock_Click);
   1.371 +            // 
   1.372 +            // buttonHideClock
   1.373 +            // 
   1.374 +            this.buttonHideClock.Location = new System.Drawing.Point(6, 151);
   1.375 +            this.buttonHideClock.Name = "buttonHideClock";
   1.376 +            this.buttonHideClock.Size = new System.Drawing.Size(75, 23);
   1.377 +            this.buttonHideClock.TabIndex = 22;
   1.378 +            this.buttonHideClock.Text = "Hide Clock";
   1.379 +            this.buttonHideClock.UseVisualStyleBackColor = true;
   1.380 +            this.buttonHideClock.Click += new System.EventHandler(this.buttonHideClock_Click);
   1.381 +            // 
   1.382 +            // buttonPowerOff
   1.383 +            // 
   1.384 +            this.buttonPowerOff.Location = new System.Drawing.Point(6, 209);
   1.385 +            this.buttonPowerOff.Name = "buttonPowerOff";
   1.386 +            this.buttonPowerOff.Size = new System.Drawing.Size(75, 23);
   1.387 +            this.buttonPowerOff.TabIndex = 21;
   1.388 +            this.buttonPowerOff.Text = "OFF";
   1.389 +            this.buttonPowerOff.UseVisualStyleBackColor = true;
   1.390 +            this.buttonPowerOff.Click += new System.EventHandler(this.buttonPowerOff_Click);
   1.391 +            // 
   1.392 +            // buttonPowerOn
   1.393 +            // 
   1.394 +            this.buttonPowerOn.Location = new System.Drawing.Point(6, 180);
   1.395 +            this.buttonPowerOn.Name = "buttonPowerOn";
   1.396 +            this.buttonPowerOn.Size = new System.Drawing.Size(75, 23);
   1.397 +            this.buttonPowerOn.TabIndex = 20;
   1.398 +            this.buttonPowerOn.Text = "ON";
   1.399 +            this.buttonPowerOn.UseVisualStyleBackColor = true;
   1.400 +            this.buttonPowerOn.Click += new System.EventHandler(this.buttonPowerOn_Click);
   1.401 +            // 
   1.402 +            // labelTimerInterval
   1.403 +            // 
   1.404 +            this.labelTimerInterval.AutoSize = true;
   1.405 +            this.labelTimerInterval.Location = new System.Drawing.Point(184, 45);
   1.406 +            this.labelTimerInterval.Name = "labelTimerInterval";
   1.407 +            this.labelTimerInterval.Size = new System.Drawing.Size(98, 13);
   1.408 +            this.labelTimerInterval.TabIndex = 19;
   1.409 +            this.labelTimerInterval.Text = "Timer interval (ms) :";
   1.410 +            // 
   1.411 +            // maskedTextBoxTimerInterval
   1.412 +            // 
   1.413 +            this.maskedTextBoxTimerInterval.Location = new System.Drawing.Point(288, 42);
   1.414 +            this.maskedTextBoxTimerInterval.Mask = "000";
   1.415 +            this.maskedTextBoxTimerInterval.Name = "maskedTextBoxTimerInterval";
   1.416 +            this.maskedTextBoxTimerInterval.PromptChar = ' ';
   1.417 +            this.maskedTextBoxTimerInterval.Size = new System.Drawing.Size(24, 20);
   1.418 +            this.maskedTextBoxTimerInterval.TabIndex = 18;
   1.419 +            this.maskedTextBoxTimerInterval.TextChanged += new System.EventHandler(this.maskedTextBoxTimerInterval_TextChanged);
   1.420 +            // 
   1.421 +            // comboBoxDisplayType
   1.422 +            // 
   1.423 +            this.comboBoxDisplayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   1.424 +            this.comboBoxDisplayType.FormattingEnabled = true;
   1.425 +            this.comboBoxDisplayType.Location = new System.Drawing.Point(187, 9);
   1.426 +            this.comboBoxDisplayType.Name = "comboBoxDisplayType";
   1.427 +            this.comboBoxDisplayType.Size = new System.Drawing.Size(181, 21);
   1.428 +            this.comboBoxDisplayType.TabIndex = 17;
   1.429 +            this.comboBoxDisplayType.SelectedIndexChanged += new System.EventHandler(this.comboBoxDisplayType_SelectedIndexChanged);
   1.430 +            // 
   1.431 +            // buttonSuspend
   1.432 +            // 
   1.433 +            this.buttonSuspend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.434 +            this.buttonSuspend.Location = new System.Drawing.Point(6, 317);
   1.435 +            this.buttonSuspend.Name = "buttonSuspend";
   1.436 +            this.buttonSuspend.Size = new System.Drawing.Size(75, 23);
   1.437 +            this.buttonSuspend.TabIndex = 16;
   1.438 +            this.buttonSuspend.Text = "Pause";
   1.439 +            this.buttonSuspend.UseVisualStyleBackColor = true;
   1.440 +            this.buttonSuspend.Click += new System.EventHandler(this.buttonSuspend_Click);
   1.441 +            // 
   1.442 +            // checkBoxConnectOnStartup
   1.443 +            // 
   1.444 +            this.checkBoxConnectOnStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.445 +            this.checkBoxConnectOnStartup.AutoSize = true;
   1.446 +            this.checkBoxConnectOnStartup.Location = new System.Drawing.Point(113, 350);
   1.447 +            this.checkBoxConnectOnStartup.Name = "checkBoxConnectOnStartup";
   1.448 +            this.checkBoxConnectOnStartup.Size = new System.Drawing.Size(119, 17);
   1.449 +            this.checkBoxConnectOnStartup.TabIndex = 13;
   1.450 +            this.checkBoxConnectOnStartup.Text = "Connect on stratup ";
   1.451 +            this.checkBoxConnectOnStartup.UseVisualStyleBackColor = true;
   1.452 +            this.checkBoxConnectOnStartup.CheckedChanged += new System.EventHandler(this.checkBoxConnectOnStartup_CheckedChanged);
   1.453 +            // 
   1.454 +            // trackBarBrightness
   1.455 +            // 
   1.456 +            this.trackBarBrightness.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   1.457 +            | System.Windows.Forms.AnchorStyles.Right)));
   1.458 +            this.trackBarBrightness.BackColor = System.Drawing.SystemColors.Window;
   1.459 +            this.trackBarBrightness.Location = new System.Drawing.Point(704, 9);
   1.460 +            this.trackBarBrightness.Name = "trackBarBrightness";
   1.461 +            this.trackBarBrightness.Orientation = System.Windows.Forms.Orientation.Vertical;
   1.462 +            this.trackBarBrightness.Size = new System.Drawing.Size(45, 358);
   1.463 +            this.trackBarBrightness.TabIndex = 10;
   1.464 +            this.trackBarBrightness.TickStyle = System.Windows.Forms.TickStyle.Both;
   1.465 +            this.toolTip.SetToolTip(this.trackBarBrightness, "Brightness adjustment");
   1.466 +            this.trackBarBrightness.Scroll += new System.EventHandler(this.trackBarBrightness_Scroll);
   1.467 +            // 
   1.468 +            // buttonFill
   1.469 +            // 
   1.470 +            this.buttonFill.Location = new System.Drawing.Point(6, 93);
   1.471 +            this.buttonFill.Name = "buttonFill";
   1.472 +            this.buttonFill.Size = new System.Drawing.Size(75, 23);
   1.473 +            this.buttonFill.TabIndex = 9;
   1.474 +            this.buttonFill.Text = "Fill";
   1.475 +            this.buttonFill.UseVisualStyleBackColor = true;
   1.476 +            this.buttonFill.Click += new System.EventHandler(this.buttonFill_Click);
   1.477 +            // 
   1.478 +            // buttonClear
   1.479 +            // 
   1.480 +            this.buttonClear.Location = new System.Drawing.Point(6, 64);
   1.481 +            this.buttonClear.Name = "buttonClear";
   1.482 +            this.buttonClear.Size = new System.Drawing.Size(75, 23);
   1.483 +            this.buttonClear.TabIndex = 8;
   1.484 +            this.buttonClear.Text = "Clear";
   1.485 +            this.buttonClear.UseVisualStyleBackColor = true;
   1.486 +            this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click);
   1.487 +            // 
   1.488 +            // buttonClose
   1.489 +            // 
   1.490 +            this.buttonClose.Location = new System.Drawing.Point(6, 35);
   1.491 +            this.buttonClose.Name = "buttonClose";
   1.492 +            this.buttonClose.Size = new System.Drawing.Size(75, 23);
   1.493 +            this.buttonClose.TabIndex = 7;
   1.494 +            this.buttonClose.Text = "Close";
   1.495 +            this.buttonClose.UseVisualStyleBackColor = true;
   1.496 +            this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
   1.497 +            // 
   1.498 +            // buttonOpen
   1.499 +            // 
   1.500 +            this.buttonOpen.Location = new System.Drawing.Point(6, 6);
   1.501 +            this.buttonOpen.Name = "buttonOpen";
   1.502 +            this.buttonOpen.Size = new System.Drawing.Size(75, 23);
   1.503 +            this.buttonOpen.TabIndex = 6;
   1.504 +            this.buttonOpen.Text = "Open";
   1.505 +            this.buttonOpen.UseVisualStyleBackColor = true;
   1.506 +            this.buttonOpen.Click += new System.EventHandler(this.buttonOpen_Click);
   1.507 +            // 
   1.508 +            // buttonCapture
   1.509 +            // 
   1.510 +            this.buttonCapture.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.511 +            this.buttonCapture.Location = new System.Drawing.Point(6, 346);
   1.512 +            this.buttonCapture.Name = "buttonCapture";
   1.513 +            this.buttonCapture.Size = new System.Drawing.Size(75, 23);
   1.514 +            this.buttonCapture.TabIndex = 5;
   1.515 +            this.buttonCapture.Text = "Capture";
   1.516 +            this.buttonCapture.UseVisualStyleBackColor = true;
   1.517 +            this.buttonCapture.Click += new System.EventHandler(this.buttonCapture_Click);
   1.518 +            // 
   1.519 +            // labelWarning
   1.520 +            // 
   1.521 +            this.labelWarning.AutoSize = true;
   1.522 +            this.labelWarning.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
   1.523 +            this.labelWarning.ForeColor = System.Drawing.Color.Red;
   1.524 +            this.labelWarning.Location = new System.Drawing.Point(9, 9);
   1.525 +            this.labelWarning.Name = "labelWarning";
   1.526 +            this.labelWarning.Size = new System.Drawing.Size(80, 16);
   1.527 +            this.labelWarning.TabIndex = 18;
   1.528 +            this.labelWarning.Text = "WARNING";
   1.529 +            this.labelWarning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   1.530 +            this.labelWarning.Visible = false;
   1.531 +            // 
   1.532 +            // checkBoxFixedPitchFontOnly
   1.533 +            // 
   1.534 +            this.checkBoxFixedPitchFontOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.535 +            this.checkBoxFixedPitchFontOnly.AutoSize = true;
   1.536 +            this.checkBoxFixedPitchFontOnly.Location = new System.Drawing.Point(87, 362);
   1.537 +            this.checkBoxFixedPitchFontOnly.Name = "checkBoxFixedPitchFontOnly";
   1.538 +            this.checkBoxFixedPitchFontOnly.Size = new System.Drawing.Size(120, 17);
   1.539 +            this.checkBoxFixedPitchFontOnly.TabIndex = 17;
   1.540 +            this.checkBoxFixedPitchFontOnly.Text = "Fixed pitch font only";
   1.541 +            this.checkBoxFixedPitchFontOnly.UseVisualStyleBackColor = true;
   1.542 +            // 
   1.543 +            // checkBoxShowBorders
   1.544 +            // 
   1.545 +            this.checkBoxShowBorders.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   1.546 +            this.checkBoxShowBorders.AutoSize = true;
   1.547 +            this.checkBoxShowBorders.Location = new System.Drawing.Point(645, 29);
   1.548 +            this.checkBoxShowBorders.Name = "checkBoxShowBorders";
   1.549 +            this.checkBoxShowBorders.Size = new System.Drawing.Size(91, 17);
   1.550 +            this.checkBoxShowBorders.TabIndex = 11;
   1.551 +            this.checkBoxShowBorders.Text = "Show borders";
   1.552 +            this.checkBoxShowBorders.UseVisualStyleBackColor = true;
   1.553 +            this.checkBoxShowBorders.CheckedChanged += new System.EventHandler(this.checkBoxShowBorders_CheckedChanged);
   1.554 +            // 
   1.555 +            // buttonFont
   1.556 +            // 
   1.557 +            this.buttonFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.558 +            this.buttonFont.Location = new System.Drawing.Point(6, 356);
   1.559 +            this.buttonFont.Name = "buttonFont";
   1.560 +            this.buttonFont.Size = new System.Drawing.Size(75, 23);
   1.561 +            this.buttonFont.TabIndex = 0;
   1.562 +            this.buttonFont.Text = "Select Font";
   1.563 +            this.buttonFont.UseVisualStyleBackColor = true;
   1.564 +            this.buttonFont.Click += new System.EventHandler(this.buttonFont_Click);
   1.565 +            // 
   1.566 +            // tabControl
   1.567 +            // 
   1.568 +            this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   1.569 +            | System.Windows.Forms.AnchorStyles.Left) 
   1.570 +            | System.Windows.Forms.AnchorStyles.Right)));
   1.571 +            this.tabControl.Controls.Add(this.tabPageDisplay);
   1.572 +            this.tabControl.Controls.Add(this.tabPageClients);
   1.573 +            this.tabControl.Controls.Add(this.tabPageDesign);
   1.574 +            this.tabControl.Controls.Add(this.tabPageAudio);
   1.575 +            this.tabControl.Controls.Add(this.tabPageInput);
   1.576 +            this.tabControl.Controls.Add(this.tabPageCec);
   1.577 +            this.tabControl.Controls.Add(this.tabPageEvent);
   1.578 +            this.tabControl.Controls.Add(this.tabPageApp);
   1.579 +            this.tabControl.Controls.Add(this.tabPageLogs);
   1.580 +            this.tabControl.Location = new System.Drawing.Point(12, 125);
   1.581 +            this.tabControl.Name = "tabControl";
   1.582 +            this.tabControl.SelectedIndex = 0;
   1.583 +            this.tabControl.Size = new System.Drawing.Size(760, 411);
   1.584 +            this.tabControl.TabIndex = 0;
   1.585 +            // 
   1.586 +            // tabPageDesign
   1.587 +            // 
   1.588 +            this.tabPageDesign.Controls.Add(this.labelScrollingSpeed);
   1.589 +            this.tabPageDesign.Controls.Add(this.maskedTextBoxScrollingSpeed);
   1.590 +            this.tabPageDesign.Controls.Add(this.labelScrollLoopSeparator);
   1.591 +            this.tabPageDesign.Controls.Add(this.textBoxScrollLoopSeparator);
   1.592 +            this.tabPageDesign.Controls.Add(this.labelMinFontSize);
   1.593 +            this.tabPageDesign.Controls.Add(this.maskedTextBoxMinFontSize);
   1.594 +            this.tabPageDesign.Controls.Add(this.checkBoxScaleToFit);
   1.595 +            this.tabPageDesign.Controls.Add(this.checkBoxInverseColors);
   1.596 +            this.tabPageDesign.Controls.Add(this.checkBoxFixedPitchFontOnly);
   1.597 +            this.tabPageDesign.Controls.Add(this.buttonFont);
   1.598 +            this.tabPageDesign.Controls.Add(this.checkBoxReverseScreen);
   1.599 +            this.tabPageDesign.Controls.Add(this.checkBoxShowBorders);
   1.600 +            this.tabPageDesign.Location = new System.Drawing.Point(4, 22);
   1.601 +            this.tabPageDesign.Name = "tabPageDesign";
   1.602 +            this.tabPageDesign.Padding = new System.Windows.Forms.Padding(3);
   1.603 +            this.tabPageDesign.Size = new System.Drawing.Size(752, 385);
   1.604 +            this.tabPageDesign.TabIndex = 3;
   1.605 +            this.tabPageDesign.Text = "Design";
   1.606 +            this.tabPageDesign.UseVisualStyleBackColor = true;
   1.607 +            // 
   1.608 +            // labelScrollingSpeed
   1.609 +            // 
   1.610 +            this.labelScrollingSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.611 +            this.labelScrollingSpeed.AutoSize = true;
   1.612 +            this.labelScrollingSpeed.Location = new System.Drawing.Point(92, 248);
   1.613 +            this.labelScrollingSpeed.Name = "labelScrollingSpeed";
   1.614 +            this.labelScrollingSpeed.Size = new System.Drawing.Size(115, 13);
   1.615 +            this.labelScrollingSpeed.TabIndex = 28;
   1.616 +            this.labelScrollingSpeed.Text = "Scrolling speed (px/s) :";
   1.617 +            // 
   1.618 +            // maskedTextBoxScrollingSpeed
   1.619 +            // 
   1.620 +            this.maskedTextBoxScrollingSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.621 +            this.maskedTextBoxScrollingSpeed.Location = new System.Drawing.Point(213, 245);
   1.622 +            this.maskedTextBoxScrollingSpeed.Mask = "000";
   1.623 +            this.maskedTextBoxScrollingSpeed.Name = "maskedTextBoxScrollingSpeed";
   1.624 +            this.maskedTextBoxScrollingSpeed.PromptChar = ' ';
   1.625 +            this.maskedTextBoxScrollingSpeed.Size = new System.Drawing.Size(24, 20);
   1.626 +            this.maskedTextBoxScrollingSpeed.TabIndex = 27;
   1.627 +            this.maskedTextBoxScrollingSpeed.TextChanged += new System.EventHandler(this.maskedTextBoxScrollingSpeed_TextChanged);
   1.628 +            // 
   1.629 +            // labelScrollLoopSeparator
   1.630 +            // 
   1.631 +            this.labelScrollLoopSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.632 +            this.labelScrollLoopSeparator.AutoSize = true;
   1.633 +            this.labelScrollLoopSeparator.Location = new System.Drawing.Point(98, 274);
   1.634 +            this.labelScrollLoopSeparator.Name = "labelScrollLoopSeparator";
   1.635 +            this.labelScrollLoopSeparator.Size = new System.Drawing.Size(109, 13);
   1.636 +            this.labelScrollLoopSeparator.TabIndex = 26;
   1.637 +            this.labelScrollLoopSeparator.Text = "Scroll loop separator :";
   1.638 +            // 
   1.639 +            // textBoxScrollLoopSeparator
   1.640 +            // 
   1.641 +            this.textBoxScrollLoopSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.642 +            this.textBoxScrollLoopSeparator.Location = new System.Drawing.Point(213, 271);
   1.643 +            this.textBoxScrollLoopSeparator.Name = "textBoxScrollLoopSeparator";
   1.644 +            this.textBoxScrollLoopSeparator.Size = new System.Drawing.Size(74, 20);
   1.645 +            this.textBoxScrollLoopSeparator.TabIndex = 25;
   1.646 +            this.textBoxScrollLoopSeparator.TextChanged += new System.EventHandler(this.textBoxScrollLoopSeparator_TextChanged);
   1.647 +            // 
   1.648 +            // labelMinFontSize
   1.649 +            // 
   1.650 +            this.labelMinFontSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.651 +            this.labelMinFontSize.AutoSize = true;
   1.652 +            this.labelMinFontSize.Location = new System.Drawing.Point(88, 323);
   1.653 +            this.labelMinFontSize.Name = "labelMinFontSize";
   1.654 +            this.labelMinFontSize.Size = new System.Drawing.Size(119, 13);
   1.655 +            this.labelMinFontSize.TabIndex = 24;
   1.656 +            this.labelMinFontSize.Text = "Minimum font size (pts) :";
   1.657 +            // 
   1.658 +            // maskedTextBoxMinFontSize
   1.659 +            // 
   1.660 +            this.maskedTextBoxMinFontSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.661 +            this.maskedTextBoxMinFontSize.Location = new System.Drawing.Point(213, 320);
   1.662 +            this.maskedTextBoxMinFontSize.Mask = "000";
   1.663 +            this.maskedTextBoxMinFontSize.Name = "maskedTextBoxMinFontSize";
   1.664 +            this.maskedTextBoxMinFontSize.PromptChar = ' ';
   1.665 +            this.maskedTextBoxMinFontSize.Size = new System.Drawing.Size(24, 20);
   1.666 +            this.maskedTextBoxMinFontSize.TabIndex = 23;
   1.667 +            this.maskedTextBoxMinFontSize.TextChanged += new System.EventHandler(this.maskedTextBoxMinFontSize_TextChanged);
   1.668 +            // 
   1.669 +            // checkBoxScaleToFit
   1.670 +            // 
   1.671 +            this.checkBoxScaleToFit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.672 +            this.checkBoxScaleToFit.AutoSize = true;
   1.673 +            this.checkBoxScaleToFit.Location = new System.Drawing.Point(86, 297);
   1.674 +            this.checkBoxScaleToFit.Name = "checkBoxScaleToFit";
   1.675 +            this.checkBoxScaleToFit.Size = new System.Drawing.Size(201, 17);
   1.676 +            this.checkBoxScaleToFit.TabIndex = 22;
   1.677 +            this.checkBoxScaleToFit.Text = "Try scale font down to avoid scrolling";
   1.678 +            this.checkBoxScaleToFit.UseVisualStyleBackColor = true;
   1.679 +            this.checkBoxScaleToFit.CheckedChanged += new System.EventHandler(this.checkBoxScaleToFit_CheckedChanged);
   1.680 +            // 
   1.681 +            // checkBoxInverseColors
   1.682 +            // 
   1.683 +            this.checkBoxInverseColors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   1.684 +            this.checkBoxInverseColors.AutoSize = true;
   1.685 +            this.checkBoxInverseColors.Location = new System.Drawing.Point(645, 52);
   1.686 +            this.checkBoxInverseColors.Name = "checkBoxInverseColors";
   1.687 +            this.checkBoxInverseColors.Size = new System.Drawing.Size(92, 17);
   1.688 +            this.checkBoxInverseColors.TabIndex = 21;
   1.689 +            this.checkBoxInverseColors.Text = "Inverse colors";
   1.690 +            this.checkBoxInverseColors.UseVisualStyleBackColor = true;
   1.691 +            this.checkBoxInverseColors.CheckedChanged += new System.EventHandler(this.checkBoxInverseColors_CheckedChanged);
   1.692 +            // 
   1.693 +            // checkBoxReverseScreen
   1.694 +            // 
   1.695 +            this.checkBoxReverseScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   1.696 +            this.checkBoxReverseScreen.AutoSize = true;
   1.697 +            this.checkBoxReverseScreen.Location = new System.Drawing.Point(645, 6);
   1.698 +            this.checkBoxReverseScreen.Name = "checkBoxReverseScreen";
   1.699 +            this.checkBoxReverseScreen.Size = new System.Drawing.Size(101, 17);
   1.700 +            this.checkBoxReverseScreen.TabIndex = 14;
   1.701 +            this.checkBoxReverseScreen.Text = "Reverse screen";
   1.702 +            this.checkBoxReverseScreen.UseVisualStyleBackColor = true;
   1.703 +            this.checkBoxReverseScreen.CheckedChanged += new System.EventHandler(this.checkBoxReverseScreen_CheckedChanged);
   1.704 +            // 
   1.705 +            // tabPageAudio
   1.706 +            // 
   1.707 +            this.tabPageAudio.Controls.Add(this.labelDefaultAudioDevice);
   1.708 +            this.tabPageAudio.Controls.Add(this.checkBoxShowVolumeLabel);
   1.709 +            this.tabPageAudio.Controls.Add(this.checkBoxMute);
   1.710 +            this.tabPageAudio.Controls.Add(this.trackBarMasterVolume);
   1.711 +            this.tabPageAudio.Location = new System.Drawing.Point(4, 22);
   1.712 +            this.tabPageAudio.Name = "tabPageAudio";
   1.713 +            this.tabPageAudio.Padding = new System.Windows.Forms.Padding(3);
   1.714 +            this.tabPageAudio.Size = new System.Drawing.Size(752, 385);
   1.715 +            this.tabPageAudio.TabIndex = 5;
   1.716 +            this.tabPageAudio.Text = "Audio";
   1.717 +            this.tabPageAudio.UseVisualStyleBackColor = true;
   1.718 +            // 
   1.719 +            // labelDefaultAudioDevice
   1.720 +            // 
   1.721 +            this.labelDefaultAudioDevice.AutoSize = true;
   1.722 +            this.labelDefaultAudioDevice.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
   1.723 +            this.labelDefaultAudioDevice.Location = new System.Drawing.Point(3, 6);
   1.724 +            this.labelDefaultAudioDevice.Name = "labelDefaultAudioDevice";
   1.725 +            this.labelDefaultAudioDevice.Size = new System.Drawing.Size(120, 13);
   1.726 +            this.labelDefaultAudioDevice.TabIndex = 19;
   1.727 +            this.labelDefaultAudioDevice.Text = "Audio Device Unknown";
   1.728 +            // 
   1.729 +            // checkBoxShowVolumeLabel
   1.730 +            // 
   1.731 +            this.checkBoxShowVolumeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.732 +            this.checkBoxShowVolumeLabel.AutoSize = true;
   1.733 +            this.checkBoxShowVolumeLabel.Location = new System.Drawing.Point(3, 329);
   1.734 +            this.checkBoxShowVolumeLabel.Name = "checkBoxShowVolumeLabel";
   1.735 +            this.checkBoxShowVolumeLabel.Size = new System.Drawing.Size(115, 17);
   1.736 +            this.checkBoxShowVolumeLabel.TabIndex = 18;
   1.737 +            this.checkBoxShowVolumeLabel.Text = "Show volume label";
   1.738 +            this.checkBoxShowVolumeLabel.UseVisualStyleBackColor = true;
   1.739 +            this.checkBoxShowVolumeLabel.CheckedChanged += new System.EventHandler(this.checkBoxShowVolumeLabel_CheckedChanged);
   1.740 +            // 
   1.741 +            // checkBoxMute
   1.742 +            // 
   1.743 +            this.checkBoxMute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.744 +            this.checkBoxMute.AutoSize = true;
   1.745 +            this.checkBoxMute.Location = new System.Drawing.Point(3, 352);
   1.746 +            this.checkBoxMute.Name = "checkBoxMute";
   1.747 +            this.checkBoxMute.Size = new System.Drawing.Size(50, 17);
   1.748 +            this.checkBoxMute.TabIndex = 17;
   1.749 +            this.checkBoxMute.Text = "Mute";
   1.750 +            this.checkBoxMute.UseVisualStyleBackColor = true;
   1.751 +            this.checkBoxMute.CheckedChanged += new System.EventHandler(this.checkBoxMute_CheckedChanged);
   1.752 +            // 
   1.753 +            // trackBarMasterVolume
   1.754 +            // 
   1.755 +            this.trackBarMasterVolume.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   1.756 +            | System.Windows.Forms.AnchorStyles.Right)));
   1.757 +            this.trackBarMasterVolume.BackColor = System.Drawing.SystemColors.Window;
   1.758 +            this.trackBarMasterVolume.Location = new System.Drawing.Point(701, 6);
   1.759 +            this.trackBarMasterVolume.Maximum = 100;
   1.760 +            this.trackBarMasterVolume.Name = "trackBarMasterVolume";
   1.761 +            this.trackBarMasterVolume.Orientation = System.Windows.Forms.Orientation.Vertical;
   1.762 +            this.trackBarMasterVolume.Size = new System.Drawing.Size(45, 373);
   1.763 +            this.trackBarMasterVolume.TabIndex = 0;
   1.764 +            this.trackBarMasterVolume.TickFrequency = 10;
   1.765 +            this.trackBarMasterVolume.TickStyle = System.Windows.Forms.TickStyle.Both;
   1.766 +            this.toolTip.SetToolTip(this.trackBarMasterVolume, "Master Volume");
   1.767 +            this.trackBarMasterVolume.Scroll += new System.EventHandler(this.trackBarMasterVolume_Scroll);
   1.768 +            // 
   1.769 +            // tabPageInput
   1.770 +            // 
   1.771 +            this.tabPageInput.Controls.Add(this.comboBoxOpticalDrives);
   1.772 +            this.tabPageInput.Controls.Add(this.labelOpticalDriveEject);
   1.773 +            this.tabPageInput.Controls.Add(this.pictureBoxGreenStart);
   1.774 +            this.tabPageInput.Controls.Add(this.labelStartFileName);
   1.775 +            this.tabPageInput.Controls.Add(this.buttonSelectFile);
   1.776 +            this.tabPageInput.Location = new System.Drawing.Point(4, 22);
   1.777 +            this.tabPageInput.Name = "tabPageInput";
   1.778 +            this.tabPageInput.Padding = new System.Windows.Forms.Padding(3);
   1.779 +            this.tabPageInput.Size = new System.Drawing.Size(752, 385);
   1.780 +            this.tabPageInput.TabIndex = 6;
   1.781 +            this.tabPageInput.Text = "Input";
   1.782 +            this.tabPageInput.UseVisualStyleBackColor = true;
   1.783 +            // 
   1.784 +            // comboBoxOpticalDrives
   1.785 +            // 
   1.786 +            this.comboBoxOpticalDrives.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   1.787 +            this.comboBoxOpticalDrives.FormattingEnabled = true;
   1.788 +            this.comboBoxOpticalDrives.Location = new System.Drawing.Point(113, 53);
   1.789 +            this.comboBoxOpticalDrives.Name = "comboBoxOpticalDrives";
   1.790 +            this.comboBoxOpticalDrives.Size = new System.Drawing.Size(55, 21);
   1.791 +            this.comboBoxOpticalDrives.TabIndex = 18;
   1.792 +            this.comboBoxOpticalDrives.SelectedIndexChanged += new System.EventHandler(this.comboBoxOpticalDrives_SelectedIndexChanged);
   1.793 +            // 
   1.794 +            // labelOpticalDriveEject
   1.795 +            // 
   1.796 +            this.labelOpticalDriveEject.AutoSize = true;
   1.797 +            this.labelOpticalDriveEject.Location = new System.Drawing.Point(0, 56);
   1.798 +            this.labelOpticalDriveEject.Name = "labelOpticalDriveEject";
   1.799 +            this.labelOpticalDriveEject.Size = new System.Drawing.Size(107, 13);
   1.800 +            this.labelOpticalDriveEject.TabIndex = 3;
   1.801 +            this.labelOpticalDriveEject.Text = "Optical drive to eject:";
   1.802 +            // 
   1.803 +            // pictureBoxGreenStart
   1.804 +            // 
   1.805 +            this.pictureBoxGreenStart.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxGreenStart.Image")));
   1.806 +            this.pictureBoxGreenStart.Location = new System.Drawing.Point(3, 6);
   1.807 +            this.pictureBoxGreenStart.Name = "pictureBoxGreenStart";
   1.808 +            this.pictureBoxGreenStart.Size = new System.Drawing.Size(32, 32);
   1.809 +            this.pictureBoxGreenStart.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
   1.810 +            this.pictureBoxGreenStart.TabIndex = 2;
   1.811 +            this.pictureBoxGreenStart.TabStop = false;
   1.812 +            // 
   1.813 +            // labelStartFileName
   1.814 +            // 
   1.815 +            this.labelStartFileName.AutoSize = true;
   1.816 +            this.labelStartFileName.Location = new System.Drawing.Point(72, 16);
   1.817 +            this.labelStartFileName.Name = "labelStartFileName";
   1.818 +            this.labelStartFileName.Size = new System.Drawing.Size(33, 13);
   1.819 +            this.labelStartFileName.TabIndex = 1;
   1.820 +            this.labelStartFileName.Text = "None";
   1.821 +            // 
   1.822 +            // buttonSelectFile
   1.823 +            // 
   1.824 +            this.buttonSelectFile.Location = new System.Drawing.Point(41, 11);
   1.825 +            this.buttonSelectFile.Name = "buttonSelectFile";
   1.826 +            this.buttonSelectFile.Size = new System.Drawing.Size(25, 23);
   1.827 +            this.buttonSelectFile.TabIndex = 0;
   1.828 +            this.buttonSelectFile.Text = "...";
   1.829 +            this.buttonSelectFile.UseVisualStyleBackColor = true;
   1.830 +            this.buttonSelectFile.Click += new System.EventHandler(this.buttonSelectFile_Click);
   1.831 +            // 
   1.832 +            // tabPageCec
   1.833 +            // 
   1.834 +            this.tabPageCec.Controls.Add(this.groupBoxCecLogOptions);
   1.835 +            this.tabPageCec.Controls.Add(this.checkBoxCecEnabled);
   1.836 +            this.tabPageCec.Controls.Add(this.labelHdmiPort);
   1.837 +            this.tabPageCec.Controls.Add(this.comboBoxHdmiPort);
   1.838 +            this.tabPageCec.Location = new System.Drawing.Point(4, 22);
   1.839 +            this.tabPageCec.Name = "tabPageCec";
   1.840 +            this.tabPageCec.Padding = new System.Windows.Forms.Padding(3);
   1.841 +            this.tabPageCec.Size = new System.Drawing.Size(752, 385);
   1.842 +            this.tabPageCec.TabIndex = 7;
   1.843 +            this.tabPageCec.Text = "CEC";
   1.844 +            this.tabPageCec.UseVisualStyleBackColor = true;
   1.845 +            // 
   1.846 +            // groupBoxCecLogOptions
   1.847 +            // 
   1.848 +            this.groupBoxCecLogOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   1.849 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogNoPoll);
   1.850 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogTraffic);
   1.851 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogDebug);
   1.852 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogNotice);
   1.853 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogError);
   1.854 +            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogWarning);
   1.855 +            this.groupBoxCecLogOptions.Location = new System.Drawing.Point(6, 239);
   1.856 +            this.groupBoxCecLogOptions.Name = "groupBoxCecLogOptions";
   1.857 +            this.groupBoxCecLogOptions.Size = new System.Drawing.Size(165, 140);
   1.858 +            this.groupBoxCecLogOptions.TabIndex = 25;
   1.859 +            this.groupBoxCecLogOptions.TabStop = false;
   1.860 +            this.groupBoxCecLogOptions.Text = "Log options";
   1.861 +            // 
   1.862 +            // checkBoxCecLogNoPoll
   1.863 +            // 
   1.864 +            this.checkBoxCecLogNoPoll.AutoSize = true;
   1.865 +            this.checkBoxCecLogNoPoll.Checked = true;
   1.866 +            this.checkBoxCecLogNoPoll.CheckState = System.Windows.Forms.CheckState.Checked;
   1.867 +            this.checkBoxCecLogNoPoll.Location = new System.Drawing.Point(76, 24);
   1.868 +            this.checkBoxCecLogNoPoll.Name = "checkBoxCecLogNoPoll";
   1.869 +            this.checkBoxCecLogNoPoll.Size = new System.Drawing.Size(59, 17);
   1.870 +            this.checkBoxCecLogNoPoll.TabIndex = 30;
   1.871 +            this.checkBoxCecLogNoPoll.Text = "No poll";
   1.872 +            this.checkBoxCecLogNoPoll.UseVisualStyleBackColor = true;
   1.873 +            this.checkBoxCecLogNoPoll.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.874 +            // 
   1.875 +            // checkBoxCecLogTraffic
   1.876 +            // 
   1.877 +            this.checkBoxCecLogTraffic.AutoSize = true;
   1.878 +            this.checkBoxCecLogTraffic.Location = new System.Drawing.Point(6, 93);
   1.879 +            this.checkBoxCecLogTraffic.Name = "checkBoxCecLogTraffic";
   1.880 +            this.checkBoxCecLogTraffic.Size = new System.Drawing.Size(56, 17);
   1.881 +            this.checkBoxCecLogTraffic.TabIndex = 29;
   1.882 +            this.checkBoxCecLogTraffic.Text = "Traffic";
   1.883 +            this.checkBoxCecLogTraffic.UseVisualStyleBackColor = true;
   1.884 +            this.checkBoxCecLogTraffic.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.885 +            // 
   1.886 +            // checkBoxCecLogDebug
   1.887 +            // 
   1.888 +            this.checkBoxCecLogDebug.AutoSize = true;
   1.889 +            this.checkBoxCecLogDebug.Location = new System.Drawing.Point(6, 116);
   1.890 +            this.checkBoxCecLogDebug.Name = "checkBoxCecLogDebug";
   1.891 +            this.checkBoxCecLogDebug.Size = new System.Drawing.Size(58, 17);
   1.892 +            this.checkBoxCecLogDebug.TabIndex = 28;
   1.893 +            this.checkBoxCecLogDebug.Text = "Debug";
   1.894 +            this.checkBoxCecLogDebug.UseVisualStyleBackColor = true;
   1.895 +            this.checkBoxCecLogDebug.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.896 +            // 
   1.897 +            // checkBoxCecLogNotice
   1.898 +            // 
   1.899 +            this.checkBoxCecLogNotice.AutoSize = true;
   1.900 +            this.checkBoxCecLogNotice.Checked = true;
   1.901 +            this.checkBoxCecLogNotice.CheckState = System.Windows.Forms.CheckState.Checked;
   1.902 +            this.checkBoxCecLogNotice.Location = new System.Drawing.Point(6, 70);
   1.903 +            this.checkBoxCecLogNotice.Name = "checkBoxCecLogNotice";
   1.904 +            this.checkBoxCecLogNotice.Size = new System.Drawing.Size(57, 17);
   1.905 +            this.checkBoxCecLogNotice.TabIndex = 27;
   1.906 +            this.checkBoxCecLogNotice.Text = "Notice";
   1.907 +            this.checkBoxCecLogNotice.UseVisualStyleBackColor = true;
   1.908 +            this.checkBoxCecLogNotice.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.909 +            // 
   1.910 +            // checkBoxCecLogError
   1.911 +            // 
   1.912 +            this.checkBoxCecLogError.AutoSize = true;
   1.913 +            this.checkBoxCecLogError.Checked = true;
   1.914 +            this.checkBoxCecLogError.CheckState = System.Windows.Forms.CheckState.Checked;
   1.915 +            this.checkBoxCecLogError.Location = new System.Drawing.Point(6, 24);
   1.916 +            this.checkBoxCecLogError.Name = "checkBoxCecLogError";
   1.917 +            this.checkBoxCecLogError.Size = new System.Drawing.Size(48, 17);
   1.918 +            this.checkBoxCecLogError.TabIndex = 26;
   1.919 +            this.checkBoxCecLogError.Text = "Error";
   1.920 +            this.checkBoxCecLogError.UseVisualStyleBackColor = true;
   1.921 +            this.checkBoxCecLogError.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.922 +            // 
   1.923 +            // checkBoxCecLogWarning
   1.924 +            // 
   1.925 +            this.checkBoxCecLogWarning.AutoSize = true;
   1.926 +            this.checkBoxCecLogWarning.Checked = true;
   1.927 +            this.checkBoxCecLogWarning.CheckState = System.Windows.Forms.CheckState.Checked;
   1.928 +            this.checkBoxCecLogWarning.Location = new System.Drawing.Point(6, 47);
   1.929 +            this.checkBoxCecLogWarning.Name = "checkBoxCecLogWarning";
   1.930 +            this.checkBoxCecLogWarning.Size = new System.Drawing.Size(66, 17);
   1.931 +            this.checkBoxCecLogWarning.TabIndex = 25;
   1.932 +            this.checkBoxCecLogWarning.Text = "Warning";
   1.933 +            this.checkBoxCecLogWarning.UseVisualStyleBackColor = true;
   1.934 +            this.checkBoxCecLogWarning.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   1.935 +            // 
   1.936 +            // checkBoxCecEnabled
   1.937 +            // 
   1.938 +            this.checkBoxCecEnabled.AutoSize = true;
   1.939 +            this.checkBoxCecEnabled.Location = new System.Drawing.Point(6, 6);
   1.940 +            this.checkBoxCecEnabled.Name = "checkBoxCecEnabled";
   1.941 +            this.checkBoxCecEnabled.Size = new System.Drawing.Size(83, 17);
   1.942 +            this.checkBoxCecEnabled.TabIndex = 21;
   1.943 +            this.checkBoxCecEnabled.Text = "Enable CEC";
   1.944 +            this.checkBoxCecEnabled.UseVisualStyleBackColor = true;
   1.945 +            this.checkBoxCecEnabled.CheckedChanged += new System.EventHandler(this.checkBoxCecEnabled_CheckedChanged);
   1.946 +            // 
   1.947 +            // labelHdmiPort
   1.948 +            // 
   1.949 +            this.labelHdmiPort.AutoSize = true;
   1.950 +            this.labelHdmiPort.Location = new System.Drawing.Point(3, 26);
   1.951 +            this.labelHdmiPort.Name = "labelHdmiPort";
   1.952 +            this.labelHdmiPort.Size = new System.Drawing.Size(182, 13);
   1.953 +            this.labelHdmiPort.TabIndex = 20;
   1.954 +            this.labelHdmiPort.Text = "TV HDMI port connected to your PC:";
   1.955 +            // 
   1.956 +            // comboBoxHdmiPort
   1.957 +            // 
   1.958 +            this.comboBoxHdmiPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   1.959 +            this.comboBoxHdmiPort.FormattingEnabled = true;
   1.960 +            this.comboBoxHdmiPort.Items.AddRange(new object[] {
   1.961 +            "HDMI 1",
   1.962 +            "HDMI 2",
   1.963 +            "HDMI 3",
   1.964 +            "HDMI 4",
   1.965 +            "HDMI 5",
   1.966 +            "HDMI 6",
   1.967 +            "HDMI 7",
   1.968 +            "HDMI 8",
   1.969 +            "HDMI 9"});
   1.970 +            this.comboBoxHdmiPort.Location = new System.Drawing.Point(6, 42);
   1.971 +            this.comboBoxHdmiPort.Name = "comboBoxHdmiPort";
   1.972 +            this.comboBoxHdmiPort.Size = new System.Drawing.Size(87, 21);
   1.973 +            this.comboBoxHdmiPort.TabIndex = 19;
   1.974 +            this.comboBoxHdmiPort.SelectedIndexChanged += new System.EventHandler(this.comboBoxHdmiPort_SelectedIndexChanged);
   1.975 +            // 
   1.976 +            // tabPageEvent
   1.977 +            // 
   1.978 +            this.tabPageEvent.Controls.Add(this.buttonActionMoveUp);
   1.979 +            this.tabPageEvent.Controls.Add(this.buttonActionMoveDown);
   1.980 +            this.tabPageEvent.Controls.Add(this.buttonTestAction);
   1.981 +            this.tabPageEvent.Controls.Add(this.buttonDeleteAction);
   1.982 +            this.tabPageEvent.Controls.Add(this.buttonAddAction);
   1.983 +            this.tabPageEvent.Controls.Add(this.iTreeViewEvents);
   1.984 +            this.tabPageEvent.Location = new System.Drawing.Point(4, 22);
   1.985 +            this.tabPageEvent.Name = "tabPageEvent";
   1.986 +            this.tabPageEvent.Padding = new System.Windows.Forms.Padding(3);
   1.987 +            this.tabPageEvent.Size = new System.Drawing.Size(752, 385);
   1.988 +            this.tabPageEvent.TabIndex = 9;
   1.989 +            this.tabPageEvent.Text = "Events";
   1.990 +            this.tabPageEvent.UseVisualStyleBackColor = true;
   1.991 +            // 
   1.992 +            // buttonActionMoveUp
   1.993 +            // 
   1.994 +            this.buttonActionMoveUp.Enabled = false;
   1.995 +            this.buttonActionMoveUp.Location = new System.Drawing.Point(6, 327);
   1.996 +            this.buttonActionMoveUp.Name = "buttonActionMoveUp";
   1.997 +            this.buttonActionMoveUp.Size = new System.Drawing.Size(96, 23);
   1.998 +            this.buttonActionMoveUp.TabIndex = 24;
   1.999 +            this.buttonActionMoveUp.Text = "Move Up";
  1.1000 +            this.buttonActionMoveUp.UseVisualStyleBackColor = true;
  1.1001 +            this.buttonActionMoveUp.Click += new System.EventHandler(this.buttonActionMoveUp_Click);
  1.1002 +            // 
  1.1003 +            // buttonActionMoveDown
  1.1004 +            // 
  1.1005 +            this.buttonActionMoveDown.Enabled = false;
  1.1006 +            this.buttonActionMoveDown.Location = new System.Drawing.Point(6, 356);
  1.1007 +            this.buttonActionMoveDown.Name = "buttonActionMoveDown";
  1.1008 +            this.buttonActionMoveDown.Size = new System.Drawing.Size(96, 23);
  1.1009 +            this.buttonActionMoveDown.TabIndex = 23;
  1.1010 +            this.buttonActionMoveDown.Text = "Move Down";
  1.1011 +            this.buttonActionMoveDown.UseVisualStyleBackColor = true;
  1.1012 +            this.buttonActionMoveDown.Click += new System.EventHandler(this.buttonActionMoveDown_Click);
  1.1013 +            // 
  1.1014 +            // buttonTestAction
  1.1015 +            // 
  1.1016 +            this.buttonTestAction.Enabled = false;
  1.1017 +            this.buttonTestAction.Location = new System.Drawing.Point(6, 64);
  1.1018 +            this.buttonTestAction.Name = "buttonTestAction";
  1.1019 +            this.buttonTestAction.Size = new System.Drawing.Size(96, 23);
  1.1020 +            this.buttonTestAction.TabIndex = 22;
  1.1021 +            this.buttonTestAction.Text = "Test Action";
  1.1022 +            this.buttonTestAction.UseVisualStyleBackColor = true;
  1.1023 +            this.buttonTestAction.Click += new System.EventHandler(this.buttonTestAction_Click);
  1.1024 +            // 
  1.1025 +            // buttonDeleteAction
  1.1026 +            // 
  1.1027 +            this.buttonDeleteAction.Enabled = false;
  1.1028 +            this.buttonDeleteAction.Location = new System.Drawing.Point(6, 35);
  1.1029 +            this.buttonDeleteAction.Name = "buttonDeleteAction";
  1.1030 +            this.buttonDeleteAction.Size = new System.Drawing.Size(96, 23);
  1.1031 +            this.buttonDeleteAction.TabIndex = 21;
  1.1032 +            this.buttonDeleteAction.Text = "Delete Action";
  1.1033 +            this.buttonDeleteAction.UseVisualStyleBackColor = true;
  1.1034 +            this.buttonDeleteAction.Click += new System.EventHandler(this.buttonDeleteAction_Click);
  1.1035 +            // 
  1.1036 +            // buttonAddAction
  1.1037 +            // 
  1.1038 +            this.buttonAddAction.Enabled = false;
  1.1039 +            this.buttonAddAction.Location = new System.Drawing.Point(6, 6);
  1.1040 +            this.buttonAddAction.Name = "buttonAddAction";
  1.1041 +            this.buttonAddAction.Size = new System.Drawing.Size(96, 23);
  1.1042 +            this.buttonAddAction.TabIndex = 20;
  1.1043 +            this.buttonAddAction.Text = "Add Action";
  1.1044 +            this.buttonAddAction.UseVisualStyleBackColor = true;
  1.1045 +            this.buttonAddAction.Click += new System.EventHandler(this.buttonAddAction_Click);
  1.1046 +            // 
  1.1047 +            // iTreeViewEvents
  1.1048 +            // 
  1.1049 +            this.iTreeViewEvents.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1.1050 +            | System.Windows.Forms.AnchorStyles.Left) 
  1.1051 +            | System.Windows.Forms.AnchorStyles.Right)));
  1.1052 +            this.iTreeViewEvents.HideSelection = false;
  1.1053 +            this.iTreeViewEvents.Location = new System.Drawing.Point(111, 3);
  1.1054 +            this.iTreeViewEvents.Name = "iTreeViewEvents";
  1.1055 +            this.iTreeViewEvents.Size = new System.Drawing.Size(638, 376);
  1.1056 +            this.iTreeViewEvents.TabIndex = 1;
  1.1057 +            this.iTreeViewEvents.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.iTreeViewEvents_AfterSelect);
  1.1058 +            // 
  1.1059 +            // tabPageApp
  1.1060 +            // 
  1.1061 +            this.tabPageApp.Controls.Add(this.checkBoxStartMinimized);
  1.1062 +            this.tabPageApp.Controls.Add(this.checkBoxMinimizeToTray);
  1.1063 +            this.tabPageApp.Controls.Add(this.checkBoxAutoStart);
  1.1064 +            this.tabPageApp.Controls.Add(this.buttonUpdate);
  1.1065 +            this.tabPageApp.Location = new System.Drawing.Point(4, 22);
  1.1066 +            this.tabPageApp.Name = "tabPageApp";
  1.1067 +            this.tabPageApp.Padding = new System.Windows.Forms.Padding(3);
  1.1068 +            this.tabPageApp.Size = new System.Drawing.Size(752, 385);
  1.1069 +            this.tabPageApp.TabIndex = 4;
  1.1070 +            this.tabPageApp.Text = "Application";
  1.1071 +            this.tabPageApp.UseVisualStyleBackColor = true;
  1.1072 +            // 
  1.1073 +            // checkBoxStartMinimized
  1.1074 +            // 
  1.1075 +            this.checkBoxStartMinimized.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1.1076 +            this.checkBoxStartMinimized.AutoSize = true;
  1.1077 +            this.checkBoxStartMinimized.Location = new System.Drawing.Point(6, 285);
  1.1078 +            this.checkBoxStartMinimized.Name = "checkBoxStartMinimized";
  1.1079 +            this.checkBoxStartMinimized.Size = new System.Drawing.Size(96, 17);
  1.1080 +            this.checkBoxStartMinimized.TabIndex = 16;
  1.1081 +            this.checkBoxStartMinimized.Text = "Start minimized";
  1.1082 +            this.checkBoxStartMinimized.UseVisualStyleBackColor = true;
  1.1083 +            this.checkBoxStartMinimized.CheckedChanged += new System.EventHandler(this.checkBoxStartMinimized_CheckedChanged);
  1.1084 +            // 
  1.1085 +            // checkBoxMinimizeToTray
  1.1086 +            // 
  1.1087 +            this.checkBoxMinimizeToTray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1.1088 +            this.checkBoxMinimizeToTray.AutoSize = true;
  1.1089 +            this.checkBoxMinimizeToTray.Location = new System.Drawing.Point(6, 308);
  1.1090 +            this.checkBoxMinimizeToTray.Name = "checkBoxMinimizeToTray";
  1.1091 +            this.checkBoxMinimizeToTray.Size = new System.Drawing.Size(133, 17);
  1.1092 +            this.checkBoxMinimizeToTray.TabIndex = 15;
  1.1093 +            this.checkBoxMinimizeToTray.Text = "Minimize to system tray";
  1.1094 +            this.checkBoxMinimizeToTray.UseVisualStyleBackColor = true;
  1.1095 +            this.checkBoxMinimizeToTray.CheckedChanged += new System.EventHandler(this.checkBoxMinimizeToTray_CheckedChanged);
  1.1096 +            // 
  1.1097 +            // checkBoxAutoStart
  1.1098 +            // 
  1.1099 +            this.checkBoxAutoStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1.1100 +            this.checkBoxAutoStart.AutoSize = true;
  1.1101 +            this.checkBoxAutoStart.Location = new System.Drawing.Point(6, 331);
  1.1102 +            this.checkBoxAutoStart.Name = "checkBoxAutoStart";
  1.1103 +            this.checkBoxAutoStart.Size = new System.Drawing.Size(143, 17);
  1.1104 +            this.checkBoxAutoStart.TabIndex = 14;
  1.1105 +            this.checkBoxAutoStart.Text = "Run on Windows startup";
  1.1106 +            this.checkBoxAutoStart.UseVisualStyleBackColor = true;
  1.1107 +            this.checkBoxAutoStart.CheckedChanged += new System.EventHandler(this.checkBoxAutoStart_CheckedChanged);
  1.1108 +            // 
  1.1109 +            // buttonUpdate
  1.1110 +            // 
  1.1111 +            this.buttonUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1.1112 +            this.buttonUpdate.Location = new System.Drawing.Point(6, 354);
  1.1113 +            this.buttonUpdate.Name = "buttonUpdate";
  1.1114 +            this.buttonUpdate.Size = new System.Drawing.Size(75, 23);
  1.1115 +            this.buttonUpdate.TabIndex = 0;
  1.1116 +            this.buttonUpdate.Text = "Update";
  1.1117 +            this.buttonUpdate.UseVisualStyleBackColor = true;
  1.1118 +            this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click);
  1.1119 +            // 
  1.1120 +            // tabPageLogs
  1.1121 +            // 
  1.1122 +            this.tabPageLogs.Controls.Add(this.buttonClearLogs);
  1.1123 +            this.tabPageLogs.Controls.Add(this.richTextBoxLogs);
  1.1124 +            this.tabPageLogs.Location = new System.Drawing.Point(4, 22);
  1.1125 +            this.tabPageLogs.Name = "tabPageLogs";
  1.1126 +            this.tabPageLogs.Padding = new System.Windows.Forms.Padding(3);
  1.1127 +            this.tabPageLogs.Size = new System.Drawing.Size(752, 385);
  1.1128 +            this.tabPageLogs.TabIndex = 8;
  1.1129 +            this.tabPageLogs.Text = "Logs";
  1.1130 +            this.tabPageLogs.UseVisualStyleBackColor = true;
  1.1131 +            // 
  1.1132 +            // buttonClearLogs
  1.1133 +            // 
  1.1134 +            this.buttonClearLogs.Location = new System.Drawing.Point(671, 6);
  1.1135 +            this.buttonClearLogs.Name = "buttonClearLogs";
  1.1136 +            this.buttonClearLogs.Size = new System.Drawing.Size(75, 23);
  1.1137 +            this.buttonClearLogs.TabIndex = 2;
  1.1138 +            this.buttonClearLogs.Text = "Clear";
  1.1139 +            this.buttonClearLogs.UseVisualStyleBackColor = true;
  1.1140 +            this.buttonClearLogs.Click += new System.EventHandler(this.buttonClearLogs_Click);
  1.1141 +            // 
  1.1142 +            // richTextBoxLogs
  1.1143 +            // 
  1.1144 +            this.richTextBoxLogs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1.1145 +            | System.Windows.Forms.AnchorStyles.Left) 
  1.1146 +            | System.Windows.Forms.AnchorStyles.Right)));
  1.1147 +            this.richTextBoxLogs.BorderStyle = System.Windows.Forms.BorderStyle.None;
  1.1148 +            this.richTextBoxLogs.DetectUrls = false;
  1.1149 +            this.richTextBoxLogs.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  1.1150 +            this.richTextBoxLogs.Location = new System.Drawing.Point(6, 6);
  1.1151 +            this.richTextBoxLogs.Name = "richTextBoxLogs";
  1.1152 +            this.richTextBoxLogs.ReadOnly = true;
  1.1153 +            this.richTextBoxLogs.Size = new System.Drawing.Size(740, 373);
  1.1154 +            this.richTextBoxLogs.TabIndex = 1;
  1.1155 +            this.richTextBoxLogs.Text = "";
  1.1156 +            this.richTextBoxLogs.WordWrap = false;
  1.1157 +            // 
  1.1158 +            // labelFontWidth
  1.1159 +            // 
  1.1160 +            this.labelFontWidth.AutoSize = true;
  1.1161 +            this.labelFontWidth.Location = new System.Drawing.Point(13, 29);
  1.1162 +            this.labelFontWidth.Name = "labelFontWidth";
  1.1163 +            this.labelFontWidth.Size = new System.Drawing.Size(56, 13);
  1.1164 +            this.labelFontWidth.TabIndex = 19;
  1.1165 +            this.labelFontWidth.Text = "Font width";
  1.1166 +            // 
  1.1167 +            // labelFontHeight
  1.1168 +            // 
  1.1169 +            this.labelFontHeight.AutoSize = true;
  1.1170 +            this.labelFontHeight.Location = new System.Drawing.Point(13, 46);
  1.1171 +            this.labelFontHeight.Name = "labelFontHeight";
  1.1172 +            this.labelFontHeight.Size = new System.Drawing.Size(60, 13);
  1.1173 +            this.labelFontHeight.TabIndex = 20;
  1.1174 +            this.labelFontHeight.Text = "Font height";
  1.1175 +            // 
  1.1176 +            // openFileDialog
  1.1177 +            // 
  1.1178 +            this.openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
  1.1179 +            // 
  1.1180 +            // FormMain
  1.1181 +            // 
  1.1182 +            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  1.1183 +            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  1.1184 +            this.ClientSize = new System.Drawing.Size(784, 561);
  1.1185 +            this.Controls.Add(this.labelFontHeight);
  1.1186 +            this.Controls.Add(this.labelFontWidth);
  1.1187 +            this.Controls.Add(this.labelWarning);
  1.1188 +            this.Controls.Add(this.statusStrip);
  1.1189 +            this.Controls.Add(this.tabControl);
  1.1190 +            this.Controls.Add(this.panelDisplay);
  1.1191 +            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  1.1192 +            this.MinimumSize = new System.Drawing.Size(800, 600);
  1.1193 +            this.Name = "FormMain";
  1.1194 +            this.Text = "Sharp Display Manager";
  1.1195 +            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
  1.1196 +            this.Load += new System.EventHandler(this.MainForm_Load);
  1.1197 +            this.SizeChanged += new System.EventHandler(this.MainForm_SizeChanged);
  1.1198 +            this.Resize += new System.EventHandler(this.MainForm_Resize);
  1.1199 +            this.panelDisplay.ResumeLayout(false);
  1.1200 +            this.iTableLayoutPanel.ResumeLayout(false);
  1.1201 +            this.iTableLayoutPanel.PerformLayout();
  1.1202 +            this.statusStrip.ResumeLayout(false);
  1.1203 +            this.statusStrip.PerformLayout();
  1.1204 +            this.tabPageClients.ResumeLayout(false);
  1.1205 +            this.tabPageClients.PerformLayout();
  1.1206 +            this.tabPageDisplay.ResumeLayout(false);
  1.1207 +            this.tabPageDisplay.PerformLayout();
  1.1208 +            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).EndInit();
  1.1209 +            this.tabControl.ResumeLayout(false);
  1.1210 +            this.tabPageDesign.ResumeLayout(false);
  1.1211 +            this.tabPageDesign.PerformLayout();
  1.1212 +            this.tabPageAudio.ResumeLayout(false);
  1.1213 +            this.tabPageAudio.PerformLayout();
  1.1214 +            ((System.ComponentModel.ISupportInitialize)(this.trackBarMasterVolume)).EndInit();
  1.1215 +            this.tabPageInput.ResumeLayout(false);
  1.1216 +            this.tabPageInput.PerformLayout();
  1.1217 +            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxGreenStart)).EndInit();
  1.1218 +            this.tabPageCec.ResumeLayout(false);
  1.1219 +            this.tabPageCec.PerformLayout();
  1.1220 +            this.groupBoxCecLogOptions.ResumeLayout(false);
  1.1221 +            this.groupBoxCecLogOptions.PerformLayout();
  1.1222 +            this.tabPageEvent.ResumeLayout(false);
  1.1223 +            this.tabPageApp.ResumeLayout(false);
  1.1224 +            this.tabPageApp.PerformLayout();
  1.1225 +            this.tabPageLogs.ResumeLayout(false);
  1.1226 +            this.ResumeLayout(false);
  1.1227 +            this.PerformLayout();
  1.1228 +
  1.1229 +        }
  1.1230 +
  1.1231 +        #endregion
  1.1232 +
  1.1233 +        private System.Windows.Forms.FontDialog fontDialog;
  1.1234 +        private System.Windows.Forms.Timer timer;
  1.1235 +        private System.Windows.Forms.StatusStrip statusStrip;
  1.1236 +        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelConnect;
  1.1237 +        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelFps;
  1.1238 +        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSpring;
  1.1239 +        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelPower;
  1.1240 +        private System.Windows.Forms.Panel panelDisplay;
  1.1241 +        private System.Windows.Forms.TableLayoutPanel iTableLayoutPanel;
  1.1242 +        private MarqueeLabel marqueeLabelTop;
  1.1243 +        private MarqueeLabel marqueeLabelBottom;
  1.1244 +        private System.Windows.Forms.TabPage tabPageClients;
  1.1245 +        private System.Windows.Forms.TreeView iTreeViewClients;
  1.1246 +        private System.Windows.Forms.TabPage tabPageDisplay;
  1.1247 +        private System.Windows.Forms.CheckBox checkBoxFixedPitchFontOnly;
  1.1248 +        private System.Windows.Forms.Button buttonSuspend;
  1.1249 +        private System.Windows.Forms.CheckBox checkBoxConnectOnStartup;
  1.1250 +        private System.Windows.Forms.CheckBox checkBoxShowBorders;
  1.1251 +        private System.Windows.Forms.TrackBar trackBarBrightness;
  1.1252 +        private System.Windows.Forms.Button buttonFill;
  1.1253 +        private System.Windows.Forms.Button buttonClear;
  1.1254 +        private System.Windows.Forms.Button buttonClose;
  1.1255 +        private System.Windows.Forms.Button buttonOpen;
  1.1256 +        private System.Windows.Forms.Button buttonCapture;
  1.1257 +        private System.Windows.Forms.Button buttonFont;
  1.1258 +        private System.Windows.Forms.TabControl tabControl;
  1.1259 +        private System.Windows.Forms.Button buttonCloseClients;
  1.1260 +        private System.Windows.Forms.Button buttonStartClient;
  1.1261 +        private System.Windows.Forms.Label labelWarning;
  1.1262 +		private System.Windows.Forms.TabPage tabPageDesign;
  1.1263 +		private System.Windows.Forms.CheckBox checkBoxReverseScreen;
  1.1264 +        private System.Windows.Forms.ComboBox comboBoxDisplayType;
  1.1265 +        private System.Windows.Forms.MaskedTextBox maskedTextBoxTimerInterval;
  1.1266 +        private System.Windows.Forms.Label labelTimerInterval;
  1.1267 +        private System.Windows.Forms.Button buttonPowerOff;
  1.1268 +        private System.Windows.Forms.Button buttonPowerOn;
  1.1269 +        private System.Windows.Forms.Button buttonShowClock;
  1.1270 +        private System.Windows.Forms.Button buttonHideClock;
  1.1271 +        private System.Windows.Forms.Label labelFontWidth;
  1.1272 +        private System.Windows.Forms.Label labelFontHeight;
  1.1273 +        private System.Windows.Forms.CheckBox checkBoxInverseColors;
  1.1274 +        private System.Windows.Forms.TabPage tabPageApp;
  1.1275 +        private System.Windows.Forms.Button buttonUpdate;
  1.1276 +		private System.Windows.Forms.CheckBox checkBoxAutoStart;
  1.1277 +		private System.Windows.Forms.CheckBox checkBoxStartMinimized;
  1.1278 +		private System.Windows.Forms.CheckBox checkBoxMinimizeToTray;
  1.1279 +        private System.Windows.Forms.MaskedTextBox maskedTextBoxMinFontSize;
  1.1280 +        private System.Windows.Forms.CheckBox checkBoxScaleToFit;
  1.1281 +        private System.Windows.Forms.Label labelMinFontSize;
  1.1282 +        private System.Windows.Forms.Label labelScrollLoopSeparator;
  1.1283 +        private System.Windows.Forms.TextBox textBoxScrollLoopSeparator;
  1.1284 +		private System.Windows.Forms.Label labelScrollingSpeed;
  1.1285 +		private System.Windows.Forms.MaskedTextBox maskedTextBoxScrollingSpeed;
  1.1286 +		private System.Windows.Forms.ToolTip toolTip;
  1.1287 +		private System.Windows.Forms.TabPage tabPageAudio;
  1.1288 +		private System.Windows.Forms.TrackBar trackBarMasterVolume;
  1.1289 +		private System.Windows.Forms.CheckBox checkBoxMute;
  1.1290 +		private System.Windows.Forms.CheckBox checkBoxShowVolumeLabel;
  1.1291 +		private System.Windows.Forms.Label labelDefaultAudioDevice;
  1.1292 +		private System.Windows.Forms.TabPage tabPageInput;
  1.1293 +		private System.Windows.Forms.Button buttonSelectFile;
  1.1294 +		private System.Windows.Forms.OpenFileDialog openFileDialog;
  1.1295 +		private System.Windows.Forms.Label labelStartFileName;
  1.1296 +		private System.Windows.Forms.PictureBox pictureBoxGreenStart;
  1.1297 +        private System.Windows.Forms.ComboBox comboBoxOpticalDrives;
  1.1298 +        private System.Windows.Forms.Label labelOpticalDriveEject;
  1.1299 +        private System.Windows.Forms.TabPage tabPageCec;
  1.1300 +        private System.Windows.Forms.CheckBox checkBoxCecEnabled;
  1.1301 +        private System.Windows.Forms.Label labelHdmiPort;
  1.1302 +        private System.Windows.Forms.ComboBox comboBoxHdmiPort;
  1.1303 +        private System.Windows.Forms.Button iButtonStartIdleClient;
  1.1304 +        private System.Windows.Forms.CheckBox iCheckBoxStartIdleClient;
  1.1305 +        private System.Windows.Forms.TabPage tabPageLogs;
  1.1306 +        private System.Windows.Forms.RichTextBox richTextBoxLogs;
  1.1307 +        private System.Windows.Forms.Button buttonClearLogs;
  1.1308 +        private System.Windows.Forms.GroupBox groupBoxCecLogOptions;
  1.1309 +        private System.Windows.Forms.CheckBox checkBoxCecLogWarning;
  1.1310 +        private System.Windows.Forms.CheckBox checkBoxCecLogError;
  1.1311 +        private System.Windows.Forms.CheckBox checkBoxCecLogDebug;
  1.1312 +        private System.Windows.Forms.CheckBox checkBoxCecLogNotice;
  1.1313 +        private System.Windows.Forms.CheckBox checkBoxCecLogTraffic;
  1.1314 +        private System.Windows.Forms.CheckBox checkBoxCecLogNoPoll;
  1.1315 +        private System.Windows.Forms.TabPage tabPageEvent;
  1.1316 +        private System.Windows.Forms.TreeView iTreeViewEvents;
  1.1317 +        private System.Windows.Forms.Button buttonDeleteAction;
  1.1318 +        private System.Windows.Forms.Button buttonAddAction;
  1.1319 +        private System.Windows.Forms.Button buttonActionMoveUp;
  1.1320 +        private System.Windows.Forms.Button buttonActionMoveDown;
  1.1321 +        private System.Windows.Forms.Button buttonTestAction;
  1.1322 +    }
  1.1323 +}
  1.1324 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Server/FormMain.Hid.cs	Fri Jul 29 10:40:15 2016 +0200
     2.3 @@ -0,0 +1,425 @@
     2.4 +using System;
     2.5 +using System.IO;
     2.6 +using System.Collections.Generic;
     2.7 +using System.Linq;
     2.8 +using System.Text;
     2.9 +using System.Threading.Tasks;
    2.10 +using System.Diagnostics;
    2.11 +using System.Runtime.InteropServices;
    2.12 +using System.Windows.Forms;
    2.13 +using Microsoft.Win32.SafeHandles;
    2.14 +using System.ComponentModel;
    2.15 +//
    2.16 +using Hid = SharpLib.Hid;
    2.17 +using SharpLib.Win32;
    2.18 +
    2.19 +namespace SharpDisplayManager
    2.20 +{
    2.21 +    /// <summary>
    2.22 +    /// Implement handling of HID input reports notably to be able to launch an application using the Green Start button from IR remotes.
    2.23 +    /// </summary>
    2.24 +    [System.ComponentModel.DesignerCategory("Code")]
    2.25 +    public class FormMainHid : Form
    2.26 +    {
    2.27 +        [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SwitchToThisWindow")]
    2.28 +        public static extern void SwitchToThisWindow([System.Runtime.InteropServices.InAttribute()] System.IntPtr hwnd, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] bool fUnknown);
    2.29 +        //
    2.30 +        public delegate void OnHidEventDelegate(object aSender, Hid.Event aHidEvent);
    2.31 +
    2.32 +        /// <summary>
    2.33 +        /// Use notably to handle green start key from IR remote control
    2.34 +        /// </summary>
    2.35 +        private Hid.Handler iHidHandler;
    2.36 +
    2.37 +        /// <summary>
    2.38 +        /// Register HID devices so that we receive corresponding WM_INPUT messages.
    2.39 +        /// </summary>
    2.40 +        protected void RegisterHidDevices()
    2.41 +        {
    2.42 +            // Register the input device to receive the commands from the
    2.43 +            // remote device. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/remote_control.asp
    2.44 +            // for the vendor defined usage page.
    2.45 +
    2.46 +            RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[5];
    2.47 +
    2.48 +            int i = 0;
    2.49 +            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.WindowsMediaCenterRemoteControl;
    2.50 +            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl;
    2.51 +            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    2.52 +            rid[i].hwndTarget = Handle;
    2.53 +
    2.54 +            i++;
    2.55 +            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer;
    2.56 +            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.ConsumerControl;
    2.57 +            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    2.58 +            rid[i].hwndTarget = Handle;
    2.59 +
    2.60 +            i++;
    2.61 +            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer;
    2.62 +            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.Selection;
    2.63 +            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    2.64 +            rid[i].hwndTarget = Handle;
    2.65 +
    2.66 +            i++;
    2.67 +            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    2.68 +            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.SystemControl;
    2.69 +            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    2.70 +            rid[i].hwndTarget = Handle;
    2.71 +
    2.72 +            i++;
    2.73 +            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    2.74 +            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.GamePad;
    2.75 +            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    2.76 +            rid[i].hwndTarget = Handle;
    2.77 +
    2.78 +            //i++;
    2.79 +            //rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    2.80 +            //rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.Keyboard;
    2.81 +            //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.82 +            //rid[i].hwndTarget = Handle;
    2.83 +
    2.84 +            //i++;
    2.85 +            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControls;
    2.86 +            //rid[i].usUsage = (ushort)Hid.UsageCollection.GenericDesktop.Mouse;
    2.87 +            //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    2.88 +            //rid[i].hwndTarget = aHWND;
    2.89 +
    2.90 +
    2.91 +            iHidHandler = new SharpLib.Hid.Handler(rid);
    2.92 +            if (!iHidHandler.IsRegistered)
    2.93 +            {
    2.94 +                Debug.WriteLine("Failed to register raw input devices: " + Marshal.GetLastWin32Error().ToString());
    2.95 +            }
    2.96 +            iHidHandler.OnHidEvent += HandleHidEventThreadSafe;
    2.97 +
    2.98 +        }
    2.99 +
   2.100 +
   2.101 +
   2.102 +
   2.103 +        /// <summary>
   2.104 +        /// Here we receive HID events from our HID library.
   2.105 +        /// </summary>
   2.106 +        /// <param name="aSender"></param>
   2.107 +        /// <param name="aHidEvent"></param>
   2.108 +        public void HandleHidEventThreadSafe(object aSender, SharpLib.Hid.Event aHidEvent)
   2.109 +        {
   2.110 +            if (aHidEvent.IsStray)
   2.111 +            {
   2.112 +                //Stray event just ignore it
   2.113 +                return;
   2.114 +            }
   2.115 +
   2.116 +            if (this.InvokeRequired)
   2.117 +            {
   2.118 +                //Not in the proper thread, invoke ourselves
   2.119 +                OnHidEventDelegate d = new OnHidEventDelegate(HandleHidEventThreadSafe);
   2.120 +                this.Invoke(d, new object[] { aSender, aHidEvent });
   2.121 +            }
   2.122 +            else
   2.123 +            {
   2.124 +                if (aHidEvent.Usages.Count == 0)
   2.125 +                {
   2.126 +                    //No usage, nothing to do then
   2.127 +                    return;
   2.128 +                }
   2.129 +
   2.130 +                //We are in the proper thread
   2.131 +                if (aHidEvent.UsagePage == (ushort) Hid.UsagePage.WindowsMediaCenterRemoteControl)
   2.132 +                {
   2.133 +                    switch (aHidEvent.Usages[0])
   2.134 +                    {
   2.135 +                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.GreenStart:
   2.136 +                            HandleGreenStart();
   2.137 +                            break;
   2.138 +                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.Eject:
   2.139 +                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.Ext2:
   2.140 +                            HandleEject();
   2.141 +                            break;
   2.142 +                    }
   2.143 +                }
   2.144 +
   2.145 +                //Keep this for debug when only ThinkPad keyboard is available
   2.146 +                if (aHidEvent.UsagePage == (ushort)Hid.UsagePage.Consumer && aHidEvent.Usages[0] == (ushort)Hid.Usage.ConsumerControl.ThinkPadFullscreenMagnifier)
   2.147 +                {
   2.148 +                    HandleEject();
   2.149 +                }
   2.150 +
   2.151 +            }
   2.152 +        }
   2.153 +
   2.154 +        /// <summary>
   2.155 +        /// 
   2.156 +        /// </summary>
   2.157 +        /// <param name="aPrefix"></param>
   2.158 +        private void CheckLastError(string aPrefix)
   2.159 +        {
   2.160 +            string errorMessage = new Win32Exception(Marshal.GetLastWin32Error()).Message;
   2.161 +            Debug.WriteLine(aPrefix + Marshal.GetLastWin32Error().ToString() + ": " + errorMessage);
   2.162 +        }
   2.163 +
   2.164 +        /// <summary>
   2.165 +        /// 
   2.166 +        /// </summary>
   2.167 +        /// <param name="data"></param>
   2.168 +        /// <returns></returns>
   2.169 +        private IntPtr MarshalToPointer(object data)
   2.170 +        {
   2.171 +            IntPtr buf = Marshal.AllocHGlobal(
   2.172 +                Marshal.SizeOf(data));
   2.173 +            Marshal.StructureToPtr(data,
   2.174 +                buf, false);
   2.175 +            return buf;
   2.176 +        }
   2.177 +
   2.178 +        /// <summary>
   2.179 +        /// 
   2.180 +        /// </summary>
   2.181 +        /// <returns></returns>
   2.182 +        private SafeFileHandle OpenVolume(string aDriveName)
   2.183 +        {
   2.184 +            return Function.CreateFile("\\\\.\\" + aDriveName,
   2.185 +                               SharpLib.Win32.FileAccess.GENERIC_READ,
   2.186 +                               SharpLib.Win32.FileShare.FILE_SHARE_READ | SharpLib.Win32.FileShare.FILE_SHARE_WRITE,
   2.187 +                               IntPtr.Zero,
   2.188 +                               CreationDisposition.OPEN_EXISTING,
   2.189 +                               0,
   2.190 +                               IntPtr.Zero);
   2.191 +        }
   2.192 +
   2.193 +        /// <summary>
   2.194 +        /// 
   2.195 +        /// </summary>
   2.196 +        /// <param name="aVolume"></param>
   2.197 +        /// <returns></returns>
   2.198 +        private bool LockVolume(SafeFileHandle aVolume)
   2.199 +        {
   2.200 +            //Hope that's doing what I think it does
   2.201 +            IntPtr dwBytesReturned=new IntPtr();
   2.202 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.203 +            OVERLAPPED overlapped=new OVERLAPPED();
   2.204 +
   2.205 +            int tries = 0;
   2.206 +            const int KMaxTries = 100;
   2.207 +            const int KSleepTime = 10;
   2.208 +            bool success = false;
   2.209 +
   2.210 +            while (!success && tries < KMaxTries)
   2.211 +            {
   2.212 +                success = Function.DeviceIoControl(aVolume, Const.FSCTL_LOCK_VOLUME, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.213 +                System.Threading.Thread.Sleep(KSleepTime);
   2.214 +                tries++;
   2.215 +            }
   2.216 +
   2.217 +            CheckLastError("Lock volume: ");
   2.218 +
   2.219 +            return success;
   2.220 +        }
   2.221 +
   2.222 +        /// <summary>
   2.223 +        /// 
   2.224 +        /// </summary>
   2.225 +        /// <param name="aVolume"></param>
   2.226 +        /// <returns></returns>
   2.227 +        private bool DismountVolume(SafeFileHandle aVolume)
   2.228 +        {
   2.229 +            //Hope that's doing what I think it does
   2.230 +            IntPtr dwBytesReturned = new IntPtr();
   2.231 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.232 +            OVERLAPPED overlapped=new OVERLAPPED();
   2.233 +
   2.234 +            bool res = Function.DeviceIoControl(aVolume, Const.FSCTL_DISMOUNT_VOLUME, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.235 +            CheckLastError("Dismount volume: ");
   2.236 +            return res;
   2.237 +        }
   2.238 +
   2.239 +
   2.240 +
   2.241 +        /// <summary>
   2.242 +        /// 
   2.243 +        /// </summary>
   2.244 +        /// <param name="aVolume"></param>
   2.245 +        /// <param name="aPreventRemoval"></param>
   2.246 +        /// <returns></returns>
   2.247 +        private bool PreventRemovalOfVolume(SafeFileHandle aVolume, bool aPreventRemoval)
   2.248 +        {
   2.249 +            //Hope that's doing what I think it does
   2.250 +            IntPtr dwBytesReturned = new IntPtr();
   2.251 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.252 +            OVERLAPPED overlapped = new OVERLAPPED();
   2.253 +            //
   2.254 +            PREVENT_MEDIA_REMOVAL preventMediaRemoval = new PREVENT_MEDIA_REMOVAL();
   2.255 +            preventMediaRemoval.PreventMediaRemoval = Convert.ToByte(aPreventRemoval);
   2.256 +            IntPtr preventMediaRemovalParam = MarshalToPointer(preventMediaRemoval);
   2.257 +
   2.258 +            bool result = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_MEDIA_REMOVAL, preventMediaRemovalParam, Convert.ToUInt32(Marshal.SizeOf(preventMediaRemoval)), IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.259 +            CheckLastError("Media removal: ");
   2.260 +            Marshal.FreeHGlobal(preventMediaRemovalParam);
   2.261 +
   2.262 +            return result;
   2.263 +        }
   2.264 +
   2.265 +        /// <summary>
   2.266 +        /// Eject optical drive media opening the tray if any.
   2.267 +        /// </summary>
   2.268 +        /// <param name="aVolume"></param>
   2.269 +        /// <returns></returns>
   2.270 +        private bool MediaEject(SafeFileHandle aVolume)
   2.271 +        {
   2.272 +            //Hope that's doing what I think it does
   2.273 +            IntPtr dwBytesReturned = new IntPtr();
   2.274 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.275 +            OVERLAPPED overlapped=new OVERLAPPED();
   2.276 +
   2.277 +            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_EJECT_MEDIA, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.278 +            CheckLastError("Media eject: ");
   2.279 +            return res;
   2.280 +        }
   2.281 +
   2.282 +        /// <summary>
   2.283 +        /// Close an optical drive tray.
   2.284 +        /// </summary>
   2.285 +        /// <param name="aVolume"></param>
   2.286 +        /// <returns></returns>
   2.287 +        private bool MediaLoad(SafeFileHandle aVolume)
   2.288 +        {
   2.289 +            //Hope that's doing what I think it does
   2.290 +            IntPtr dwBytesReturned = new IntPtr();
   2.291 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.292 +            OVERLAPPED overlapped=new OVERLAPPED();
   2.293 +
   2.294 +            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_LOAD_MEDIA, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.295 +            CheckLastError("Media load: ");
   2.296 +            return res;
   2.297 +        }
   2.298 +
   2.299 +        /// <summary>
   2.300 +        /// 
   2.301 +        /// </summary>
   2.302 +        /// <param name="aVolume"></param>
   2.303 +        /// <returns></returns>
   2.304 +        private bool StorageCheckVerify(SafeFileHandle aVolume)
   2.305 +        {
   2.306 +            //Hope that's doing what I think it does
   2.307 +            IntPtr dwBytesReturned = new IntPtr();
   2.308 +            //Should not be needed but I'm not sure how to pass NULL in there.
   2.309 +            OVERLAPPED overlapped = new OVERLAPPED();
   2.310 +
   2.311 +            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_CHECK_VERIFY2, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   2.312 +
   2.313 +            CheckLastError("Check verify: ");
   2.314 +
   2.315 +            return res;
   2.316 +        }        
   2.317 +        
   2.318 +
   2.319 +
   2.320 +        /// <summary>
   2.321 +        /// Perform media ejection.
   2.322 +        /// </summary>
   2.323 +        private void HandleEject()
   2.324 +        {
   2.325 +            string drive = ((FormMain)this).OpticalDriveToEject();
   2.326 +            if (drive.Length!=2)
   2.327 +            {
   2.328 +                //Not a proper drive spec.
   2.329 +                //Probably 'None' selected.
   2.330 +                return;
   2.331 +            }
   2.332 +
   2.333 +            SafeFileHandle handle = OpenVolume(drive);
   2.334 +            if (handle.IsInvalid)
   2.335 +            {
   2.336 +                CheckLastError("ERROR: Failed to open volume: ");
   2.337 +                return;
   2.338 +            }
   2.339 +
   2.340 +            if (LockVolume(handle) && DismountVolume(handle))
   2.341 +            {
   2.342 +                Debug.WriteLine("Volume was dismounted.");
   2.343 +
   2.344 +                if (PreventRemovalOfVolume(handle,false))
   2.345 +                {
   2.346 +                    //StorageCheckVerify(handle);
   2.347 +
   2.348 +                    DateTime before;
   2.349 +                    before = DateTime.Now;
   2.350 +                    bool ejectSuccess = MediaEject(handle);
   2.351 +                    double ms = (DateTime.Now - before).TotalMilliseconds;
   2.352 +
   2.353 +                    //We assume that if it take more than a certain time to for eject to execute it means we actually ejected.
   2.354 +                    //If our eject completes too rapidly we assume the tray is already open and we will try to close it. 
   2.355 +                    if (ejectSuccess && ms > 100)
   2.356 +                    {
   2.357 +                        Debug.WriteLine("Media was ejected");
   2.358 +                    }
   2.359 +                    else if (MediaLoad(handle))
   2.360 +                    {
   2.361 +                        Debug.WriteLine("Media was loaded");
   2.362 +                    }                    
   2.363 +                }
   2.364 +            }
   2.365 +            else
   2.366 +            {
   2.367 +                Debug.WriteLine("Volume lock or dismount failed.");
   2.368 +            }
   2.369 +
   2.370 +            //This is needed to make sure we can open the volume next time around
   2.371 +            handle.Dispose();
   2.372 +        }
   2.373 +
   2.374 +        /// <summary>
   2.375 +        /// 
   2.376 +        /// </summary>
   2.377 +        private void HandleGreenStart()
   2.378 +        {
   2.379 +            //First check if the process we want to launch already exists
   2.380 +            string procName = Path.GetFileNameWithoutExtension(Properties.Settings.Default.StartFileName);
   2.381 +            Process[] existingProcesses = Process.GetProcessesByName(procName);
   2.382 +            if (existingProcesses == null || existingProcesses.Length == 0)
   2.383 +            {
   2.384 +                // Process do not exists just try to launch it
   2.385 +                ProcessStartInfo start = new ProcessStartInfo();
   2.386 +                // Enter in the command line arguments, everything you would enter after the executable name itself
   2.387 +                //start.Arguments = arguments; 
   2.388 +                // Enter the executable to run, including the complete path
   2.389 +                start.FileName = Properties.Settings.Default.StartFileName;
   2.390 +                start.WindowStyle = ProcessWindowStyle.Normal;
   2.391 +                start.CreateNoWindow = true;
   2.392 +                start.UseShellExecute = true;
   2.393 +                // Run the external process & wait for it to finish
   2.394 +                Process proc = Process.Start(start);
   2.395 +
   2.396 +                //SL: We could have used that too
   2.397 +                //Shell32.Shell shell = new Shell32.Shell();
   2.398 +                //shell.ShellExecute(Properties.Settings.Default.StartFileName);
   2.399 +            }
   2.400 +            else
   2.401 +            {
   2.402 +                //This won't work properly until we have a manifest that enables uiAccess.
   2.403 +                //However uiAccess just won't work with ClickOnce so we will have to use a different deployment system.
   2.404 +                SwitchToThisWindow(existingProcesses[0].MainWindowHandle, true);
   2.405 +            }            
   2.406 +        }
   2.407 +
   2.408 +
   2.409 +        /// <summary>
   2.410 +        /// We need to handle WM_INPUT.
   2.411 +        /// </summary>
   2.412 +        /// <param name="message"></param>
   2.413 +        protected override void WndProc(ref Message message)
   2.414 +        {
   2.415 +            switch (message.Msg)
   2.416 +            {
   2.417 +                case Const.WM_INPUT:
   2.418 +                    //Returning zero means we processed that message.
   2.419 +                    message.Result = new IntPtr(0);
   2.420 +                    iHidHandler.ProcessInput(ref message);
   2.421 +                    break;
   2.422 +            }
   2.423 +
   2.424 +            //Pass this on to base class.
   2.425 +            base.WndProc(ref message);
   2.426 +        }
   2.427 +    }
   2.428 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Server/FormMain.cs	Fri Jul 29 10:40:15 2016 +0200
     3.3 @@ -0,0 +1,2922 @@
     3.4 +//
     3.5 +// Copyright (C) 2014-2015 Stéphane Lenclud.
     3.6 +//
     3.7 +// This file is part of SharpDisplayManager.
     3.8 +//
     3.9 +// SharpDisplayManager is free software: you can redistribute it and/or modify
    3.10 +// it under the terms of the GNU General Public License as published by
    3.11 +// the Free Software Foundation, either version 3 of the License, or
    3.12 +// (at your option) any later version.
    3.13 +//
    3.14 +// SharpDisplayManager is distributed in the hope that it will be useful,
    3.15 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.16 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.17 +// GNU General Public License for more details.
    3.18 +//
    3.19 +// You should have received a copy of the GNU General Public License
    3.20 +// along with SharpDisplayManager.  If not, see <http://www.gnu.org/licenses/>.
    3.21 +//
    3.22 +
    3.23 +using System;
    3.24 +using System.Collections.Generic;
    3.25 +using System.ComponentModel;
    3.26 +using System.Data;
    3.27 +using System.Drawing;
    3.28 +using System.Linq;
    3.29 +using System.Text;
    3.30 +using System.Threading.Tasks;
    3.31 +using System.Windows.Forms;
    3.32 +using System.IO;
    3.33 +using CodeProject.Dialog;
    3.34 +using System.Drawing.Imaging;
    3.35 +using System.ServiceModel;
    3.36 +using System.Threading;
    3.37 +using System.Diagnostics;
    3.38 +using System.Deployment.Application;
    3.39 +using System.Reflection;
    3.40 +//NAudio
    3.41 +using NAudio.CoreAudioApi;
    3.42 +using NAudio.CoreAudioApi.Interfaces;
    3.43 +using System.Runtime.InteropServices;
    3.44 +using CecSharp;
    3.45 +//Network
    3.46 +using NETWORKLIST;
    3.47 +//
    3.48 +using SharpDisplayClient;
    3.49 +using SharpDisplay;
    3.50 +using MiniDisplayInterop;
    3.51 +using SharpLib.Display;
    3.52 +using SharpLib.Ear;
    3.53 +
    3.54 +namespace SharpDisplayManager
    3.55 +{
    3.56 +    //Types declarations
    3.57 +    public delegate uint ColorProcessingDelegate(int aX, int aY, uint aPixel);
    3.58 +
    3.59 +    public delegate int CoordinateTranslationDelegate(System.Drawing.Bitmap aBmp, int aInt);
    3.60 +
    3.61 +    //Delegates are used for our thread safe method
    3.62 +    public delegate void AddClientDelegate(string aSessionId, ICallback aCallback);
    3.63 +
    3.64 +    public delegate void RemoveClientDelegate(string aSessionId);
    3.65 +
    3.66 +    public delegate void SetFieldDelegate(string SessionId, DataField aField);
    3.67 +
    3.68 +    public delegate void SetFieldsDelegate(string SessionId, System.Collections.Generic.IList<DataField> aFields);
    3.69 +
    3.70 +    public delegate void SetLayoutDelegate(string SessionId, TableLayout aLayout);
    3.71 +
    3.72 +    public delegate void SetClientNameDelegate(string aSessionId, string aName);
    3.73 +
    3.74 +    public delegate void SetClientPriorityDelegate(string aSessionId, uint aPriority);
    3.75 +
    3.76 +    public delegate void PlainUpdateDelegate();
    3.77 +
    3.78 +    public delegate void WndProcDelegate(ref Message aMessage);
    3.79 +
    3.80 +    /// <summary>
    3.81 +    /// Our Display manager main form
    3.82 +    /// </summary>
    3.83 +    [System.ComponentModel.DesignerCategory("Form")]
    3.84 +    public partial class FormMain : FormMainHid, IMMNotificationClient
    3.85 +    {
    3.86 +        //public ManagerEventAction iManager = new ManagerEventAction();        
    3.87 +        DateTime LastTickTime;
    3.88 +        Display iDisplay;
    3.89 +        System.Drawing.Bitmap iBmp;
    3.90 +        bool iCreateBitmap; //Workaround render to bitmap issues when minimized
    3.91 +        ServiceHost iServiceHost;
    3.92 +        // Our collection of clients sorted by session id.
    3.93 +        public Dictionary<string, ClientData> iClients;
    3.94 +        // The name of the client which informations are currently displayed.
    3.95 +        public string iCurrentClientSessionId;
    3.96 +        ClientData iCurrentClientData;
    3.97 +        //
    3.98 +        public bool iClosing;
    3.99 +        //
   3.100 +        public bool iSkipFrameRendering;
   3.101 +        //Function pointer for pixel color filtering
   3.102 +        ColorProcessingDelegate iColorFx;
   3.103 +        //Function pointer for pixel X coordinate intercept
   3.104 +        CoordinateTranslationDelegate iScreenX;
   3.105 +        //Function pointer for pixel Y coordinate intercept
   3.106 +        CoordinateTranslationDelegate iScreenY;
   3.107 +        //NAudio
   3.108 +        private MMDeviceEnumerator iMultiMediaDeviceEnumerator;
   3.109 +        private MMDevice iMultiMediaDevice;
   3.110 +        //Network
   3.111 +        private NetworkManager iNetworkManager;
   3.112 +
   3.113 +        /// <summary>
   3.114 +        /// CEC - Consumer Electronic Control.
   3.115 +        /// Notably used to turn TV on and off as Windows broadcast monitor on and off notifications.
   3.116 +        /// </summary>
   3.117 +        private ConsumerElectronicControl iCecManager;
   3.118 +
   3.119 +        /// <summary>
   3.120 +        /// Manage run when Windows startup option
   3.121 +        /// </summary>
   3.122 +        private StartupManager iStartupManager;
   3.123 +
   3.124 +        /// <summary>
   3.125 +        /// System notification icon used to hide our application from the task bar.
   3.126 +        /// </summary>
   3.127 +        private SharpLib.Notification.Control iNotifyIcon;
   3.128 +
   3.129 +        /// <summary>
   3.130 +        /// System recording notification icon.
   3.131 +        /// </summary>
   3.132 +        private SharpLib.Notification.Control iRecordingNotification;
   3.133 +
   3.134 +        /// <summary>
   3.135 +        /// 
   3.136 +        /// </summary>
   3.137 +        RichTextBoxTextWriter iWriter;
   3.138 +
   3.139 +
   3.140 +        /// <summary>
   3.141 +        /// Allow user to receive window messages;
   3.142 +        /// </summary>
   3.143 +        public event WndProcDelegate OnWndProc;
   3.144 +
   3.145 +        public FormMain()
   3.146 +        {
   3.147 +            ManagerEventAction.Current = Properties.Settings.Default.Actions;
   3.148 +            if (ManagerEventAction.Current == null)
   3.149 +            {
   3.150 +                //No actions in our settings yet
   3.151 +                ManagerEventAction.Current = new ManagerEventAction();
   3.152 +                Properties.Settings.Default.Actions = ManagerEventAction.Current;
   3.153 +            }
   3.154 +            else
   3.155 +            {
   3.156 +                //We loaded actions from our settings
   3.157 +                //We need to hook them with corresponding events
   3.158 +                ManagerEventAction.Current.Init();
   3.159 +            }
   3.160 +            iSkipFrameRendering = false;
   3.161 +            iClosing = false;
   3.162 +            iCurrentClientSessionId = "";
   3.163 +            iCurrentClientData = null;
   3.164 +            LastTickTime = DateTime.Now;
   3.165 +            //Instantiate our display and register for events notifications
   3.166 +            iDisplay = new Display();
   3.167 +            iDisplay.OnOpened += OnDisplayOpened;
   3.168 +            iDisplay.OnClosed += OnDisplayClosed;
   3.169 +            //
   3.170 +            iClients = new Dictionary<string, ClientData>();
   3.171 +            iStartupManager = new StartupManager();
   3.172 +            iNotifyIcon = new SharpLib.Notification.Control();
   3.173 +            iRecordingNotification = new SharpLib.Notification.Control();
   3.174 +
   3.175 +            //Have our designer initialize its controls
   3.176 +            InitializeComponent();
   3.177 +
   3.178 +            //Redirect console output
   3.179 +            iWriter = new RichTextBoxTextWriter(richTextBoxLogs);
   3.180 +            Console.SetOut(iWriter);
   3.181 +
   3.182 +            //Populate device types
   3.183 +            PopulateDeviceTypes();
   3.184 +
   3.185 +            //Populate optical drives
   3.186 +            PopulateOpticalDrives();
   3.187 +
   3.188 +            //Initial status update 
   3.189 +            UpdateStatus();
   3.190 +
   3.191 +            //We have a bug when drawing minimized and reusing our bitmap
   3.192 +            //Though I could not reproduce it on Windows 10
   3.193 +            iBmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height,
   3.194 +                PixelFormat.Format32bppArgb);
   3.195 +            iCreateBitmap = false;
   3.196 +
   3.197 +            //Minimize our window if desired
   3.198 +            if (Properties.Settings.Default.StartMinimized)
   3.199 +            {
   3.200 +                WindowState = FormWindowState.Minimized;
   3.201 +            }
   3.202 +
   3.203 +        }
   3.204 +
   3.205 +        /// <summary>
   3.206 +        ///
   3.207 +        /// </summary>
   3.208 +        /// <param name="sender"></param>
   3.209 +        /// <param name="e"></param>
   3.210 +        private void MainForm_Load(object sender, EventArgs e)
   3.211 +        {
   3.212 +            //Check if we are running a Click Once deployed application
   3.213 +            if (ApplicationDeployment.IsNetworkDeployed)
   3.214 +            {
   3.215 +                //This is a proper Click Once installation, fetch and show our version number
   3.216 +                this.Text += " - v" + ApplicationDeployment.CurrentDeployment.CurrentVersion;
   3.217 +            }
   3.218 +            else
   3.219 +            {
   3.220 +                //Not a proper Click Once installation, assuming development build then
   3.221 +                this.Text += " - development";
   3.222 +            }
   3.223 +
   3.224 +            //NAudio
   3.225 +            iMultiMediaDeviceEnumerator = new MMDeviceEnumerator();
   3.226 +            iMultiMediaDeviceEnumerator.RegisterEndpointNotificationCallback(this);
   3.227 +            UpdateAudioDeviceAndMasterVolumeThreadSafe();
   3.228 +
   3.229 +            //Network
   3.230 +            iNetworkManager = new NetworkManager();
   3.231 +            iNetworkManager.OnConnectivityChanged += OnConnectivityChanged;
   3.232 +            UpdateNetworkStatus();
   3.233 +
   3.234 +            //CEC
   3.235 +            iCecManager = new ConsumerElectronicControl();
   3.236 +            OnWndProc += iCecManager.OnWndProc;
   3.237 +            ResetCec();
   3.238 +
   3.239 +            //Setup Events
   3.240 +            PopulateEventsTreeView();
   3.241 +
   3.242 +            //Setup notification icon
   3.243 +            SetupTrayIcon();
   3.244 +
   3.245 +            //Setup recording notification
   3.246 +            SetupRecordingNotification();
   3.247 +
   3.248 +            // To make sure start up with minimize to tray works
   3.249 +            if (WindowState == FormWindowState.Minimized && Properties.Settings.Default.MinimizeToTray)
   3.250 +            {
   3.251 +                Visible = false;
   3.252 +            }
   3.253 +
   3.254 +#if !DEBUG
   3.255 +    //When not debugging we want the screen to be empty until a client takes over
   3.256 +			ClearLayout();
   3.257 +#else
   3.258 +            //When developing we want at least one client for testing
   3.259 +            StartNewClient("abcdefghijklmnopqrst-0123456789", "ABCDEFGHIJKLMNOPQRST-0123456789");
   3.260 +#endif
   3.261 +
   3.262 +            //Open display connection on start-up if needed
   3.263 +            if (Properties.Settings.Default.DisplayConnectOnStartup)
   3.264 +            {
   3.265 +                OpenDisplayConnection();
   3.266 +            }
   3.267 +
   3.268 +            //Start our server so that we can get client requests
   3.269 +            StartServer();
   3.270 +
   3.271 +            //Register for HID events
   3.272 +            RegisterHidDevices();
   3.273 +
   3.274 +            //Start Idle client if needed
   3.275 +            if (Properties.Settings.Default.StartIdleClient)
   3.276 +            {
   3.277 +                StartIdleClient();
   3.278 +            }
   3.279 +        }
   3.280 +
   3.281 +        /// <summary>
   3.282 +        /// Called when our display is opened.
   3.283 +        /// </summary>
   3.284 +        /// <param name="aDisplay"></param>
   3.285 +        private void OnDisplayOpened(Display aDisplay)
   3.286 +        {
   3.287 +            //Make sure we resume frame rendering
   3.288 +            iSkipFrameRendering = false;
   3.289 +
   3.290 +            //Set our screen size now that our display is connected
   3.291 +            //Our panelDisplay is the container of our tableLayoutPanel
   3.292 +            //tableLayoutPanel will resize itself to fit the client size of our panelDisplay
   3.293 +            //panelDisplay needs an extra 2 pixels for borders on each sides
   3.294 +            //tableLayoutPanel will eventually be the exact size of our display
   3.295 +            Size size = new Size(iDisplay.WidthInPixels() + 2, iDisplay.HeightInPixels() + 2);
   3.296 +            panelDisplay.Size = size;
   3.297 +
   3.298 +            //Our display was just opened, update our UI
   3.299 +            UpdateStatus();
   3.300 +            //Initiate asynchronous request
   3.301 +            iDisplay.RequestFirmwareRevision();
   3.302 +
   3.303 +            //Audio
   3.304 +            UpdateMasterVolumeThreadSafe();
   3.305 +            //Network
   3.306 +            UpdateNetworkStatus();
   3.307 +
   3.308 +#if DEBUG
   3.309 +            //Testing icon in debug, no arm done if icon not supported
   3.310 +            //iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconRecording, 0, 1);
   3.311 +            //iDisplay.SetAllIconsStatus(2);
   3.312 +#endif
   3.313 +
   3.314 +        }
   3.315 +
   3.316 +        /// <summary>
   3.317 +        /// Populate tree view with events and actions
   3.318 +        /// </summary>
   3.319 +        private void PopulateEventsTreeView()
   3.320 +        {
   3.321 +            //Disable action buttons
   3.322 +            buttonAddAction.Enabled = false;
   3.323 +            buttonDeleteAction.Enabled = false;
   3.324 +
   3.325 +            Event currentEvent = CurrentEvent();
   3.326 +            SharpLib.Ear.Action currentAction = CurrentAction();
   3.327 +            TreeNode treeNodeToSelect = null;
   3.328 +
   3.329 +            //Reset our tree
   3.330 +            iTreeViewEvents.Nodes.Clear();
   3.331 +            //Populate registered events
   3.332 +            foreach (string key in ManagerEventAction.Current.Events.Keys)
   3.333 +            {
   3.334 +                Event e = ManagerEventAction.Current.Events[key];
   3.335 +                TreeNode eventNode = iTreeViewEvents.Nodes.Add(key, e.Name);
   3.336 +                eventNode.Tag = e;
   3.337 +                eventNode.Nodes.Add(key + ".Description", e.Description);
   3.338 +                TreeNode actionsNodes = eventNode.Nodes.Add(key + ".Actions", "Actions");
   3.339 +
   3.340 +                // Add our actions for that event
   3.341 +                foreach (SharpLib.Ear.Action a in e.Actions)
   3.342 +                {
   3.343 +                    TreeNode actionNode = actionsNodes.Nodes.Add(a.Brief());
   3.344 +                    actionNode.Tag = a;
   3.345 +                    if (a == currentAction)
   3.346 +                    {
   3.347 +                        treeNodeToSelect = actionNode;
   3.348 +                    }
   3.349 +                }
   3.350 +            }
   3.351 +
   3.352 +            iTreeViewEvents.ExpandAll();
   3.353 +            SelectEvent(currentEvent);
   3.354 +            
   3.355 +            if (treeNodeToSelect != null)
   3.356 +            {
   3.357 +                iTreeViewEvents.SelectedNode = treeNodeToSelect;
   3.358 +            }
   3.359 +            else if (iTreeViewEvents.SelectedNode != null && iTreeViewEvents.SelectedNode.Nodes[1].GetNodeCount(false) > 0)
   3.360 +            {
   3.361 +                //Select the last action if any 
   3.362 +                iTreeViewEvents.SelectedNode =
   3.363 +                    iTreeViewEvents.SelectedNode.Nodes[1].Nodes[
   3.364 +                        iTreeViewEvents.SelectedNode.Nodes[1].GetNodeCount(false) - 1];
   3.365 +            }
   3.366 +
   3.367 +        }
   3.368 +
   3.369 +        /// <summary>
   3.370 +        /// Called when our display is closed.
   3.371 +        /// </summary>
   3.372 +        /// <param name="aDisplay"></param>
   3.373 +        private void OnDisplayClosed(Display aDisplay)
   3.374 +        {
   3.375 +            //Our display was just closed, update our UI consequently
   3.376 +            UpdateStatus();
   3.377 +        }
   3.378 +
   3.379 +        public void OnConnectivityChanged(NetworkManager aNetwork, NLM_CONNECTIVITY newConnectivity)
   3.380 +        {
   3.381 +            //Update network status
   3.382 +            UpdateNetworkStatus();
   3.383 +        }
   3.384 +
   3.385 +        /// <summary>
   3.386 +        /// Update our Network Status
   3.387 +        /// </summary>
   3.388 +        private void UpdateNetworkStatus()
   3.389 +        {
   3.390 +            if (iDisplay.IsOpen())
   3.391 +            {
   3.392 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.Internet,
   3.393 +                    iNetworkManager.NetworkListManager.IsConnectedToInternet);
   3.394 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.NetworkSignal, iNetworkManager.NetworkListManager.IsConnected);
   3.395 +            }
   3.396 +        }
   3.397 +
   3.398 +
   3.399 +        int iLastNetworkIconIndex = 0;
   3.400 +        int iUpdateCountSinceLastNetworkAnimation = 0;
   3.401 +
   3.402 +        /// <summary>
   3.403 +        /// 
   3.404 +        /// </summary>
   3.405 +        private void UpdateNetworkSignal(DateTime aLastTickTime, DateTime aNewTickTime)
   3.406 +        {
   3.407 +            iUpdateCountSinceLastNetworkAnimation++;
   3.408 +            iUpdateCountSinceLastNetworkAnimation = iUpdateCountSinceLastNetworkAnimation%4;
   3.409 +
   3.410 +            if (iDisplay.IsOpen() && iNetworkManager.NetworkListManager.IsConnected &&
   3.411 +                iUpdateCountSinceLastNetworkAnimation == 0)
   3.412 +            {
   3.413 +                int iconCount = iDisplay.IconCount(MiniDisplay.IconType.NetworkSignal);
   3.414 +                if (iconCount <= 0)
   3.415 +                {
   3.416 +                    //Prevents div by zero and other undefined behavior
   3.417 +                    return;
   3.418 +                }
   3.419 +                iLastNetworkIconIndex++;
   3.420 +                iLastNetworkIconIndex = iLastNetworkIconIndex%(iconCount*2);
   3.421 +                for (int i = 0; i < iconCount; i++)
   3.422 +                {
   3.423 +                    if (i < iLastNetworkIconIndex && !(i == 0 && iLastNetworkIconIndex > 3) &&
   3.424 +                        !(i == 1 && iLastNetworkIconIndex > 4))
   3.425 +                    {
   3.426 +                        iDisplay.SetIconOn(MiniDisplay.IconType.NetworkSignal, i);
   3.427 +                    }
   3.428 +                    else
   3.429 +                    {
   3.430 +                        iDisplay.SetIconOff(MiniDisplay.IconType.NetworkSignal, i);
   3.431 +                    }
   3.432 +                }
   3.433 +            }
   3.434 +        }
   3.435 +
   3.436 +
   3.437 +
   3.438 +        /// <summary>
   3.439 +        /// Receive volume change notification and reflect changes on our slider.
   3.440 +        /// </summary>
   3.441 +        /// <param name="data"></param>
   3.442 +        public void OnVolumeNotificationThreadSafe(AudioVolumeNotificationData data)
   3.443 +        {
   3.444 +            UpdateMasterVolumeThreadSafe();
   3.445 +        }
   3.446 +
   3.447 +        /// <summary>
   3.448 +        /// Update master volume when user moves our slider.
   3.449 +        /// </summary>
   3.450 +        /// <param name="sender"></param>
   3.451 +        /// <param name="e"></param>
   3.452 +        private void trackBarMasterVolume_Scroll(object sender, EventArgs e)
   3.453 +        {
   3.454 +            //Just like Windows Volume Mixer we unmute if the volume is adjusted
   3.455 +            iMultiMediaDevice.AudioEndpointVolume.Mute = false;
   3.456 +            //Set volume level according to our volume slider new position
   3.457 +            iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar = trackBarMasterVolume.Value/100.0f;
   3.458 +        }
   3.459 +
   3.460 +
   3.461 +        /// <summary>
   3.462 +        /// Mute check box changed.
   3.463 +        /// </summary>
   3.464 +        /// <param name="sender"></param>
   3.465 +        /// <param name="e"></param>
   3.466 +        private void checkBoxMute_CheckedChanged(object sender, EventArgs e)
   3.467 +        {
   3.468 +            iMultiMediaDevice.AudioEndpointVolume.Mute = checkBoxMute.Checked;
   3.469 +        }
   3.470 +
   3.471 +        /// <summary>
   3.472 +        /// Device State Changed
   3.473 +        /// </summary>
   3.474 +        public void OnDeviceStateChanged([MarshalAs(UnmanagedType.LPWStr)] string deviceId,
   3.475 +            [MarshalAs(UnmanagedType.I4)] DeviceState newState)
   3.476 +        {
   3.477 +        }
   3.478 +
   3.479 +        /// <summary>
   3.480 +        /// Device Added
   3.481 +        /// </summary>
   3.482 +        public void OnDeviceAdded([MarshalAs(UnmanagedType.LPWStr)] string pwstrDeviceId)
   3.483 +        {
   3.484 +        }
   3.485 +
   3.486 +        /// <summary>
   3.487 +        /// Device Removed
   3.488 +        /// </summary>
   3.489 +        public void OnDeviceRemoved([MarshalAs(UnmanagedType.LPWStr)] string deviceId)
   3.490 +        {
   3.491 +        }
   3.492 +
   3.493 +        /// <summary>
   3.494 +        /// Default Device Changed
   3.495 +        /// </summary>
   3.496 +        public void OnDefaultDeviceChanged(DataFlow flow, Role role,
   3.497 +            [MarshalAs(UnmanagedType.LPWStr)] string defaultDeviceId)
   3.498 +        {
   3.499 +            if (role == Role.Multimedia && flow == DataFlow.Render)
   3.500 +            {
   3.501 +                UpdateAudioDeviceAndMasterVolumeThreadSafe();
   3.502 +            }
   3.503 +        }
   3.504 +
   3.505 +        /// <summary>
   3.506 +        /// Property Value Changed
   3.507 +        /// </summary>
   3.508 +        /// <param name="pwstrDeviceId"></param>
   3.509 +        /// <param name="key"></param>
   3.510 +        public void OnPropertyValueChanged([MarshalAs(UnmanagedType.LPWStr)] string pwstrDeviceId, PropertyKey key)
   3.511 +        {
   3.512 +        }
   3.513 +
   3.514 +
   3.515 +
   3.516 +
   3.517 +        /// <summary>
   3.518 +        /// Update master volume indicators based our current system states.
   3.519 +        /// This typically includes volume levels and mute status.
   3.520 +        /// </summary>
   3.521 +        private void UpdateMasterVolumeThreadSafe()
   3.522 +        {
   3.523 +            if (this.InvokeRequired)
   3.524 +            {
   3.525 +                //Not in the proper thread, invoke ourselves
   3.526 +                PlainUpdateDelegate d = new PlainUpdateDelegate(UpdateMasterVolumeThreadSafe);
   3.527 +                this.Invoke(d, new object[] {});
   3.528 +                return;
   3.529 +            }
   3.530 +
   3.531 +            //Update volume slider
   3.532 +            float volumeLevelScalar = iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar;
   3.533 +            trackBarMasterVolume.Value = Convert.ToInt32(volumeLevelScalar*100);
   3.534 +            //Update mute checkbox
   3.535 +            checkBoxMute.Checked = iMultiMediaDevice.AudioEndpointVolume.Mute;
   3.536 +
   3.537 +            //If our display connection is open we need to update its icons
   3.538 +            if (iDisplay.IsOpen())
   3.539 +            {
   3.540 +                //First take care our our volume level icons
   3.541 +                int volumeIconCount = iDisplay.IconCount(MiniDisplay.IconType.Volume);
   3.542 +                if (volumeIconCount > 0)
   3.543 +                {
   3.544 +                    //Compute current volume level from system level and the number of segments in our display volume bar.
   3.545 +                    //That tells us how many segments in our volume bar needs to be turned on.
   3.546 +                    float currentVolume = volumeLevelScalar*volumeIconCount;
   3.547 +                    int segmentOnCount = Convert.ToInt32(currentVolume);
   3.548 +                    //Check if our segment count was rounded up, this will later be used for half brightness segment
   3.549 +                    bool roundedUp = segmentOnCount > currentVolume;
   3.550 +
   3.551 +                    for (int i = 0; i < volumeIconCount; i++)
   3.552 +                    {
   3.553 +                        if (i < segmentOnCount)
   3.554 +                        {
   3.555 +                            //If we are dealing with our last segment and our segment count was rounded up then we will use half brightness.
   3.556 +                            if (i == segmentOnCount - 1 && roundedUp)
   3.557 +                            {
   3.558 +                                //Half brightness
   3.559 +                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i,
   3.560 +                                    (iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1)/2);
   3.561 +                            }
   3.562 +                            else
   3.563 +                            {
   3.564 +                                //Full brightness
   3.565 +                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i,
   3.566 +                                    iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1);
   3.567 +                            }
   3.568 +                        }
   3.569 +                        else
   3.570 +                        {
   3.571 +                            iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i, 0);
   3.572 +                        }
   3.573 +                    }
   3.574 +                }
   3.575 +
   3.576 +                //Take care of our mute icon
   3.577 +                iDisplay.SetIconOnOff(MiniDisplay.IconType.Mute, iMultiMediaDevice.AudioEndpointVolume.Mute);
   3.578 +            }
   3.579 +
   3.580 +        }
   3.581 +
   3.582 +        /// <summary>
   3.583 +        /// 
   3.584 +        /// </summary>
   3.585 +        private void UpdateAudioDeviceAndMasterVolumeThreadSafe()
   3.586 +        {
   3.587 +            if (this.InvokeRequired)
   3.588 +            {
   3.589 +                //Not in the proper thread, invoke ourselves
   3.590 +                PlainUpdateDelegate d = new PlainUpdateDelegate(UpdateAudioDeviceAndMasterVolumeThreadSafe);
   3.591 +                this.Invoke(d, new object[] {});
   3.592 +                return;
   3.593 +            }
   3.594 +
   3.595 +            //We are in the correct thread just go ahead.
   3.596 +            try
   3.597 +            {
   3.598 +                //Get our master volume            
   3.599 +                iMultiMediaDevice = iMultiMediaDeviceEnumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
   3.600 +                //Update our label
   3.601 +                labelDefaultAudioDevice.Text = iMultiMediaDevice.FriendlyName;
   3.602 +
   3.603 +                //Show our volume in our track bar
   3.604 +                UpdateMasterVolumeThreadSafe();
   3.605 +
   3.606 +                //Register to get volume modifications
   3.607 +                iMultiMediaDevice.AudioEndpointVolume.OnVolumeNotification += OnVolumeNotificationThreadSafe;
   3.608 +                //
   3.609 +                trackBarMasterVolume.Enabled = true;
   3.610 +            }
   3.611 +            catch (Exception ex)
   3.612 +            {
   3.613 +                Debug.WriteLine("Exception thrown in UpdateAudioDeviceAndMasterVolume");
   3.614 +                Debug.WriteLine(ex.ToString());
   3.615 +                //Something went wrong S/PDIF device ca throw exception I guess
   3.616 +                trackBarMasterVolume.Enabled = false;
   3.617 +            }
   3.618 +        }
   3.619 +
   3.620 +        /// <summary>
   3.621 +        /// 
   3.622 +        /// </summary>
   3.623 +        private void PopulateDeviceTypes()
   3.624 +        {
   3.625 +            int count = Display.TypeCount();
   3.626 +
   3.627 +            for (int i = 0; i < count; i++)
   3.628 +            {
   3.629 +                comboBoxDisplayType.Items.Add(Display.TypeName((MiniDisplay.Type) i));
   3.630 +            }
   3.631 +        }
   3.632 +
   3.633 +        /// <summary>
   3.634 +        /// 
   3.635 +        /// </summary>
   3.636 +        private void PopulateOpticalDrives()
   3.637 +        {
   3.638 +            //Reset our list of drives
   3.639 +            comboBoxOpticalDrives.Items.Clear();
   3.640 +            comboBoxOpticalDrives.Items.Add("None");
   3.641 +
   3.642 +            //Go through each drives on our system and collected the optical ones in our list
   3.643 +            DriveInfo[] allDrives = DriveInfo.GetDrives();
   3.644 +            foreach (DriveInfo d in allDrives)
   3.645 +            {
   3.646 +                Debug.WriteLine("Drive " + d.Name);
   3.647 +                Debug.WriteLine("  Drive type: {0}", d.DriveType);
   3.648 +
   3.649 +                if (d.DriveType == DriveType.CDRom)
   3.650 +                {
   3.651 +                    //This is an optical drive, add it now
   3.652 +                    comboBoxOpticalDrives.Items.Add(d.Name.Substring(0, 2));
   3.653 +                }
   3.654 +            }
   3.655 +        }
   3.656 +
   3.657 +        /// <summary>
   3.658 +        /// 
   3.659 +        /// </summary>
   3.660 +        /// <returns></returns>
   3.661 +        public string OpticalDriveToEject()
   3.662 +        {
   3.663 +            return comboBoxOpticalDrives.SelectedItem.ToString();
   3.664 +        }
   3.665 +
   3.666 +
   3.667 +
   3.668 +        /// <summary>
   3.669 +        ///
   3.670 +        /// </summary>
   3.671 +        private void SetupTrayIcon()
   3.672 +        {
   3.673 +            iNotifyIcon.Icon = GetIcon("vfd.ico");
   3.674 +            iNotifyIcon.Text = "Sharp Display Manager";
   3.675 +            iNotifyIcon.Visible = true;
   3.676 +
   3.677 +            //Double click toggles visibility - typically brings up the application
   3.678 +            iNotifyIcon.DoubleClick += delegate(object obj, EventArgs args)
   3.679 +            {
   3.680 +                SysTrayHideShow();
   3.681 +            };
   3.682 +
   3.683 +            //Adding a context menu, useful to be able to exit the application
   3.684 +            ContextMenu contextMenu = new ContextMenu();
   3.685 +            //Context menu item to toggle visibility
   3.686 +            MenuItem hideShowItem = new MenuItem("Hide/Show");
   3.687 +            hideShowItem.Click += delegate(object obj, EventArgs args)
   3.688 +            {
   3.689 +                SysTrayHideShow();
   3.690 +            };
   3.691 +            contextMenu.MenuItems.Add(hideShowItem);
   3.692 +
   3.693 +            //Context menu item separator
   3.694 +            contextMenu.MenuItems.Add(new MenuItem("-"));
   3.695 +
   3.696 +            //Context menu exit item
   3.697 +            MenuItem exitItem = new MenuItem("Exit");
   3.698 +            exitItem.Click += delegate(object obj, EventArgs args)
   3.699 +            {
   3.700 +                Application.Exit();
   3.701 +            };
   3.702 +            contextMenu.MenuItems.Add(exitItem);
   3.703 +
   3.704 +            iNotifyIcon.ContextMenu = contextMenu;
   3.705 +        }
   3.706 +
   3.707 +        /// <summary>
   3.708 +        ///
   3.709 +        /// </summary>
   3.710 +        private void SetupRecordingNotification()
   3.711 +        {
   3.712 +            iRecordingNotification.Icon = GetIcon("record.ico");
   3.713 +            iRecordingNotification.Text = "No recording";
   3.714 +            iRecordingNotification.Visible = false;
   3.715 +        }
   3.716 +
   3.717 +        /// <summary>
   3.718 +        /// Access icons from embedded resources.
   3.719 +        /// </summary>
   3.720 +        /// <param name="aName"></param>
   3.721 +        /// <returns></returns>
   3.722 +        public static Icon GetIcon(string aName)
   3.723 +        {
   3.724 +            string[] names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
   3.725 +            foreach (string name in names)
   3.726 +            {
   3.727 +                //Find a resource name that ends with the given name
   3.728 +                if (name.EndsWith(aName))
   3.729 +                {
   3.730 +                    using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
   3.731 +                    {
   3.732 +                        return new Icon(stream);
   3.733 +                    }
   3.734 +                }
   3.735 +            }
   3.736 +
   3.737 +            return null;
   3.738 +        }
   3.739 +
   3.740 +
   3.741 +        /// <summary>
   3.742 +        /// Set our current client.
   3.743 +        /// This will take care of applying our client layout and set data fields.
   3.744 +        /// </summary>
   3.745 +        /// <param name="aSessionId"></param>
   3.746 +        void SetCurrentClient(string aSessionId, bool aForce = false)
   3.747 +        {
   3.748 +            if (aSessionId == iCurrentClientSessionId)
   3.749 +            {
   3.750 +                //Given client is already the current one.
   3.751 +                //Don't bother changing anything then.
   3.752 +                return;
   3.753 +            }
   3.754 +
   3.755 +            ClientData requestedClientData = iClients[aSessionId];
   3.756 +
   3.757 +            //Check when was the last time we switched to that client
   3.758 +            if (iCurrentClientData != null)
   3.759 +            {
   3.760 +                //Do not switch client if priority of current client is higher 
   3.761 +                if (!aForce && requestedClientData.Priority < iCurrentClientData.Priority)
   3.762 +                {
   3.763 +                    return;
   3.764 +                }
   3.765 +
   3.766 +
   3.767 +                double lastSwitchToClientSecondsAgo = (DateTime.Now - iCurrentClientData.LastSwitchTime).TotalSeconds;
   3.768 +                //TODO: put that hard coded value as a client property
   3.769 +                //Clients should be able to define how often they can be interrupted
   3.770 +                //Thus a background client can set this to zero allowing any other client to interrupt at any time
   3.771 +                //We could also compute this delay by looking at the requests frequencies?
   3.772 +                if (!aForce &&
   3.773 +                    requestedClientData.Priority == iCurrentClientData.Priority &&
   3.774 +                    //Time sharing is only if clients have the same priority
   3.775 +                    (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds
   3.776 +                {
   3.777 +                    //Don't switch clients too often
   3.778 +                    return;
   3.779 +                }
   3.780 +            }
   3.781 +
   3.782 +            //Set current client ID.
   3.783 +            iCurrentClientSessionId = aSessionId;
   3.784 +            //Set the time we last switched to that client
   3.785 +            iClients[aSessionId].LastSwitchTime = DateTime.Now;
   3.786 +            //Fetch and set current client data.
   3.787 +            iCurrentClientData = requestedClientData;
   3.788 +            //Apply layout and set data fields.
   3.789 +            UpdateTableLayoutPanel(iCurrentClientData);
   3.790 +        }
   3.791 +
   3.792 +        private void buttonFont_Click(object sender, EventArgs e)
   3.793 +        {
   3.794 +            //fontDialog.ShowColor = true;
   3.795 +            //fontDialog.ShowApply = true;
   3.796 +            fontDialog.ShowEffects = true;
   3.797 +            fontDialog.Font = cds.Font;
   3.798 +
   3.799 +            fontDialog.FixedPitchOnly = checkBoxFixedPitchFontOnly.Checked;
   3.800 +
   3.801 +            //fontDialog.ShowHelp = true;
   3.802 +
   3.803 +            //fontDlg.MaxSize = 40;
   3.804 +            //fontDlg.MinSize = 22;
   3.805 +
   3.806 +            //fontDialog.Parent = this;
   3.807 +            //fontDialog.StartPosition = FormStartPosition.CenterParent;
   3.808 +
   3.809 +            //DlgBox.ShowDialog(fontDialog);
   3.810 +
   3.811 +            //if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
   3.812 +            if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
   3.813 +            {
   3.814 +                //Set the fonts to all our labels in our layout
   3.815 +                foreach (Control ctrl in iTableLayoutPanel.Controls)
   3.816 +                {
   3.817 +                    if (ctrl is MarqueeLabel)
   3.818 +                    {
   3.819 +                        ((MarqueeLabel) ctrl).Font = fontDialog.Font;
   3.820 +                    }
   3.821 +                }
   3.822 +
   3.823 +                //Save font settings
   3.824 +                cds.Font = fontDialog.Font;
   3.825 +                Properties.Settings.Default.Save();
   3.826 +                //
   3.827 +                CheckFontHeight();
   3.828 +            }
   3.829 +        }
   3.830 +
   3.831 +        /// <summary>
   3.832 +        ///
   3.833 +        /// </summary>
   3.834 +        void CheckFontHeight()
   3.835 +        {
   3.836 +            //Show font height and width
   3.837 +            labelFontHeight.Text = "Font height: " + cds.Font.Height;
   3.838 +            float charWidth = IsFixedWidth(cds.Font);
   3.839 +            if (charWidth == 0.0f)
   3.840 +            {
   3.841 +                labelFontWidth.Visible = false;
   3.842 +            }
   3.843 +            else
   3.844 +            {
   3.845 +                labelFontWidth.Visible = true;
   3.846 +                labelFontWidth.Text = "Font width: " + charWidth;
   3.847 +            }
   3.848 +
   3.849 +            MarqueeLabel label = null;
   3.850 +            //Get the first label control we can find
   3.851 +            foreach (Control ctrl in iTableLayoutPanel.Controls)
   3.852 +            {
   3.853 +                if (ctrl is MarqueeLabel)
   3.854 +                {
   3.855 +                    label = (MarqueeLabel) ctrl;
   3.856 +                    break;
   3.857 +                }
   3.858 +            }
   3.859 +
   3.860 +            //Now check font height and show a warning if needed.
   3.861 +            if (label != null && label.Font.Height > label.Height)
   3.862 +            {
   3.863 +                labelWarning.Text = "WARNING: Selected font is too height by " + (label.Font.Height - label.Height) +
   3.864 +                                    " pixels!";
   3.865 +                labelWarning.Visible = true;
   3.866 +            }
   3.867 +            else
   3.868 +            {
   3.869 +                labelWarning.Visible = false;
   3.870 +            }
   3.871 +
   3.872 +        }
   3.873 +
   3.874 +        private void buttonCapture_Click(object sender, EventArgs e)
   3.875 +        {
   3.876 +            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height);
   3.877 +            iTableLayoutPanel.DrawToBitmap(bmp, iTableLayoutPanel.ClientRectangle);
   3.878 +            //Bitmap bmpToSave = new Bitmap(bmp);
   3.879 +            bmp.Save("D:\\capture.png");
   3.880 +
   3.881 +            ((MarqueeLabel) iTableLayoutPanel.Controls[0]).Text = "Captured";
   3.882 +
   3.883 +            /*
   3.884 +            string outputFileName = "d:\\capture.png";
   3.885 +            using (MemoryStream memory = new MemoryStream())
   3.886 +            {
   3.887 +                using (FileStream fs = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
   3.888 +                {
   3.889 +                    bmp.Save(memory, System.Drawing.Imaging.ImageFormat.Png);
   3.890 +                    byte[] bytes = memory.ToArray();
   3.891 +                    fs.Write(bytes, 0, bytes.Length);
   3.892 +                }
   3.893 +            }
   3.894 +             */
   3.895 +
   3.896 +        }
   3.897 +
   3.898 +        private void CheckForRequestResults()
   3.899 +        {
   3.900 +            if (iDisplay.IsRequestPending())
   3.901 +            {
   3.902 +                switch (iDisplay.AttemptRequestCompletion())
   3.903 +                {
   3.904 +                    case MiniDisplay.Request.FirmwareRevision:
   3.905 +                        toolStripStatusLabelConnect.Text += " v" + iDisplay.FirmwareRevision();
   3.906 +                        //Issue next request then
   3.907 +                        iDisplay.RequestPowerSupplyStatus();
   3.908 +                        break;
   3.909 +
   3.910 +                    case MiniDisplay.Request.PowerSupplyStatus:
   3.911 +                        if (iDisplay.PowerSupplyStatus())
   3.912 +                        {
   3.913 +                            toolStripStatusLabelPower.Text = "ON";
   3.914 +                        }
   3.915 +                        else
   3.916 +                        {
   3.917 +                            toolStripStatusLabelPower.Text = "OFF";
   3.918 +                        }
   3.919 +                        //Issue next request then
   3.920 +                        iDisplay.RequestDeviceId();
   3.921 +                        break;
   3.922 +
   3.923 +                    case MiniDisplay.Request.DeviceId:
   3.924 +                        toolStripStatusLabelConnect.Text += " - " + iDisplay.DeviceId();
   3.925 +                        //No more request to issue
   3.926 +                        break;
   3.927 +                }
   3.928 +            }
   3.929 +        }
   3.930 +
   3.931 +        public static uint ColorWhiteIsOn(int aX, int aY, uint aPixel)
   3.932 +        {
   3.933 +            if ((aPixel & 0x00FFFFFF) == 0x00FFFFFF)
   3.934 +            {
   3.935 +                return 0xFFFFFFFF;
   3.936 +            }
   3.937 +            return 0x00000000;
   3.938 +        }
   3.939 +
   3.940 +        public static uint ColorUntouched(int aX, int aY, uint aPixel)
   3.941 +        {
   3.942 +            return aPixel;
   3.943 +        }
   3.944 +
   3.945 +        public static uint ColorInversed(int aX, int aY, uint aPixel)
   3.946 +        {
   3.947 +            return ~aPixel;
   3.948 +        }
   3.949 +
   3.950 +        public static uint ColorChessboard(int aX, int aY, uint aPixel)
   3.951 +        {
   3.952 +            if ((aX%2 == 0) && (aY%2 == 0))
   3.953 +            {
   3.954 +                return ~aPixel;
   3.955 +            }
   3.956 +            else if ((aX%2 != 0) && (aY%2 != 0))
   3.957 +            {
   3.958 +                return ~aPixel;
   3.959 +            }
   3.960 +            return 0x00000000;
   3.961 +        }
   3.962 +
   3.963 +
   3.964 +        public static int ScreenReversedX(System.Drawing.Bitmap aBmp, int aX)
   3.965 +        {
   3.966 +            return aBmp.Width - aX - 1;
   3.967 +        }
   3.968 +
   3.969 +        public int ScreenReversedY(System.Drawing.Bitmap aBmp, int aY)
   3.970 +        {
   3.971 +            return iBmp.Height - aY - 1;
   3.972 +        }
   3.973 +
   3.974 +        public int ScreenX(System.Drawing.Bitmap aBmp, int aX)
   3.975 +        {
   3.976 +            return aX;
   3.977 +        }
   3.978 +
   3.979 +        public int ScreenY(System.Drawing.Bitmap aBmp, int aY)
   3.980 +        {
   3.981 +            return aY;
   3.982 +        }
   3.983 +
   3.984 +        /// <summary>
   3.985 +        /// Select proper pixel delegates according to our current settings.
   3.986 +        /// </summary>
   3.987 +        private void SetupPixelDelegates()
   3.988 +        {
   3.989 +            //Select our pixel processing routine
   3.990 +            if (cds.InverseColors)
   3.991 +            {
   3.992 +                //iColorFx = ColorChessboard;
   3.993 +                iColorFx = ColorInversed;
   3.994 +            }
   3.995 +            else
   3.996 +            {
   3.997 +                iColorFx = ColorWhiteIsOn;
   3.998 +            }
   3.999 +
  3.1000 +            //Select proper coordinate translation functions
  3.1001 +            //We used delegate/function pointer to support reverse screen without doing an extra test on each pixels
  3.1002 +            if (cds.ReverseScreen)
  3.1003 +            {
  3.1004 +                iScreenX = ScreenReversedX;
  3.1005 +                iScreenY = ScreenReversedY;
  3.1006 +            }
  3.1007 +            else
  3.1008 +            {
  3.1009 +                iScreenX = ScreenX;
  3.1010 +                iScreenY = ScreenY;
  3.1011 +            }
  3.1012 +
  3.1013 +        }
  3.1014 +
  3.1015 +        //This is our timer tick responsible to perform our render
  3.1016 +        private void timer_Tick(object sender, EventArgs e)
  3.1017 +        {
  3.1018 +            //Not ideal cause this has nothing to do with display render
  3.1019 +            LogsUpdate();
  3.1020 +
  3.1021 +            //Update our animations
  3.1022 +            DateTime NewTickTime = DateTime.Now;
  3.1023 +
  3.1024 +            UpdateNetworkSignal(LastTickTime, NewTickTime);
  3.1025 +
  3.1026 +            //Update animation for all our marquees
  3.1027 +            foreach (Control ctrl in iTableLayoutPanel.Controls)
  3.1028 +            {
  3.1029 +                if (ctrl is MarqueeLabel)
  3.1030 +                {
  3.1031 +                    ((MarqueeLabel) ctrl).UpdateAnimation(LastTickTime, NewTickTime);
  3.1032 +                }
  3.1033 +            }
  3.1034 +
  3.1035 +            //Update our display
  3.1036 +            if (iDisplay.IsOpen())
  3.1037 +            {
  3.1038 +                CheckForRequestResults();
  3.1039 +
  3.1040 +                //Check if frame rendering is needed
  3.1041 +                //Typically used when showing clock
  3.1042 +                if (!iSkipFrameRendering)
  3.1043 +                {
  3.1044 +                    //Draw to bitmap
  3.1045 +                    if (iCreateBitmap)
  3.1046 +                    {
  3.1047 +                        iBmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height,
  3.1048 +                            PixelFormat.Format32bppArgb);
  3.1049 +                        iCreateBitmap = false;
  3.1050 +                    }
  3.1051 +                    iTableLayoutPanel.DrawToBitmap(iBmp, iTableLayoutPanel.ClientRectangle);
  3.1052 +                    //iBmp.Save("D:\\capture.png");
  3.1053 +
  3.1054 +                    //Send it to our display
  3.1055 +                    for (int i = 0; i < iBmp.Width; i++)
  3.1056 +                    {
  3.1057 +                        for (int j = 0; j < iBmp.Height; j++)
  3.1058 +                        {
  3.1059 +                            unchecked
  3.1060 +                            {
  3.1061 +                                //Get our processed pixel coordinates
  3.1062 +                                int x = iScreenX(iBmp, i);
  3.1063 +                                int y = iScreenY(iBmp, j);
  3.1064 +                                //Get pixel color
  3.1065 +                                uint color = (uint) iBmp.GetPixel(i, j).ToArgb();
  3.1066 +                                //Apply color effects
  3.1067 +                                color = iColorFx(x, y, color);
  3.1068 +                                //Now set our pixel
  3.1069 +                                iDisplay.SetPixel(x, y, color);
  3.1070 +                            }
  3.1071 +                        }
  3.1072 +                    }
  3.1073 +
  3.1074 +                    iDisplay.SwapBuffers();
  3.1075 +                }
  3.1076 +            }
  3.1077 +
  3.1078 +            //Compute instant FPS
  3.1079 +            toolStripStatusLabelFps.Text = (1.0/NewTickTime.Subtract(LastTickTime).TotalSeconds).ToString("F0") + " / " +
  3.1080 +                                           (1000/timer.Interval).ToString() + " FPS";
  3.1081 +
  3.1082 +            LastTickTime = NewTickTime;
  3.1083 +
  3.1084 +        }
  3.1085 +
  3.1086 +        /// <summary>
  3.1087 +        /// Attempt to establish connection with our display hardware.
  3.1088 +        /// </summary>
  3.1089 +        private void OpenDisplayConnection()
  3.1090 +        {
  3.1091 +            CloseDisplayConnection();
  3.1092 +
  3.1093 +            if (!iDisplay.Open((MiniDisplay.Type) cds.DisplayType))
  3.1094 +            {
  3.1095 +                UpdateStatus();
  3.1096 +                toolStripStatusLabelConnect.Text = "Connection error";
  3.1097 +            }
  3.1098 +        }
  3.1099 +
  3.1100 +        private void CloseDisplayConnection()
  3.1101 +        {
  3.1102 +            //Status will be updated upon receiving the closed event
  3.1103 +
  3.1104 +            if (iDisplay == null || !iDisplay.IsOpen())
  3.1105 +            {
  3.1106 +                return;
  3.1107 +            }
  3.1108 +
  3.1109 +            //Do not clear if we gave up on rendering already.
  3.1110 +            //This means we will keep on displaying clock on MDM166AA for instance.
  3.1111 +            if (!iSkipFrameRendering)
  3.1112 +            {
  3.1113 +                iDisplay.Clear();
  3.1114 +                iDisplay.SwapBuffers();
  3.1115 +            }
  3.1116 +
  3.1117 +            iDisplay.SetAllIconsStatus(0); //Turn off all icons
  3.1118 +            iDisplay.Close();
  3.1119 +        }
  3.1120 +
  3.1121 +        private void buttonOpen_Click(object sender, EventArgs e)
  3.1122 +        {
  3.1123 +            OpenDisplayConnection();
  3.1124 +        }
  3.1125 +
  3.1126 +        private void buttonClose_Click(object sender, EventArgs e)
  3.1127 +        {
  3.1128 +            CloseDisplayConnection();
  3.1129 +        }
  3.1130 +
  3.1131 +        private void buttonClear_Click(object sender, EventArgs e)
  3.1132 +        {
  3.1133 +            iDisplay.Clear();
  3.1134 +            iDisplay.SwapBuffers();
  3.1135 +        }
  3.1136 +
  3.1137 +        private void buttonFill_Click(object sender, EventArgs e)
  3.1138 +        {
  3.1139 +            iDisplay.Fill();
  3.1140 +            iDisplay.SwapBuffers();
  3.1141 +        }
  3.1142 +
  3.1143 +        private void trackBarBrightness_Scroll(object sender, EventArgs e)
  3.1144 +        {
  3.1145 +            cds.Brightness = trackBarBrightness.Value;
  3.1146 +            Properties.Settings.Default.Save();
  3.1147 +            iDisplay.SetBrightness(trackBarBrightness.Value);
  3.1148 +
  3.1149 +        }
  3.1150 +
  3.1151 +
  3.1152 +        /// <summary>
  3.1153 +        /// CDS stands for Current Display Settings
  3.1154 +        /// </summary>
  3.1155 +        private DisplaySettings cds
  3.1156 +        {
  3.1157 +            get
  3.1158 +            {
  3.1159 +                DisplaysSettings settings = Properties.Settings.Default.DisplaysSettings;
  3.1160 +                if (settings == null)
  3.1161 +                {
  3.1162 +                    settings = new DisplaysSettings();
  3.1163 +                    settings.Init();
  3.1164 +                    Properties.Settings.Default.DisplaysSettings = settings;
  3.1165 +                }
  3.1166 +
  3.1167 +                //Make sure all our settings have been created
  3.1168 +                while (settings.Displays.Count <= Properties.Settings.Default.CurrentDisplayIndex)
  3.1169 +                {
  3.1170 +                    settings.Displays.Add(new DisplaySettings());
  3.1171 +                }
  3.1172 +
  3.1173 +                DisplaySettings displaySettings = settings.Displays[Properties.Settings.Default.CurrentDisplayIndex];
  3.1174 +                return displaySettings;
  3.1175 +            }
  3.1176 +        }
  3.1177 +
  3.1178 +        /// <summary>
  3.1179 +        /// Check if the given font has a fixed character pitch.
  3.1180 +        /// </summary>
  3.1181 +        /// <param name="ft"></param>
  3.1182 +        /// <returns>0.0f if this is not a monospace font, otherwise returns the character width.</returns>
  3.1183 +        public float IsFixedWidth(Font ft)
  3.1184 +        {
  3.1185 +            Graphics g = CreateGraphics();
  3.1186 +            char[] charSizes = new char[] {'i', 'a', 'Z', '%', '#', 'a', 'B', 'l', 'm', ',', '.'};
  3.1187 +            float charWidth = g.MeasureString("I", ft, Int32.MaxValue, StringFormat.GenericTypographic).Width;
  3.1188 +
  3.1189 +            bool fixedWidth = true;
  3.1190 +
  3.1191 +            foreach (char c in charSizes)
  3.1192 +                if (g.MeasureString(c.ToString(), ft, Int32.MaxValue, StringFormat.GenericTypographic).Width !=
  3.1193 +                    charWidth)
  3.1194 +                    fixedWidth = false;
  3.1195 +
  3.1196 +            if (fixedWidth)
  3.1197 +            {
  3.1198 +                return charWidth;
  3.1199 +            }
  3.1200 +
  3.1201 +            return 0.0f;
  3.1202 +        }
  3.1203 +
  3.1204 +        /// <summary>
  3.1205 +        /// Synchronize UI with settings
  3.1206 +        /// </summary>
  3.1207 +        private void UpdateStatus()
  3.1208 +        {
  3.1209 +            //Load settings
  3.1210 +            checkBoxShowBorders.Checked = cds.ShowBorders;
  3.1211 +            iTableLayoutPanel.CellBorderStyle = (cds.ShowBorders
  3.1212 +                ? TableLayoutPanelCellBorderStyle.Single
  3.1213 +                : TableLayoutPanelCellBorderStyle.None);
  3.1214 +
  3.1215 +            //Set the proper font to each of our labels
  3.1216 +            foreach (MarqueeLabel ctrl in iTableLayoutPanel.Controls)
  3.1217 +            {
  3.1218 +                ctrl.Font = cds.Font;
  3.1219 +            }
  3.1220 +
  3.1221 +            CheckFontHeight();
  3.1222 +            //Check if "run on Windows startup" is enabled
  3.1223 +            checkBoxAutoStart.Checked = iStartupManager.Startup;
  3.1224 +            //
  3.1225 +            checkBoxConnectOnStartup.Checked = Properties.Settings.Default.DisplayConnectOnStartup;
  3.1226 +            checkBoxMinimizeToTray.Checked = Properties.Settings.Default.MinimizeToTray;
  3.1227 +            checkBoxStartMinimized.Checked = Properties.Settings.Default.StartMinimized;
  3.1228 +            iCheckBoxStartIdleClient.Checked = Properties.Settings.Default.StartIdleClient;
  3.1229 +            labelStartFileName.Text = Properties.Settings.Default.StartFileName;
  3.1230 +
  3.1231 +
  3.1232 +            //Try find our drive in our drive list
  3.1233 +            int opticalDriveItemIndex = 0;
  3.1234 +            bool driveNotFound = true;
  3.1235 +            string opticalDriveToEject = Properties.Settings.Default.OpticalDriveToEject;
  3.1236 +            foreach (object item in comboBoxOpticalDrives.Items)
  3.1237 +            {
  3.1238 +                if (opticalDriveToEject == item.ToString())
  3.1239 +                {
  3.1240 +                    comboBoxOpticalDrives.SelectedIndex = opticalDriveItemIndex;
  3.1241 +                    driveNotFound = false;
  3.1242 +                    break;
  3.1243 +                }
  3.1244 +                opticalDriveItemIndex++;
  3.1245 +            }
  3.1246 +
  3.1247 +            if (driveNotFound)
  3.1248 +            {
  3.1249 +                //We could not find the drive we had saved.
  3.1250 +                //Select "None" then.
  3.1251 +                comboBoxOpticalDrives.SelectedIndex = 0;
  3.1252 +            }
  3.1253 +
  3.1254 +            //CEC settings
  3.1255 +            checkBoxCecEnabled.Checked = Properties.Settings.Default.CecEnabled;
  3.1256 +            comboBoxHdmiPort.SelectedIndex = Properties.Settings.Default.CecHdmiPort - 1;
  3.1257 +
  3.1258 +            //Mini Display settings
  3.1259 +            checkBoxReverseScreen.Checked = cds.ReverseScreen;
  3.1260 +            checkBoxInverseColors.Checked = cds.InverseColors;
  3.1261 +            checkBoxShowVolumeLabel.Checked = cds.ShowVolumeLabel;
  3.1262 +            checkBoxScaleToFit.Checked = cds.ScaleToFit;
  3.1263 +            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
  3.1264 +            labelMinFontSize.Enabled = cds.ScaleToFit;
  3.1265 +            maskedTextBoxMinFontSize.Text = cds.MinFontSize.ToString();
  3.1266 +            maskedTextBoxScrollingSpeed.Text = cds.ScrollingSpeedInPixelsPerSecond.ToString();
  3.1267 +            comboBoxDisplayType.SelectedIndex = cds.DisplayType;
  3.1268 +            timer.Interval = cds.TimerInterval;
  3.1269 +            maskedTextBoxTimerInterval.Text = cds.TimerInterval.ToString();
  3.1270 +            textBoxScrollLoopSeparator.Text = cds.Separator;
  3.1271 +            //
  3.1272 +            SetupPixelDelegates();
  3.1273 +
  3.1274 +            if (iDisplay.IsOpen())
  3.1275 +            {
  3.1276 +                //We have a display connection
  3.1277 +                //Reflect that in our UI
  3.1278 +                StartTimer();
  3.1279 +
  3.1280 +                iTableLayoutPanel.Enabled = true;
  3.1281 +                panelDisplay.Enabled = true;
  3.1282 +
  3.1283 +                //Only setup brightness if display is open
  3.1284 +                trackBarBrightness.Minimum = iDisplay.MinBrightness();
  3.1285 +                trackBarBrightness.Maximum = iDisplay.MaxBrightness();
  3.1286 +                if (cds.Brightness < iDisplay.MinBrightness() || cds.Brightness > iDisplay.MaxBrightness())
  3.1287 +                {
  3.1288 +                    //Brightness out of range, this can occur when using auto-detect
  3.1289 +                    //Use max brightness instead
  3.1290 +                    trackBarBrightness.Value = iDisplay.MaxBrightness();
  3.1291 +                    iDisplay.SetBrightness(iDisplay.MaxBrightness());
  3.1292 +                }
  3.1293 +                else
  3.1294 +                {
  3.1295 +                    trackBarBrightness.Value = cds.Brightness;
  3.1296 +                    iDisplay.SetBrightness(cds.Brightness);
  3.1297 +                }
  3.1298 +
  3.1299 +                //Try compute the steps to something that makes sense
  3.1300 +                trackBarBrightness.LargeChange = Math.Max(1, (iDisplay.MaxBrightness() - iDisplay.MinBrightness())/5);
  3.1301 +                trackBarBrightness.SmallChange = 1;
  3.1302 +
  3.1303 +                //
  3.1304 +                buttonFill.Enabled = true;
  3.1305 +                buttonClear.Enabled = true;
  3.1306 +                buttonOpen.Enabled = false;
  3.1307 +                buttonClose.Enabled = true;
  3.1308 +                trackBarBrightness.Enabled = true;
  3.1309 +                toolStripStatusLabelConnect.Text = "Connected - " + iDisplay.Vendor() + " - " + iDisplay.Product();
  3.1310 +                //+ " - " + iDisplay.SerialNumber();
  3.1311 +
  3.1312 +                if (iDisplay.SupportPowerOnOff())
  3.1313 +                {
  3.1314 +                    buttonPowerOn.Enabled = true;
  3.1315 +                    buttonPowerOff.Enabled = true;
  3.1316 +                }
  3.1317 +                else
  3.1318 +                {
  3.1319 +                    buttonPowerOn.Enabled = false;
  3.1320 +                    buttonPowerOff.Enabled = false;
  3.1321 +                }
  3.1322 +
  3.1323 +                if (iDisplay.SupportClock())
  3.1324 +                {
  3.1325 +                    buttonShowClock.Enabled = true;
  3.1326 +                    buttonHideClock.Enabled = true;
  3.1327 +                }
  3.1328 +                else
  3.1329 +                {
  3.1330 +                    buttonShowClock.Enabled = false;
  3.1331 +                    buttonHideClock.Enabled = false;
  3.1332 +                }
  3.1333 +
  3.1334 +
  3.1335 +                //Check if Volume Label is supported. To date only MDM166AA supports that crap :)
  3.1336 +                checkBoxShowVolumeLabel.Enabled = iDisplay.IconCount(MiniDisplay.IconType.VolumeLabel) > 0;
  3.1337 +
  3.1338 +                if (cds.ShowVolumeLabel)
  3.1339 +                {
  3.1340 +                    iDisplay.SetIconOn(MiniDisplay.IconType.VolumeLabel);
  3.1341 +                }
  3.1342 +                else
  3.1343 +                {
  3.1344 +                    iDisplay.SetIconOff(MiniDisplay.IconType.VolumeLabel);
  3.1345 +                }
  3.1346 +            }
  3.1347 +            else
  3.1348 +            {
  3.1349 +                //Display connection not available
  3.1350 +                //Reflect that in our UI
  3.1351 +#if DEBUG
  3.1352 +                //In debug start our timer even if we don't have a display connection
  3.1353 +                StartTimer();
  3.1354 +#else
  3.1355 +    //In production environment we don't need our timer if no display connection
  3.1356 +                StopTimer();
  3.1357 +#endif
  3.1358 +                checkBoxShowVolumeLabel.Enabled = false;
  3.1359 +                iTableLayoutPanel.Enabled = false;
  3.1360 +                panelDisplay.Enabled = false;
  3.1361 +                buttonFill.Enabled = false;
  3.1362 +                buttonClear.Enabled = false;
  3.1363 +                buttonOpen.Enabled = true;
  3.1364 +                buttonClose.Enabled = false;
  3.1365 +                trackBarBrightness.Enabled = false;
  3.1366 +                buttonPowerOn.Enabled = false;
  3.1367 +                buttonPowerOff.Enabled = false;
  3.1368 +                buttonShowClock.Enabled = false;
  3.1369 +                buttonHideClock.Enabled = false;
  3.1370 +                toolStripStatusLabelConnect.Text = "Disconnected";
  3.1371 +                toolStripStatusLabelPower.Text = "N/A";
  3.1372 +            }
  3.1373 +
  3.1374 +        }
  3.1375 +
  3.1376 +
  3.1377 +        /// <summary>
  3.1378 +        /// 
  3.1379 +        /// </summary>
  3.1380 +        /// <param name="sender"></param>
  3.1381 +        /// <param name="e"></param>
  3.1382 +        private void checkBoxShowVolumeLabel_CheckedChanged(object sender, EventArgs e)
  3.1383 +        {
  3.1384 +            cds.ShowVolumeLabel = checkBoxShowVolumeLabel.Checked;
  3.1385 +            Properties.Settings.Default.Save();
  3.1386 +            UpdateStatus();
  3.1387 +        }
  3.1388 +
  3.1389 +        private void checkBoxShowBorders_CheckedChanged(object sender, EventArgs e)
  3.1390 +        {
  3.1391 +            //Save our show borders setting
  3.1392 +            iTableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked
  3.1393 +                ? TableLayoutPanelCellBorderStyle.Single
  3.1394 +                : TableLayoutPanelCellBorderStyle.None);
  3.1395 +            cds.ShowBorders = checkBoxShowBorders.Checked;
  3.1396 +            Properties.Settings.Default.Save();
  3.1397 +            CheckFontHeight();
  3.1398 +        }
  3.1399 +
  3.1400 +        private void checkBoxConnectOnStartup_CheckedChanged(object sender, EventArgs e)
  3.1401 +        {
  3.1402 +            //Save our connect on startup setting
  3.1403 +            Properties.Settings.Default.DisplayConnectOnStartup = checkBoxConnectOnStartup.Checked;
  3.1404 +            Properties.Settings.Default.Save();
  3.1405 +        }
  3.1406 +
  3.1407 +        private void checkBoxMinimizeToTray_CheckedChanged(object sender, EventArgs e)
  3.1408 +        {
  3.1409 +            //Save our "Minimize to tray" setting
  3.1410 +            Properties.Settings.Default.MinimizeToTray = checkBoxMinimizeToTray.Checked;
  3.1411 +            Properties.Settings.Default.Save();
  3.1412 +
  3.1413 +        }
  3.1414 +
  3.1415 +        private void checkBoxStartMinimized_CheckedChanged(object sender, EventArgs e)
  3.1416 +        {
  3.1417 +            //Save our "Start minimized" setting
  3.1418 +            Properties.Settings.Default.StartMinimized = checkBoxStartMinimized.Checked;
  3.1419 +            Properties.Settings.Default.Save();
  3.1420 +        }
  3.1421 +
  3.1422 +        private void checkBoxStartIdleClient_CheckedChanged(object sender, EventArgs e)
  3.1423 +        {
  3.1424 +            Properties.Settings.Default.StartIdleClient = iCheckBoxStartIdleClient.Checked;
  3.1425 +            Properties.Settings.Default.Save();
  3.1426 +        }
  3.1427 +
  3.1428 +        private void checkBoxAutoStart_CheckedChanged(object sender, EventArgs e)
  3.1429 +        {
  3.1430 +            iStartupManager.Startup = checkBoxAutoStart.Checked;
  3.1431 +        }
  3.1432 +
  3.1433 +
  3.1434 +        private void checkBoxReverseScreen_CheckedChanged(object sender, EventArgs e)
  3.1435 +        {
  3.1436 +            //Save our reverse screen setting
  3.1437 +            cds.ReverseScreen = checkBoxReverseScreen.Checked;
  3.1438 +            Properties.Settings.Default.Save();
  3.1439 +            SetupPixelDelegates();
  3.1440 +        }
  3.1441 +
  3.1442 +        private void checkBoxInverseColors_CheckedChanged(object sender, EventArgs e)
  3.1443 +        {
  3.1444 +            //Save our inverse colors setting
  3.1445 +            cds.InverseColors = checkBoxInverseColors.Checked;
  3.1446 +            Properties.Settings.Default.Save();
  3.1447 +            SetupPixelDelegates();
  3.1448 +        }
  3.1449 +
  3.1450 +        private void checkBoxScaleToFit_CheckedChanged(object sender, EventArgs e)
  3.1451 +        {
  3.1452 +            //Save our scale to fit setting
  3.1453 +            cds.ScaleToFit = checkBoxScaleToFit.Checked;
  3.1454 +            Properties.Settings.Default.Save();
  3.1455 +            //
  3.1456 +            labelMinFontSize.Enabled = cds.ScaleToFit;
  3.1457 +            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
  3.1458 +        }
  3.1459 +
  3.1460 +        private void MainForm_Resize(object sender, EventArgs e)
  3.1461 +        {
  3.1462 +            if (WindowState == FormWindowState.Minimized)
  3.1463 +            {
  3.1464 +                // To workaround our empty bitmap bug on Windows 7 we need to recreate our bitmap when the application is minimized
  3.1465 +                // That's apparently not needed on Windows 10 but we better leave it in place.
  3.1466 +                iCreateBitmap = true;
  3.1467 +            }
  3.1468 +        }
  3.1469 +
  3.1470 +        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
  3.1471 +        {
  3.1472 +            iCecManager.Stop();
  3.1473 +            iNetworkManager.Dispose();
  3.1474 +            CloseDisplayConnection();
  3.1475 +            StopServer();
  3.1476 +            e.Cancel = iClosing;
  3.1477 +        }
  3.1478 +
  3.1479 +        public void StartServer()
  3.1480 +        {
  3.1481 +            iServiceHost = new ServiceHost
  3.1482 +                (
  3.1483 +                typeof(Session),
  3.1484 +                new Uri[] {new Uri("net.tcp://localhost:8001/")}
  3.1485 +                );
  3.1486 +
  3.1487 +            iServiceHost.AddServiceEndpoint(typeof(IService), new NetTcpBinding(SecurityMode.None, true),
  3.1488 +                "DisplayService");
  3.1489 +            iServiceHost.Open();
  3.1490 +        }
  3.1491 +
  3.1492 +        public void StopServer()
  3.1493 +        {
  3.1494 +            if (iClients.Count > 0 && !iClosing)
  3.1495 +            {
  3.1496 +                //Tell our clients
  3.1497 +                iClosing = true;
  3.1498 +                BroadcastCloseEvent();
  3.1499 +            }
  3.1500 +            else if (iClosing)
  3.1501 +            {
  3.1502 +                if (
  3.1503 +                    MessageBox.Show("Force exit?", "Waiting for clients...", MessageBoxButtons.YesNo,
  3.1504 +                        MessageBoxIcon.Warning) == DialogResult.Yes)
  3.1505 +                {
  3.1506 +                    iClosing = false; //We make sure we force close if asked twice
  3.1507 +                }
  3.1508 +            }
  3.1509 +            else
  3.1510 +            {
  3.1511 +                //We removed that as it often lags for some reason
  3.1512 +                //iServiceHost.Close();
  3.1513 +            }
  3.1514 +        }
  3.1515 +
  3.1516 +        public void BroadcastCloseEvent()
  3.1517 +        {
  3.1518 +            Trace.TraceInformation("BroadcastCloseEvent - start");
  3.1519 +
  3.1520 +            var inactiveClients = new List<string>();
  3.1521 +            foreach (var client in iClients)
  3.1522 +            {
  3.1523 +                //if (client.Key != eventData.ClientName)
  3.1524 +                {
  3.1525 +                    try
  3.1526 +                    {
  3.1527 +                        Trace.TraceInformation("BroadcastCloseEvent - " + client.Key);
  3.1528 +                        client.Value.Callback.OnCloseOrder( /*eventData*/);
  3.1529 +                    }
  3.1530 +                    catch (Exception ex)
  3.1531 +                    {
  3.1532 +                        inactiveClients.Add(client.Key);
  3.1533 +                    }
  3.1534 +                }
  3.1535 +            }
  3.1536 +
  3.1537 +            if (inactiveClients.Count > 0)
  3.1538 +            {
  3.1539 +                foreach (var client in inactiveClients)
  3.1540 +                {
  3.1541 +                    iClients.Remove(client);
  3.1542 +                    Program.iFormMain.iTreeViewClients.Nodes.Remove(
  3.1543 +                        Program.iFormMain.iTreeViewClients.Nodes.Find(client, false)[0]);
  3.1544 +                }
  3.1545 +            }
  3.1546 +
  3.1547 +            if (iClients.Count == 0)
  3.1548 +            {
  3.1549 +                ClearLayout();
  3.1550 +            }
  3.1551 +        }
  3.1552 +
  3.1553 +        /// <summary>
  3.1554 +        /// Just remove all our fields.
  3.1555 +        /// </summary>
  3.1556 +        private void ClearLayout()
  3.1557 +        {
  3.1558 +            iTableLayoutPanel.Controls.Clear();
  3.1559 +            iTableLayoutPanel.RowStyles.Clear();
  3.1560 +            iTableLayoutPanel.ColumnStyles.Clear();
  3.1561 +            iCurrentClientData = null;
  3.1562 +        }
  3.1563 +
  3.1564 +        /// <summary>
  3.1565 +        /// Just launch a demo client.
  3.1566 +        /// </summary>
  3.1567 +        private void StartNewClient(string aTopText = "", string aBottomText = "")
  3.1568 +        {
  3.1569 +            Thread clientThread = new Thread(SharpDisplayClient.Program.MainWithParams);
  3.1570 +            SharpDisplayClient.StartParams myParams = new SharpDisplayClient.StartParams(
  3.1571 +                new Point(this.Right, this.Top), aTopText, aBottomText);
  3.1572 +            clientThread.Start(myParams);
  3.1573 +            BringToFront();
  3.1574 +        }
  3.1575 +
  3.1576 +        /// <summary>
  3.1577 +        /// Just launch our idle client.
  3.1578 +        /// </summary>
  3.1579 +        private void StartIdleClient(string aTopText = "", string aBottomText = "")
  3.1580 +        {
  3.1581 +            Thread clientThread = new Thread(SharpDisplayClientIdle.Program.MainWithParams);
  3.1582 +            SharpDisplayClientIdle.StartParams myParams =
  3.1583 +                new SharpDisplayClientIdle.StartParams(new Point(this.Right, this.Top), aTopText, aBottomText);
  3.1584 +            clientThread.Start(myParams);
  3.1585 +            BringToFront();
  3.1586 +        }
  3.1587 +
  3.1588 +
  3.1589 +        private void buttonStartClient_Click(object sender, EventArgs e)
  3.1590 +        {
  3.1591 +            StartNewClient();
  3.1592 +        }
  3.1593 +
  3.1594 +        private void buttonSuspend_Click(object sender, EventArgs e)
  3.1595 +        {
  3.1596 +            ToggleTimer();
  3.1597 +        }
  3.1598 +
  3.1599 +        private void StartTimer()
  3.1600 +        {
  3.1601 +            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  3.1602 +            timer.Enabled = true;
  3.1603 +            UpdateSuspendButton();
  3.1604 +        }
  3.1605 +
  3.1606 +        private void StopTimer()
  3.1607 +        {
  3.1608 +            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  3.1609 +            timer.Enabled = false;
  3.1610 +            UpdateSuspendButton();
  3.1611 +        }
  3.1612 +
  3.1613 +        private void ToggleTimer()
  3.1614 +        {
  3.1615 +            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  3.1616 +            timer.Enabled = !timer.Enabled;
  3.1617 +            UpdateSuspendButton();
  3.1618 +        }
  3.1619 +
  3.1620 +        private void UpdateSuspendButton()
  3.1621 +        {
  3.1622 +            if (!timer.Enabled)
  3.1623 +            {
  3.1624 +                buttonSuspend.Text = "Run";
  3.1625 +            }
  3.1626 +            else
  3.1627 +            {
  3.1628 +                buttonSuspend.Text = "Pause";
  3.1629 +            }
  3.1630 +        }
  3.1631 +
  3.1632 +
  3.1633 +        private void buttonCloseClients_Click(object sender, EventArgs e)
  3.1634 +        {
  3.1635 +            BroadcastCloseEvent();
  3.1636 +        }
  3.1637 +
  3.1638 +        private void treeViewClients_AfterSelect(object sender, TreeViewEventArgs e)
  3.1639 +        {
  3.1640 +            //Root node must have at least one child
  3.1641 +            if (e.Node.Nodes.Count == 0)
  3.1642 +            {
  3.1643 +                return;
  3.1644 +            }
  3.1645 +
  3.1646 +            //If the selected node is the root node of a client then switch to it
  3.1647 +            string sessionId = e.Node.Nodes[0].Text; //First child of a root node is the sessionId
  3.1648 +            if (iClients.ContainsKey(sessionId)) //Check that's actually what we are looking at
  3.1649 +            {
  3.1650 +                //We have a valid session just switch to that client
  3.1651 +                SetCurrentClient(sessionId, true);
  3.1652 +            }
  3.1653 +
  3.1654 +        }
  3.1655 +
  3.1656 +
  3.1657 +        /// <summary>
  3.1658 +        ///
  3.1659 +        /// </summary>
  3.1660 +        /// <param name="aSessionId"></param>
  3.1661 +        /// <param name="aCallback"></param>
  3.1662 +        public void AddClientThreadSafe(string aSessionId, ICallback aCallback)
  3.1663 +        {
  3.1664 +            if (this.InvokeRequired)
  3.1665 +            {
  3.1666 +                //Not in the proper thread, invoke ourselves
  3.1667 +                AddClientDelegate d = new AddClientDelegate(AddClientThreadSafe);
  3.1668 +                this.Invoke(d, new object[] {aSessionId, aCallback});
  3.1669 +            }
  3.1670 +            else
  3.1671 +            {
  3.1672 +                //We are in the proper thread
  3.1673 +                //Add this session to our collection of clients
  3.1674 +                ClientData newClient = new ClientData(aSessionId, aCallback);
  3.1675 +                Program.iFormMain.iClients.Add(aSessionId, newClient);
  3.1676 +                //Add this session to our UI
  3.1677 +                UpdateClientTreeViewNode(newClient);
  3.1678 +            }
  3.1679 +        }
  3.1680 +
  3.1681 +
  3.1682 +        /// <summary>
  3.1683 +        /// Find the client with the highest priority if any.
  3.1684 +        /// </summary>
  3.1685 +        /// <returns>Our highest priority client or null if not a single client is connected.</returns>
  3.1686 +        public ClientData FindHighestPriorityClient()
  3.1687 +        {
  3.1688 +            ClientData highestPriorityClient = null;
  3.1689 +            foreach (var client in iClients)
  3.1690 +            {
  3.1691 +                if (highestPriorityClient == null || client.Value.Priority > highestPriorityClient.Priority)
  3.1692 +                {
  3.1693 +                    highestPriorityClient = client.Value;
  3.1694 +                }
  3.1695 +            }
  3.1696 +
  3.1697 +            return highestPriorityClient;
  3.1698 +        }
  3.1699 +
  3.1700 +        /// <summary>
  3.1701 +        ///
  3.1702 +        /// </summary>
  3.1703 +        /// <param name="aSessionId"></param>
  3.1704 +        public void RemoveClientThreadSafe(string aSessionId)
  3.1705 +        {
  3.1706 +            if (this.InvokeRequired)
  3.1707 +            {
  3.1708 +                //Not in the proper thread, invoke ourselves
  3.1709 +                RemoveClientDelegate d = new RemoveClientDelegate(RemoveClientThreadSafe);
  3.1710 +                this.Invoke(d, new object[] {aSessionId});
  3.1711 +            }
  3.1712 +            else
  3.1713 +            {
  3.1714 +                //We are in the proper thread
  3.1715 +                //Remove this session from both client collection and UI tree view
  3.1716 +                if (Program.iFormMain.iClients.Keys.Contains(aSessionId))
  3.1717 +                {
  3.1718 +                    Program.iFormMain.iClients.Remove(aSessionId);
  3.1719 +                    Program.iFormMain.iTreeViewClients.Nodes.Remove(
  3.1720 +                        Program.iFormMain.iTreeViewClients.Nodes.Find(aSessionId, false)[0]);
  3.1721 +                    //Update recording status too whenever a client is removed
  3.1722 +                    UpdateRecordingNotification();
  3.1723 +                }
  3.1724 +
  3.1725 +                if (iCurrentClientSessionId == aSessionId)
  3.1726 +                {
  3.1727 +                    //The current client is closing
  3.1728 +                    iCurrentClientData = null;
  3.1729 +                    //Find the client with the highest priority and set it as current
  3.1730 +                    ClientData newCurrentClient = FindHighestPriorityClient();
  3.1731 +                    if (newCurrentClient != null)
  3.1732 +                    {
  3.1733 +                        SetCurrentClient(newCurrentClient.SessionId, true);
  3.1734 +                    }
  3.1735 +                }
  3.1736 +
  3.1737 +                if (iClients.Count == 0)
  3.1738 +                {
  3.1739 +                    //Clear our screen when last client disconnects
  3.1740 +                    ClearLayout();
  3.1741 +
  3.1742 +                    if (iClosing)
  3.1743 +                    {
  3.1744 +                        //We were closing our form
  3.1745 +                        //All clients are now closed
  3.1746 +                        //Just resume our close operation
  3.1747 +                        iClosing = false;
  3.1748 +                        Close();
  3.1749 +                    }
  3.1750 +                }
  3.1751 +            }
  3.1752 +        }
  3.1753 +
  3.1754 +        /// <summary>
  3.1755 +        ///
  3.1756 +        /// </summary>
  3.1757 +        /// <param name="aSessionId"></param>
  3.1758 +        /// <param name="aLayout"></param>
  3.1759 +        public void SetClientLayoutThreadSafe(string aSessionId, TableLayout aLayout)
  3.1760 +        {
  3.1761 +            if (this.InvokeRequired)
  3.1762 +            {
  3.1763 +                //Not in the proper thread, invoke ourselves
  3.1764 +                SetLayoutDelegate d = new SetLayoutDelegate(SetClientLayoutThreadSafe);
  3.1765 +                this.Invoke(d, new object[] {aSessionId, aLayout});
  3.1766 +            }
  3.1767 +            else
  3.1768 +            {
  3.1769 +                ClientData client = iClients[aSessionId];
  3.1770 +                if (client != null)
  3.1771 +                {
  3.1772 +                    //Don't change a thing if the layout is the same
  3.1773 +                    if (!client.Layout.IsSameAs(aLayout))
  3.1774 +                    {
  3.1775 +                        Debug.Print("SetClientLayoutThreadSafe: Layout updated.");
  3.1776 +                        //Set our client layout then
  3.1777 +                        client.Layout = aLayout;
  3.1778 +                        //So that next time we update all our fields at ones
  3.1779 +                        client.HasNewLayout = true;
  3.1780 +                        //Layout has changed clear our fields then
  3.1781 +                        client.Fields.Clear();
  3.1782 +                        //
  3.1783 +                        UpdateClientTreeViewNode(client);
  3.1784 +                    }
  3.1785 +                    else
  3.1786 +                    {
  3.1787 +                        Debug.Print("SetClientLayoutThreadSafe: Layout has not changed.");
  3.1788 +                    }
  3.1789 +                }
  3.1790 +            }
  3.1791 +        }
  3.1792 +
  3.1793 +        /// <summary>
  3.1794 +        ///
  3.1795 +        /// </summary>
  3.1796 +        /// <param name="aSessionId"></param>
  3.1797 +        /// <param name="aField"></param>
  3.1798 +        public void SetClientFieldThreadSafe(string aSessionId, DataField aField)
  3.1799 +        {
  3.1800 +            if (this.InvokeRequired)
  3.1801 +            {
  3.1802 +                //Not in the proper thread, invoke ourselves
  3.1803 +                SetFieldDelegate d = new SetFieldDelegate(SetClientFieldThreadSafe);
  3.1804 +                this.Invoke(d, new object[] {aSessionId, aField});
  3.1805 +            }
  3.1806 +            else
  3.1807 +            {
  3.1808 +                //We are in the proper thread
  3.1809 +                //Call the non-thread-safe variant
  3.1810 +                SetClientField(aSessionId, aField);
  3.1811 +            }
  3.1812 +        }
  3.1813 +
  3.1814 +
  3.1815 +
  3.1816 +
  3.1817 +        /// <summary>
  3.1818 +        /// Set a data field in the given client.
  3.1819 +        /// </summary>
  3.1820 +        /// <param name="aSessionId"></param>
  3.1821 +        /// <param name="aField"></param>
  3.1822 +        private void SetClientField(string aSessionId, DataField aField)
  3.1823 +        {
  3.1824 +            //TODO: should check if the field actually changed?
  3.1825 +
  3.1826 +            ClientData client = iClients[aSessionId];
  3.1827 +            bool layoutChanged = false;
  3.1828 +            bool contentChanged = true;
  3.1829 +
  3.1830 +            //Fetch our field index
  3.1831 +            int fieldIndex = client.FindSameFieldIndex(aField);
  3.1832 +
  3.1833 +            if (fieldIndex < 0)
  3.1834 +            {
  3.1835 +                //No corresponding field, just bail out
  3.1836 +                return;
  3.1837 +            }
  3.1838 +
  3.1839 +            //Keep our previous field in there
  3.1840 +            DataField previousField = client.Fields[fieldIndex];
  3.1841 +            //Just update that field then 
  3.1842 +            client.Fields[fieldIndex] = aField;
  3.1843 +
  3.1844 +            if (!aField.IsTableField)
  3.1845 +            {
  3.1846 +                //We are done then if that field is not in our table layout
  3.1847 +                return;
  3.1848 +            }
  3.1849 +
  3.1850 +            TableField tableField = (TableField) aField;
  3.1851 +
  3.1852 +            if (previousField.IsSameLayout(aField))
  3.1853 +            {
  3.1854 +                //If we are updating a field in our current client we need to update it in our panel
  3.1855 +                if (aSessionId == iCurrentClientSessionId)
  3.1856 +                {
  3.1857 +                    Control ctrl = iTableLayoutPanel.GetControlFromPosition(tableField.Column, tableField.Row);
  3.1858 +                    if (aField.IsTextField && ctrl is MarqueeLabel)
  3.1859 +                    {
  3.1860 +                        TextField textField = (TextField) aField;
  3.1861 +                        //Text field control already in place, just change the text
  3.1862 +                        MarqueeLabel label = (MarqueeLabel) ctrl;
  3.1863 +                        contentChanged = (label.Text != textField.Text || label.TextAlign != textField.Alignment);
  3.1864 +                        label.Text = textField.Text;
  3.1865 +                        label.TextAlign = textField.Alignment;
  3.1866 +                    }
  3.1867 +                    else if (aField.IsBitmapField && ctrl is PictureBox)
  3.1868 +                    {
  3.1869 +                        BitmapField bitmapField = (BitmapField) aField;
  3.1870 +                        contentChanged = true; //TODO: Bitmap comp or should we leave that to clients?
  3.1871 +                        //Bitmap field control already in place just change the bitmap
  3.1872 +                        PictureBox pictureBox = (PictureBox) ctrl;
  3.1873 +                        pictureBox.Image = bitmapField.Bitmap;
  3.1874 +                    }
  3.1875 +                    else
  3.1876 +                    {
  3.1877 +                        layoutChanged = true;
  3.1878 +                    }
  3.1879 +                }
  3.1880 +            }
  3.1881 +            else
  3.1882 +            {
  3.1883 +                layoutChanged = true;
  3.1884 +            }
  3.1885 +
  3.1886 +            //If either content or layout changed we need to update our tree view to reflect the changes
  3.1887 +            if (contentChanged || layoutChanged)
  3.1888 +            {
  3.1889 +                UpdateClientTreeViewNode(client);
  3.1890 +                //
  3.1891 +                if (layoutChanged)
  3.1892 +                {
  3.1893 +                    Debug.Print("Layout changed");
  3.1894 +                    //Our layout has changed, if we are already the current client we need to update our panel
  3.1895 +                    if (aSessionId == iCurrentClientSessionId)
  3.1896 +                    {
  3.1897 +                        //Apply layout and set data fields.
  3.1898 +                        UpdateTableLayoutPanel(iCurrentClientData);
  3.1899 +                    }
  3.1900 +                }
  3.1901 +                else
  3.1902 +                {
  3.1903 +                    Debug.Print("Layout has not changed.");
  3.1904 +                }
  3.1905 +            }
  3.1906 +            else
  3.1907 +            {
  3.1908 +                Debug.Print("WARNING: content and layout have not changed!");
  3.1909 +            }
  3.1910 +
  3.1911 +            //When a client field is set we try switching to this client to present the new information to our user
  3.1912 +            SetCurrentClient(aSessionId);
  3.1913 +        }
  3.1914 +
  3.1915 +        /// <summary>
  3.1916 +        ///
  3.1917 +        /// </summary>
  3.1918 +        /// <param name="aTexts"></param>
  3.1919 +        public void SetClientFieldsThreadSafe(string aSessionId, System.Collections.Generic.IList<DataField> aFields)
  3.1920 +        {
  3.1921 +            if (this.InvokeRequired)
  3.1922 +            {
  3.1923 +                //Not in the proper thread, invoke ourselves
  3.1924 +                SetFieldsDelegate d = new SetFieldsDelegate(SetClientFieldsThreadSafe);
  3.1925 +                this.Invoke(d, new object[] {aSessionId, aFields});
  3.1926 +            }
  3.1927 +            else
  3.1928 +            {
  3.1929 +                ClientData client = iClients[aSessionId];
  3.1930 +
  3.1931 +                if (client.HasNewLayout)
  3.1932 +                {
  3.1933 +                    //TODO: Assert client.Count == 0
  3.1934 +                    //Our layout was just changed
  3.1935 +                    //Do some special handling to avoid re-creating our panel N times, once for each fields
  3.1936 +                    client.HasNewLayout = false;
  3.1937 +                    //Just set all our fields then
  3.1938 +                    client.Fields.AddRange(aFields);
  3.1939 +                    //Try switch to that client
  3.1940 +                    SetCurrentClient(aSessionId);
  3.1941 +
  3.1942 +                    //If we are updating the current client update our panel
  3.1943 +                    if (aSessionId == iCurrentClientSessionId)
  3.1944 +                    {
  3.1945 +                        //Apply layout and set data fields.
  3.1946 +                        UpdateTableLayoutPanel(iCurrentClientData);
  3.1947 +                    }
  3.1948 +
  3.1949 +                    UpdateClientTreeViewNode(client);
  3.1950 +                }
  3.1951 +                else
  3.1952 +                {
  3.1953 +                    //Put each our text fields in a label control
  3.1954 +                    foreach (DataField field in aFields)
  3.1955 +                    {
  3.1956 +                        SetClientField(aSessionId, field);
  3.1957 +                    }
  3.1958 +                }
  3.1959 +            }
  3.1960 +        }
  3.1961 +
  3.1962 +        /// <summary>
  3.1963 +        ///
  3.1964 +        /// </summary>
  3.1965 +        /// <param name="aSessionId"></param>
  3.1966 +        /// <param name="aName"></param>
  3.1967 +        public void SetClientNameThreadSafe(string aSessionId, string aName)
  3.1968 +        {
  3.1969 +            if (this.InvokeRequired)
  3.1970 +            {
  3.1971 +                //Not in the proper thread, invoke ourselves
  3.1972 +                SetClientNameDelegate d = new SetClientNameDelegate(SetClientNameThreadSafe);
  3.1973 +                this.Invoke(d, new object[] {aSessionId, aName});
  3.1974 +            }
  3.1975 +            else
  3.1976 +            {
  3.1977 +                //We are in the proper thread
  3.1978 +                //Get our client
  3.1979 +                ClientData client = iClients[aSessionId];
  3.1980 +                if (client != null)
  3.1981 +                {
  3.1982 +                    //Set its name
  3.1983 +                    client.Name = aName;
  3.1984 +                    //Update our tree-view
  3.1985 +                    UpdateClientTreeViewNode(client);
  3.1986 +                }
  3.1987 +            }
  3.1988 +        }
  3.1989 +
  3.1990 +        ///
  3.1991 +        public void SetClientPriorityThreadSafe(string aSessionId, uint aPriority)
  3.1992 +        {
  3.1993 +            if (this.InvokeRequired)
  3.1994 +            {
  3.1995 +                //Not in the proper thread, invoke ourselves
  3.1996 +                SetClientPriorityDelegate d = new SetClientPriorityDelegate(SetClientPriorityThreadSafe);
  3.1997 +                this.Invoke(d, new object[] {aSessionId, aPriority});
  3.1998 +            }
  3.1999 +            else
  3.2000 +            {
  3.2001 +                //We are in the proper thread
  3.2002 +                //Get our client
  3.2003 +                ClientData client = iClients[aSessionId];
  3.2004 +                if (client != null)
  3.2005 +                {
  3.2006 +                    //Set its name
  3.2007 +                    client.Priority = aPriority;
  3.2008 +                    //Update our tree-view
  3.2009 +                    UpdateClientTreeViewNode(client);
  3.2010 +                    //Change our current client as per new priority
  3.2011 +                    ClientData newCurrentClient = FindHighestPriorityClient();
  3.2012 +                    if (newCurrentClient != null)
  3.2013 +                    {
  3.2014 +                        SetCurrentClient(newCurrentClient.SessionId);
  3.2015 +                    }
  3.2016 +                }
  3.2017 +            }
  3.2018 +        }
  3.2019 +
  3.2020 +        /// <summary>
  3.2021 +        /// 
  3.2022 +        /// </summary>
  3.2023 +        /// <param name="value"></param>
  3.2024 +        /// <param name="maxChars"></param>
  3.2025 +        /// <returns></returns>
  3.2026 +        public static string Truncate(string value, int maxChars)
  3.2027 +        {
  3.2028 +            return value.Length <= maxChars ? value : value.Substring(0, maxChars - 3) + "...";
  3.2029 +        }
  3.2030 +
  3.2031 +        /// <summary>
  3.2032 +        /// Update our recording notification.
  3.2033 +        /// </summary>
  3.2034 +        private void UpdateRecordingNotification()
  3.2035 +        {
  3.2036 +            //Go through each 
  3.2037 +            bool activeRecording = false;
  3.2038 +            string text = "";
  3.2039 +            RecordingField recField = new RecordingField();
  3.2040 +            foreach (var client in iClients)
  3.2041 +            {
  3.2042 +                RecordingField rec = (RecordingField) client.Value.FindSameFieldAs(recField);
  3.2043 +                if (rec != null && rec.IsActive)
  3.2044 +                {
  3.2045 +                    activeRecording = true;
  3.2046 +                    //Don't break cause we are collecting the names/texts.
  3.2047 +                    if (!String.IsNullOrEmpty(rec.Text))
  3.2048 +                    {
  3.2049 +                        text += (rec.Text + "\n");
  3.2050 +                    }
  3.2051 +                    else
  3.2052 +                    {
  3.2053 +                        //Not text for that recording, use client name instead
  3.2054 +                        text += client.Value.Name + " recording\n";
  3.2055 +                    }
  3.2056 +
  3.2057 +                }
  3.2058 +            }
  3.2059 +
  3.2060 +            //Update our text no matter what, can't have more than 63 characters otherwise it throws an exception.
  3.2061 +            iRecordingNotification.Text = Truncate(text, 63);
  3.2062 +
  3.2063 +            //Change visibility of notification if needed
  3.2064 +            if (iRecordingNotification.Visible != activeRecording)
  3.2065 +            {
  3.2066 +                iRecordingNotification.Visible = activeRecording;
  3.2067 +                //Assuming the notification icon is in sync with our display icon
  3.2068 +                //Take care of our REC icon
  3.2069 +                if (iDisplay.IsOpen())
  3.2070 +                {
  3.2071 +                    iDisplay.SetIconOnOff(MiniDisplay.IconType.Recording, activeRecording);
  3.2072 +                }
  3.2073 +            }
  3.2074 +        }
  3.2075 +
  3.2076 +        /// <summary>
  3.2077 +        ///
  3.2078 +        /// </summary>
  3.2079 +        /// <param name="aClient"></param>
  3.2080 +        private void UpdateClientTreeViewNode(ClientData aClient)
  3.2081 +        {
  3.2082 +            Debug.Print("UpdateClientTreeViewNode");
  3.2083 +
  3.2084 +            if (aClient == null)
  3.2085 +            {
  3.2086 +                return;
  3.2087 +            }
  3.2088 +
  3.2089 +            //Hook in record icon update too
  3.2090 +            UpdateRecordingNotification();
  3.2091 +
  3.2092 +            TreeNode node = null;
  3.2093 +            //Check that our client node already exists
  3.2094 +            //Get our client root node using its key which is our session ID
  3.2095 +            TreeNode[] nodes = iTreeViewClients.Nodes.Find(aClient.SessionId, false);
  3.2096 +            if (nodes.Count() > 0)
  3.2097 +            {
  3.2098 +                //We already have a node for that client
  3.2099 +                node = nodes[0];
  3.2100 +                //Clear children as we are going to recreate them below
  3.2101 +                node.Nodes.Clear();
  3.2102 +            }
  3.2103 +            else
  3.2104 +            {
  3.2105 +                //Client node does not exists create a new one
  3.2106 +                iTreeViewClients.Nodes.Add(aClient.SessionId, aClient.SessionId);
  3.2107 +                node = iTreeViewClients.Nodes.Find(aClient.SessionId, false)[0];
  3.2108 +            }
  3.2109 +
  3.2110 +            if (node != null)
  3.2111 +            {
  3.2112 +                //Change its name
  3.2113 +                if (!String.IsNullOrEmpty(aClient.Name))
  3.2114 +                {
  3.2115 +                    //We have a name, use it as text for our root node
  3.2116 +                    node.Text = aClient.Name;
  3.2117 +                    //Add a child with SessionId
  3.2118 +                    node.Nodes.Add(new TreeNode(aClient.SessionId));
  3.2119 +                }
  3.2120 +                else
  3.2121 +                {
  3.2122 +                    //No name, use session ID instead
  3.2123 +                    node.Text = aClient.SessionId;
  3.2124 +                }
  3.2125 +
  3.2126 +                //Display client priority
  3.2127 +                node.Nodes.Add(new TreeNode("Priority: " + aClient.Priority));
  3.2128 +
  3.2129 +                if (aClient.Fields.Count > 0)
  3.2130 +                {
  3.2131 +                    //Create root node for our texts
  3.2132 +                    TreeNode textsRoot = new TreeNode("Fields");
  3.2133 +                    node.Nodes.Add(textsRoot);
  3.2134 +                    //For each text add a new entry
  3.2135 +                    foreach (DataField field in aClient.Fields)
  3.2136 +                    {
  3.2137 +                        if (field.IsTextField)
  3.2138 +                        {
  3.2139 +                            TextField textField = (TextField) field;
  3.2140 +                            textsRoot.Nodes.Add(new TreeNode("[Text]" + textField.Text));
  3.2141 +                        }
  3.2142 +                        else if (field.IsBitmapField)
  3.2143 +                        {
  3.2144 +                            textsRoot.Nodes.Add(new TreeNode("[Bitmap]"));
  3.2145 +                        }
  3.2146 +                        else if (field.IsRecordingField)
  3.2147 +                        {
  3.2148 +                            RecordingField recordingField = (RecordingField) field;
  3.2149 +                            textsRoot.Nodes.Add(new TreeNode("[Recording]" + recordingField.IsActive));
  3.2150 +                        }
  3.2151 +                    }
  3.2152 +                }
  3.2153 +
  3.2154 +                node.ExpandAll();
  3.2155 +            }
  3.2156 +        }
  3.2157 +
  3.2158 +        /// <summary>
  3.2159 +        /// Update our table layout row styles to make sure each rows have similar height
  3.2160 +        /// </summary>
  3.2161 +        private void UpdateTableLayoutRowStyles()
  3.2162 +        {
  3.2163 +            foreach (RowStyle rowStyle in iTableLayoutPanel.RowStyles)
  3.2164 +            {
  3.2165 +                rowStyle.SizeType = SizeType.Percent;
  3.2166 +                rowStyle.Height = 100/iTableLayoutPanel.RowCount;
  3.2167 +            }
  3.2168 +        }
  3.2169 +
  3.2170 +        /// <summary>
  3.2171 +        /// Update our display table layout.
  3.2172 +        /// Will instanciated every field control as defined by our client.
  3.2173 +        /// Fields must be specified by rows from the left.
  3.2174 +        /// </summary>
  3.2175 +        /// <param name="aLayout"></param>
  3.2176 +        private void UpdateTableLayoutPanel(ClientData aClient)
  3.2177 +        {
  3.2178 +            Debug.Print("UpdateTableLayoutPanel");
  3.2179 +
  3.2180 +            if (aClient == null)
  3.2181 +            {
  3.2182 +                //Just drop it
  3.2183 +                return;
  3.2184 +            }
  3.2185 +
  3.2186 +
  3.2187 +            TableLayout layout = aClient.Layout;
  3.2188 +
  3.2189 +            //First clean our current panel
  3.2190 +            iTableLayoutPanel.Controls.Clear();
  3.2191 +            iTableLayoutPanel.RowStyles.Clear();
  3.2192 +            iTableLayoutPanel.ColumnStyles.Clear();
  3.2193 +            iTableLayoutPanel.RowCount = 0;
  3.2194 +            iTableLayoutPanel.ColumnCount = 0;
  3.2195 +
  3.2196 +            //Then recreate our rows...
  3.2197 +            while (iTableLayoutPanel.RowCount < layout.Rows.Count)
  3.2198 +            {
  3.2199 +                iTableLayoutPanel.RowCount++;
  3.2200 +            }
  3.2201 +
  3.2202 +            // ...and columns 
  3.2203 +            while (iTableLayoutPanel.ColumnCount < layout.Columns.Count)
  3.2204 +            {
  3.2205 +                iTableLayoutPanel.ColumnCount++;
  3.2206 +            }
  3.2207 +
  3.2208 +            //For each column
  3.2209 +            for (int i = 0; i < iTableLayoutPanel.ColumnCount; i++)
  3.2210 +            {
  3.2211 +                //Create our column styles
  3.2212 +                this.iTableLayoutPanel.ColumnStyles.Add(layout.Columns[i]);
  3.2213 +
  3.2214 +                //For each rows
  3.2215 +                for (int j = 0; j < iTableLayoutPanel.RowCount; j++)
  3.2216 +                {
  3.2217 +                    if (i == 0)
  3.2218 +                    {
  3.2219 +                        //Create our row styles
  3.2220 +                        this.iTableLayoutPanel.RowStyles.Add(layout.Rows[j]);
  3.2221 +                    }
  3.2222 +                    else
  3.2223 +                    {
  3.2224 +                        continue;
  3.2225 +                    }
  3.2226 +                }
  3.2227 +            }
  3.2228 +
  3.2229 +            //For each field
  3.2230 +            foreach (DataField field in aClient.Fields)
  3.2231 +            {
  3.2232 +                if (!field.IsTableField)
  3.2233 +                {
  3.2234 +                    //That field is not taking part in our table layout skip it
  3.2235 +                    continue;
  3.2236 +                }
  3.2237 +
  3.2238 +                TableField tableField = (TableField) field;
  3.2239 +
  3.2240 +                //Create a control corresponding to the field specified for that cell
  3.2241 +                Control control = CreateControlForDataField(tableField);
  3.2242 +
  3.2243 +                //Add newly created control to our table layout at the specified row and column
  3.2244 +                iTableLayoutPanel.Controls.Add(control, tableField.Column, tableField.Row);
  3.2245 +                //Make sure we specify column and row span for that new control
  3.2246 +                iTableLayoutPanel.SetColumnSpan(control, tableField.ColumnSpan);
  3.2247 +                iTableLayoutPanel.SetRowSpan(control, tableField.RowSpan);
  3.2248 +            }
  3.2249 +
  3.2250 +
  3.2251 +            CheckFontHeight();
  3.2252 +        }
  3.2253 +
  3.2254 +        /// <summary>
  3.2255 +        /// Check our type of data field and create corresponding control
  3.2256 +        /// </summary>
  3.2257 +        /// <param name="aField"></param>
  3.2258 +        private Control CreateControlForDataField(DataField aField)
  3.2259 +        {
  3.2260 +            Control control = null;
  3.2261 +            if (aField.IsTextField)
  3.2262 +            {
  3.2263 +                MarqueeLabel label = new SharpDisplayManager.MarqueeLabel();
  3.2264 +                label.AutoEllipsis = true;
  3.2265 +                label.AutoSize = true;
  3.2266 +                label.BackColor = System.Drawing.Color.Transparent;
  3.2267 +                label.Dock = System.Windows.Forms.DockStyle.Fill;
  3.2268 +                label.Location = new System.Drawing.Point(1, 1);
  3.2269 +                label.Margin = new System.Windows.Forms.Padding(0);
  3.2270 +                label.Name = "marqueeLabel" + aField;
  3.2271 +                label.OwnTimer = false;
  3.2272 +                label.PixelsPerSecond = cds.ScrollingSpeedInPixelsPerSecond;
  3.2273 +                label.Separator = cds.Separator;
  3.2274 +                label.MinFontSize = cds.MinFontSize;
  3.2275 +                label.ScaleToFit = cds.ScaleToFit;
  3.2276 +                //control.Size = new System.Drawing.Size(254, 30);
  3.2277 +                //control.TabIndex = 2;
  3.2278 +                label.Font = cds.Font;
  3.2279 +
  3.2280 +                TextField field = (TextField) aField;
  3.2281 +                label.TextAlign = field.Alignment;
  3.2282 +                label.UseCompatibleTextRendering = true;
  3.2283 +                label.Text = field.Text;
  3.2284 +                //
  3.2285 +                control = label;
  3.2286 +            }
  3.2287 +            else if (aField.IsBitmapField)
  3.2288 +            {
  3.2289 +                //Create picture box
  3.2290 +                PictureBox picture = new PictureBox();
  3.2291 +                picture.AutoSize = true;
  3.2292 +                picture.BackColor = System.Drawing.Color.Transparent;
  3.2293 +                picture.Dock = System.Windows.Forms.DockStyle.Fill;
  3.2294 +                picture.Location = new System.Drawing.Point(1, 1);
  3.2295 +                picture.Margin = new System.Windows.Forms.Padding(0);
  3.2296 +                picture.Name = "pictureBox" + aField;
  3.2297 +                //Set our image
  3.2298 +                BitmapField field = (BitmapField) aField;
  3.2299 +                picture.Image = field.Bitmap;
  3.2300 +                //
  3.2301 +                control = picture;
  3.2302 +            }
  3.2303 +            //TODO: Handle recording field?
  3.2304 +
  3.2305 +            return control;
  3.2306 +        }
  3.2307 +
  3.2308 +        /// <summary>
  3.2309 +        /// Called when the user selected a new display type.
  3.2310 +        /// </summary>
  3.2311 +        /// <param name="sender"></param>
  3.2312 +        /// <param name="e"></param>
  3.2313 +        private void comboBoxDisplayType_SelectedIndexChanged(object sender, EventArgs e)
  3.2314 +        {
  3.2315 +            //Store the selected display type in our settings
  3.2316 +            Properties.Settings.Default.CurrentDisplayIndex = comboBoxDisplayType.SelectedIndex;
  3.2317 +            cds.DisplayType = comboBoxDisplayType.SelectedIndex;
  3.2318 +            Properties.Settings.Default.Save();
  3.2319 +
  3.2320 +            //Try re-opening the display connection if we were already connected.
  3.2321 +            //Otherwise just update our status to reflect display type change.
  3.2322 +            if (iDisplay.IsOpen())
  3.2323 +            {
  3.2324 +                OpenDisplayConnection();
  3.2325 +            }
  3.2326 +            else
  3.2327 +            {
  3.2328 +                UpdateStatus();
  3.2329 +            }
  3.2330 +        }
  3.2331 +
  3.2332 +        private void maskedTextBoxTimerInterval_TextChanged(object sender, EventArgs e)
  3.2333 +        {
  3.2334 +            if (maskedTextBoxTimerInterval.Text != "")
  3.2335 +            {
  3.2336 +                int interval = Convert.ToInt32(maskedTextBoxTimerInterval.Text);
  3.2337 +
  3.2338 +                if (interval > 0)
  3.2339 +                {
  3.2340 +                    timer.Interval = interval;
  3.2341 +                    cds.TimerInterval = timer.Interval;
  3.2342 +                    Properties.Settings.Default.Save();
  3.2343 +                }
  3.2344 +            }
  3.2345 +        }
  3.2346 +
  3.2347 +        private void maskedTextBoxMinFontSize_TextChanged(object sender, EventArgs e)
  3.2348 +        {
  3.2349 +            if (maskedTextBoxMinFontSize.Text != "")
  3.2350 +            {
  3.2351 +                int minFontSize = Convert.ToInt32(maskedTextBoxMinFontSize.Text);
  3.2352 +
  3.2353 +                if (minFontSize > 0)
  3.2354 +                {
  3.2355 +                    cds.MinFontSize = minFontSize;
  3.2356 +                    Properties.Settings.Default.Save();
  3.2357 +                    //We need to recreate our layout for that change to take effect
  3.2358 +                    UpdateTableLayoutPanel(iCurrentClientData);
  3.2359 +                }
  3.2360 +            }
  3.2361 +        }
  3.2362 +
  3.2363 +
  3.2364 +        private void maskedTextBoxScrollingSpeed_TextChanged(object sender, EventArgs e)
  3.2365 +        {
  3.2366 +            if (maskedTextBoxScrollingSpeed.Text != "")
  3.2367 +            {
  3.2368 +                int scrollingSpeed = Convert.ToInt32(maskedTextBoxScrollingSpeed.Text);
  3.2369 +
  3.2370 +                if (scrollingSpeed > 0)
  3.2371 +                {
  3.2372 +                    cds.ScrollingSpeedInPixelsPerSecond = scrollingSpeed;
  3.2373 +                    Properties.Settings.Default.Save();
  3.2374 +                    //We need to recreate our layout for that change to take effect
  3.2375 +                    UpdateTableLayoutPanel(iCurrentClientData);
  3.2376 +                }
  3.2377 +            }
  3.2378 +        }
  3.2379 +
  3.2380 +        private void textBoxScrollLoopSeparator_TextChanged(object sender, EventArgs e)
  3.2381 +        {
  3.2382 +            cds.Separator = textBoxScrollLoopSeparator.Text;
  3.2383 +            Properties.Settings.Default.Save();
  3.2384 +
  3.2385 +            //Update our text fields
  3.2386 +            foreach (MarqueeLabel ctrl in iTableLayoutPanel.Controls)
  3.2387 +            {
  3.2388 +                ctrl.Separator = cds.Separator;
  3.2389 +            }
  3.2390 +
  3.2391 +        }
  3.2392 +
  3.2393 +        private void buttonPowerOn_Click(object sender, EventArgs e)
  3.2394 +        {
  3.2395 +            iDisplay.PowerOn();
  3.2396 +        }
  3.2397 +
  3.2398 +        private void buttonPowerOff_Click(object sender, EventArgs e)
  3.2399 +        {
  3.2400 +            iDisplay.PowerOff();
  3.2401 +        }
  3.2402 +
  3.2403 +        private void buttonShowClock_Click(object sender, EventArgs e)
  3.2404 +        {
  3.2405 +            ShowClock();
  3.2406 +        }
  3.2407 +
  3.2408 +        private void buttonHideClock_Click(object sender, EventArgs e)
  3.2409 +        {
  3.2410 +            HideClock();
  3.2411 +        }
  3.2412 +
  3.2413 +        private void buttonUpdate_Click(object sender, EventArgs e)
  3.2414 +        {
  3.2415 +            InstallUpdateSyncWithInfo();
  3.2416 +        }
  3.2417 +
  3.2418 +        /// <summary>
  3.2419 +        /// 
  3.2420 +        /// </summary>
  3.2421 +        void ShowClock()
  3.2422 +        {
  3.2423 +            if (!iDisplay.IsOpen())
  3.2424 +            {
  3.2425 +                return;
  3.2426 +            }
  3.2427 +
  3.2428 +            //Devices like MDM166AA don't support windowing and frame rendering must be stopped while showing our clock
  3.2429 +            iSkipFrameRendering = true;
  3.2430 +            //Clear our screen 
  3.2431 +            iDisplay.Clear();
  3.2432 +            iDisplay.SwapBuffers();
  3.2433 +            //Then show our clock
  3.2434 +            iDisplay.ShowClock();
  3.2435 +        }
  3.2436 +
  3.2437 +        /// <summary>
  3.2438 +        /// 
  3.2439 +        /// </summary>
  3.2440 +        void HideClock()
  3.2441 +        {
  3.2442 +            if (!iDisplay.IsOpen())
  3.2443 +            {
  3.2444 +                return;
  3.2445 +            }
  3.2446 +
  3.2447 +            //Devices like MDM166AA don't support windowing and frame rendering must be stopped while showing our clock
  3.2448 +            iSkipFrameRendering = false;
  3.2449 +            iDisplay.HideClock();
  3.2450 +        }
  3.2451 +
  3.2452 +        private void InstallUpdateSyncWithInfo()
  3.2453 +        {
  3.2454 +            UpdateCheckInfo info = null;
  3.2455 +
  3.2456 +            if (ApplicationDeployment.IsNetworkDeployed)
  3.2457 +            {
  3.2458 +                ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
  3.2459 +
  3.2460 +                try
  3.2461 +                {
  3.2462 +                    info = ad.CheckForDetailedUpdate();
  3.2463 +
  3.2464 +                }
  3.2465 +                catch (DeploymentDownloadException dde)
  3.2466 +                {
  3.2467 +                    MessageBox.Show(
  3.2468 +                        "The new version of the application cannot be downloaded at this time. \n\nPlease check your network connection, or try again later. Error: " +
  3.2469 +                        dde.Message);
  3.2470 +                    return;
  3.2471 +                }
  3.2472 +                catch (InvalidDeploymentException ide)
  3.2473 +                {
  3.2474 +                    MessageBox.Show(
  3.2475 +                        "Cannot check for a new version of the application. The ClickOnce deployment is corrupt. Please redeploy the application and try again. Error: " +
  3.2476 +                        ide.Message);
  3.2477 +                    return;
  3.2478 +                }
  3.2479 +                catch (InvalidOperationException ioe)
  3.2480 +                {
  3.2481 +                    MessageBox.Show(
  3.2482 +                        "This application cannot be updated. It is likely not a ClickOnce application. Error: " +
  3.2483 +                        ioe.Message);
  3.2484 +                    return;
  3.2485 +                }
  3.2486 +
  3.2487 +                if (info.UpdateAvailable)
  3.2488 +                {
  3.2489 +                    Boolean doUpdate = true;
  3.2490 +
  3.2491 +                    if (!info.IsUpdateRequired)
  3.2492 +                    {
  3.2493 +                        DialogResult dr =
  3.2494 +                            MessageBox.Show("An update is available. Would you like to update the application now?",
  3.2495 +                                "Update Available", MessageBoxButtons.OKCancel);
  3.2496 +                        if (!(DialogResult.OK == dr))
  3.2497 +                        {
  3.2498 +                            doUpdate = false;
  3.2499 +                        }
  3.2500 +                    }
  3.2501 +                    else
  3.2502 +                    {
  3.2503 +                        // Display a message that the application MUST reboot. Display the minimum required version.
  3.2504 +                        MessageBox.Show("This application has detected a mandatory update from your current " +
  3.2505 +                                        "version to version " + info.MinimumRequiredVersion.ToString() +
  3.2506 +                                        ". The application will now install the update and restart.",
  3.2507 +                            "Update Available", MessageBoxButtons.OK,
  3.2508 +                            MessageBoxIcon.Information);
  3.2509 +                    }
  3.2510 +
  3.2511 +                    if (doUpdate)
  3.2512 +                    {
  3.2513 +                        try
  3.2514 +                        {
  3.2515 +                            ad.Update();
  3.2516 +                            MessageBox.Show("The application has been upgraded, and will now restart.");
  3.2517 +                            Application.Restart();
  3.2518 +                        }
  3.2519 +                        catch (DeploymentDownloadException dde)
  3.2520 +                        {
  3.2521 +                            MessageBox.Show(
  3.2522 +                                "Cannot install the latest version of the application. \n\nPlease check your network connection, or try again later. Error: " +
  3.2523 +                                dde);
  3.2524 +                            return;
  3.2525 +                        }
  3.2526 +                    }
  3.2527 +                }
  3.2528 +                else
  3.2529 +                {
  3.2530 +                    MessageBox.Show("You are already running the latest version.", "Application up-to-date");
  3.2531 +                }
  3.2532 +            }
  3.2533 +        }
  3.2534 +
  3.2535 +
  3.2536 +        /// <summary>
  3.2537 +        /// Used to
  3.2538 +        /// </summary>
  3.2539 +        private void SysTrayHideShow()
  3.2540 +        {
  3.2541 +            Visible = !Visible;
  3.2542 +            if (Visible)
  3.2543 +            {
  3.2544 +                Activate();
  3.2545 +                WindowState = FormWindowState.Normal;
  3.2546 +            }
  3.2547 +        }
  3.2548 +
  3.2549 +        /// <summary>
  3.2550 +        /// Use to handle minimize events.
  3.2551 +        /// </summary>
  3.2552 +        /// <param name="sender"></param>
  3.2553 +        /// <param name="e"></param>
  3.2554 +        private void MainForm_SizeChanged(object sender, EventArgs e)
  3.2555 +        {
  3.2556 +            if (WindowState == FormWindowState.Minimized && Properties.Settings.Default.MinimizeToTray)
  3.2557 +            {
  3.2558 +                if (Visible)
  3.2559 +                {
  3.2560 +                    SysTrayHideShow();
  3.2561 +                }
  3.2562 +            }
  3.2563 +        }
  3.2564 +
  3.2565 +        /// <summary>
  3.2566 +        /// 
  3.2567 +        /// </summary>
  3.2568 +        /// <param name="sender"></param>
  3.2569 +        /// <param name="e"></param>
  3.2570 +        private void tableLayoutPanel_SizeChanged(object sender, EventArgs e)
  3.2571 +        {
  3.2572 +            //Our table layout size has changed which means our display size has changed.
  3.2573 +            //We need to re-create our bitmap.
  3.2574 +            iCreateBitmap = true;
  3.2575 +        }
  3.2576 +
  3.2577 +        /// <summary>
  3.2578 +        /// 
  3.2579 +        /// </summary>
  3.2580 +        /// <param name="sender"></param>
  3.2581 +        /// <param name="e"></param>
  3.2582 +        private void buttonSelectFile_Click(object sender, EventArgs e)
  3.2583 +        {
  3.2584 +            //openFileDialog1.InitialDirectory = "c:\\";
  3.2585 +            //openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
  3.2586 +            //openFileDialog.FilterIndex = 1;
  3.2587 +            openFileDialog.RestoreDirectory = true;
  3.2588 +
  3.2589 +            if (DlgBox.ShowDialog(openFileDialog) == DialogResult.OK)
  3.2590 +            {
  3.2591 +                labelStartFileName.Text = openFileDialog.FileName;
  3.2592 +                Properties.Settings.Default.StartFileName = openFileDialog.FileName;
  3.2593 +                Properties.Settings.Default.Save();
  3.2594 +            }
  3.2595 +        }
  3.2596 +
  3.2597 +        /// <summary>
  3.2598 +        /// 
  3.2599 +        /// </summary>
  3.2600 +        /// <param name="sender"></param>
  3.2601 +        /// <param name="e"></param>
  3.2602 +        private void comboBoxOpticalDrives_SelectedIndexChanged(object sender, EventArgs e)
  3.2603 +        {
  3.2604 +            //Save the optical drive the user selected for ejection
  3.2605 +            Properties.Settings.Default.OpticalDriveToEject = comboBoxOpticalDrives.SelectedItem.ToString();
  3.2606 +            Properties.Settings.Default.Save();
  3.2607 +        }
  3.2608 +
  3.2609 +
  3.2610 +        /// <summary>
  3.2611 +        /// 
  3.2612 +        /// </summary>
  3.2613 +        private void LogsUpdate()
  3.2614 +        {
  3.2615 +            if (iWriter != null)
  3.2616 +            {
  3.2617 +                iWriter.Flush();
  3.2618 +            }
  3.2619 +
  3.2620 +        }
  3.2621 +
  3.2622 +        /// <summary>
  3.2623 +        /// Broadcast messages to subscribers.
  3.2624 +        /// </summary>
  3.2625 +        /// <param name="message"></param>
  3.2626 +        protected override void WndProc(ref Message aMessage)
  3.2627 +        {
  3.2628 +            LogsUpdate();
  3.2629 +
  3.2630 +            if (OnWndProc != null)
  3.2631 +            {
  3.2632 +                OnWndProc(ref aMessage);
  3.2633 +            }
  3.2634 +
  3.2635 +            base.WndProc(ref aMessage);
  3.2636 +        }
  3.2637 +
  3.2638 +        private void checkBoxCecEnabled_CheckedChanged(object sender, EventArgs e)
  3.2639 +        {
  3.2640 +            //Save CEC enabled status
  3.2641 +            Properties.Settings.Default.CecEnabled = checkBoxCecEnabled.Checked;
  3.2642 +            Properties.Settings.Default.Save();
  3.2643 +            //
  3.2644 +            ResetCec();
  3.2645 +        }
  3.2646 +
  3.2647 +        private void comboBoxHdmiPort_SelectedIndexChanged(object sender, EventArgs e)
  3.2648 +        {
  3.2649 +            //Save CEC HDMI port
  3.2650 +            Properties.Settings.Default.CecHdmiPort = Convert.ToByte(comboBoxHdmiPort.SelectedIndex);
  3.2651 +            Properties.Settings.Default.CecHdmiPort++;
  3.2652 +            Properties.Settings.Default.Save();
  3.2653 +            //
  3.2654 +            ResetCec();
  3.2655 +        }
  3.2656 +
  3.2657 +        /// <summary>
  3.2658 +        /// 
  3.2659 +        /// </summary>
  3.2660 +        private void ResetCec()
  3.2661 +        {
  3.2662 +            if (iCecManager == null)
  3.2663 +            {
  3.2664 +                //Thus skipping initial UI setup
  3.2665 +                return;
  3.2666 +            }
  3.2667 +
  3.2668 +            iCecManager.Stop();
  3.2669 +            //
  3.2670 +            if (Properties.Settings.Default.CecEnabled)
  3.2671 +            {
  3.2672 +                iCecManager.Start(Handle, "CEC",
  3.2673 +                    Properties.Settings.Default.CecHdmiPort);
  3.2674 +
  3.2675 +                SetupCecLogLevel();
  3.2676 +            }
  3.2677 +        }
  3.2678 +
  3.2679 +        /// <summary>
  3.2680 +        /// 
  3.2681 +        /// </summary>
  3.2682 +        private void SetupCecLogLevel()
  3.2683 +        {
  3.2684 +            //Setup log level
  3.2685 +            iCecManager.Client.LogLevel = 0;
  3.2686 +
  3.2687 +            if (checkBoxCecLogError.Checked)
  3.2688 +                iCecManager.Client.LogLevel |= (int) CecLogLevel.Error;
  3.2689 +
  3.2690 +            if (checkBoxCecLogWarning.Checked)
  3.2691 +                iCecManager.Client.LogLevel |= (int) CecLogLevel.Warning;
  3.2692 +
  3.2693 +            if (checkBoxCecLogNotice.Checked)
  3.2694 +                iCecManager.Client.LogLevel |= (int) CecLogLevel.Notice;
  3.2695 +
  3.2696 +            if (checkBoxCecLogTraffic.Checked)
  3.2697 +                iCecManager.Client.LogLevel |= (int) CecLogLevel.Traffic;
  3.2698 +
  3.2699 +            if (checkBoxCecLogDebug.Checked)
  3.2700 +                iCecManager.Client.LogLevel |= (int) CecLogLevel.Debug;
  3.2701 +
  3.2702 +            iCecManager.Client.FilterOutPollLogs = checkBoxCecLogNoPoll.Checked;
  3.2703 +
  3.2704 +        }
  3.2705 +
  3.2706 +        private void ButtonStartIdleClient_Click(object sender, EventArgs e)
  3.2707 +        {
  3.2708 +            StartIdleClient();
  3.2709 +        }
  3.2710 +
  3.2711 +        private void buttonClearLogs_Click(object sender, EventArgs e)
  3.2712 +        {
  3.2713 +            richTextBoxLogs.Clear();
  3.2714 +        }
  3.2715 +
  3.2716 +        private void checkBoxCecLogs_CheckedChanged(object sender, EventArgs e)
  3.2717 +        {
  3.2718 +            SetupCecLogLevel();
  3.2719 +        }
  3.2720 +
  3.2721 +
  3.2722 +        /// <summary>
  3.2723 +        /// 
  3.2724 +        /// </summary>
  3.2725 +        /// <param name="aEvent"></param>
  3.2726 +        private void SelectEvent(Event aEvent)
  3.2727 +        {
  3.2728 +            if (aEvent == null)
  3.2729 +            {
  3.2730 +                return;
  3.2731 +            }
  3.2732 +
  3.2733 +            string key = aEvent.GetType().Name;
  3.2734 +            TreeNode[] res = iTreeViewEvents.Nodes.Find(key, false);
  3.2735 +            if (res.Length > 0)
  3.2736 +            {
  3.2737 +                iTreeViewEvents.SelectedNode = res[0];
  3.2738 +                iTreeViewEvents.Focus();
  3.2739 +            }
  3.2740 +        }
  3.2741 +
  3.2742 +
  3.2743 +
  3.2744 +        /// <summary>
  3.2745 +        /// Get the current event based on event tree view selection.
  3.2746 +        /// </summary>
  3.2747 +        /// <returns></returns>
  3.2748 +        private Event CurrentEvent()
  3.2749 +        {
  3.2750 +            //Walk up the tree from the selected node to find our event
  3.2751 +            TreeNode node = iTreeViewEvents.SelectedNode;
  3.2752 +            Event selectedEvent = null;
  3.2753 +            while (node != null)
  3.2754 +            {
  3.2755 +                if (node.Tag is Event)
  3.2756 +                {
  3.2757 +                    selectedEvent = (Event) node.Tag;
  3.2758 +                    break;
  3.2759 +                }
  3.2760 +                node = node.Parent;
  3.2761 +            }
  3.2762 +
  3.2763 +            return selectedEvent;
  3.2764 +        }
  3.2765 +
  3.2766 +        /// <summary>
  3.2767 +        /// Get the current action based on event tree view selection
  3.2768 +        /// </summary>
  3.2769 +        /// <returns></returns>
  3.2770 +        private SharpLib.Ear.Action CurrentAction()
  3.2771 +        {
  3.2772 +            TreeNode node = iTreeViewEvents.SelectedNode;
  3.2773 +            if (node != null && node.Tag is SharpLib.Ear.Action)
  3.2774 +            {
  3.2775 +                return (SharpLib.Ear.Action) node.Tag;
  3.2776 +            }
  3.2777 +
  3.2778 +            return null;
  3.2779 +        }
  3.2780 +
  3.2781 +        /// <summary>
  3.2782 +        /// 
  3.2783 +        /// </summary>
  3.2784 +        /// <param name="sender"></param>
  3.2785 +        /// <param name="e"></param>
  3.2786 +        private void buttonAddAction_Click(object sender, EventArgs e)
  3.2787 +        {
  3.2788 +            Event selectedEvent = CurrentEvent();
  3.2789 +            if (selectedEvent == null)
  3.2790 +            {
  3.2791 +                //We did not find a corresponding event
  3.2792 +                return;
  3.2793 +            }
  3.2794 +
  3.2795 +            FormEditAction ea = new FormEditAction();
  3.2796 +            DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
  3.2797 +            if (res == DialogResult.OK)
  3.2798 +            {
  3.2799 +                selectedEvent.Actions.Add(ea.Action);
  3.2800 +                Properties.Settings.Default.Actions = ManagerEventAction.Current;
  3.2801 +                Properties.Settings.Default.Save();
  3.2802 +                PopulateEventsTreeView();
  3.2803 +            }
  3.2804 +        }
  3.2805 +
  3.2806 +        /// <summary>
  3.2807 +        /// 
  3.2808 +        /// </summary>
  3.2809 +        /// <param name="sender"></param>
  3.2810 +        /// <param name="e"></param>
  3.2811 +        private void buttonDeleteAction_Click(object sender, EventArgs e)
  3.2812 +        {
  3.2813 +
  3.2814 +            SharpLib.Ear.Action action = CurrentAction();
  3.2815 +            if (action == null)
  3.2816 +            {
  3.2817 +                //Must select action node
  3.2818 +                return;
  3.2819 +            }
  3.2820 +
  3.2821 +            ManagerEventAction.Current.RemoveAction(action);
  3.2822 +            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  3.2823 +            Properties.Settings.Default.Save();
  3.2824 +            PopulateEventsTreeView();
  3.2825 +        }
  3.2826 +
  3.2827 +        private void iTreeViewEvents_AfterSelect(object sender, TreeViewEventArgs e)
  3.2828 +        {
  3.2829 +            //Enable buttons according to selected item
  3.2830 +            buttonAddAction.Enabled = CurrentEvent() != null;
  3.2831 +
  3.2832 +            SharpLib.Ear.Action currentAction = CurrentAction();
  3.2833 +            //If an action is selected enable the following buttons
  3.2834 +            buttonTestAction.Enabled =
  3.2835 +            buttonDeleteAction.Enabled =
  3.2836 +            buttonActionMoveUp.Enabled =
  3.2837 +            buttonActionMoveDown.Enabled =
  3.2838 +                    currentAction != null;
  3.2839 +    
  3.2840 +            if (currentAction != null)
  3.2841 +            {
  3.2842 +                //If an action is selected enable move buttons if needed
  3.2843 +                buttonActionMoveUp.Enabled = iTreeViewEvents.SelectedNode.Index != 0;
  3.2844 +                buttonActionMoveDown.Enabled = iTreeViewEvents.SelectedNode.Index <
  3.2845 +                                               iTreeViewEvents.SelectedNode.Parent.Nodes.Count - 1;
  3.2846 +            }
  3.2847 +
  3.2848 +        }
  3.2849 +
  3.2850 +        /// <summary>
  3.2851 +        /// 
  3.2852 +        /// </summary>
  3.2853 +        /// <param name="sender"></param>
  3.2854 +        /// <param name="e"></param>
  3.2855 +        private void buttonTestAction_Click(object sender, EventArgs e)
  3.2856 +        {
  3.2857 +            SharpLib.Ear.Action a = CurrentAction();
  3.2858 +            if (a != null)
  3.2859 +            {
  3.2860 +                Console.WriteLine("Action test run");
  3.2861 +                a.Execute();
  3.2862 +            }
  3.2863 +            iTreeViewEvents.Focus();
  3.2864 +        }
  3.2865 +
  3.2866 +        /// <summary>
  3.2867 +        /// 
  3.2868 +        /// </summary>
  3.2869 +        /// <param name="sender"></param>
  3.2870 +        /// <param name="e"></param>
  3.2871 +        private void buttonActionMoveUp_Click(object sender, EventArgs e)
  3.2872 +        {
  3.2873 +            SharpLib.Ear.Action a = CurrentAction();
  3.2874 +            if (a == null || 
  3.2875 +                //Action already at the top of the list
  3.2876 +                iTreeViewEvents.SelectedNode.Index == 0)
  3.2877 +            {
  3.2878 +                return;
  3.2879 +            }
  3.2880 +
  3.2881 +            //Swap actions in event's action list
  3.2882 +            Event currentEvent = CurrentEvent();
  3.2883 +            int currentIndex = iTreeViewEvents.SelectedNode.Index;
  3.2884 +            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex];
  3.2885 +            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex-1];
  3.2886 +            currentEvent.Actions[currentIndex] = movingDown;
  3.2887 +            currentEvent.Actions[currentIndex-1] = movingUp;
  3.2888 +
  3.2889 +            //Save and populate our tree again
  3.2890 +            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  3.2891 +            Properties.Settings.Default.Save();
  3.2892 +            PopulateEventsTreeView();
  3.2893 +
  3.2894 +        }
  3.2895 +
  3.2896 +        /// <summary>
  3.2897 +        /// 
  3.2898 +        /// </summary>
  3.2899 +        /// <param name="sender"></param>
  3.2900 +        /// <param name="e"></param>
  3.2901 +        private void buttonActionMoveDown_Click(object sender, EventArgs e)
  3.2902 +        {
  3.2903 +            SharpLib.Ear.Action a = CurrentAction();
  3.2904 +            if (a == null ||
  3.2905 +                //Action already at the bottom of the list
  3.2906 +                iTreeViewEvents.SelectedNode.Index == iTreeViewEvents.SelectedNode.Parent.Nodes.Count - 1)
  3.2907 +            {
  3.2908 +                return;
  3.2909 +            }
  3.2910 +
  3.2911 +            //Swap actions in event's action list
  3.2912 +            Event currentEvent = CurrentEvent();
  3.2913 +            int currentIndex = iTreeViewEvents.SelectedNode.Index;
  3.2914 +            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex];
  3.2915 +            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex + 1];
  3.2916 +            currentEvent.Actions[currentIndex] = movingUp;
  3.2917 +            currentEvent.Actions[currentIndex + 1] = movingDown;
  3.2918 +
  3.2919 +            //Save and populate our tree again
  3.2920 +            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  3.2921 +            Properties.Settings.Default.Save();
  3.2922 +            PopulateEventsTreeView();
  3.2923 +        }
  3.2924 +    }
  3.2925 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Server/FormMain.resx	Fri Jul 29 10:40:15 2016 +0200
     4.3 @@ -0,0 +1,418 @@
     4.4 +<?xml version="1.0" encoding="utf-8"?>
     4.5 +<root>
     4.6 +  <!-- 
     4.7 +    Microsoft ResX Schema 
     4.8 +    
     4.9 +    Version 2.0
    4.10 +    
    4.11 +    The primary goals of this format is to allow a simple XML format 
    4.12 +    that is mostly human readable. The generation and parsing of the 
    4.13 +    various data types are done through the TypeConverter classes 
    4.14 +    associated with the data types.
    4.15 +    
    4.16 +    Example:
    4.17 +    
    4.18 +    ... ado.net/XML headers & schema ...
    4.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
    4.20 +    <resheader name="version">2.0</resheader>
    4.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    4.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    4.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    4.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    4.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    4.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
    4.27 +    </data>
    4.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    4.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    4.30 +        <comment>This is a comment</comment>
    4.31 +    </data>
    4.32 +                
    4.33 +    There are any number of "resheader" rows that contain simple 
    4.34 +    name/value pairs.
    4.35 +    
    4.36 +    Each data row contains a name, and value. The row also contains a 
    4.37 +    type or mimetype. Type corresponds to a .NET class that support 
    4.38 +    text/value conversion through the TypeConverter architecture. 
    4.39 +    Classes that don't support this are serialized and stored with the 
    4.40 +    mimetype set.
    4.41 +    
    4.42 +    The mimetype is used for serialized objects, and tells the 
    4.43 +    ResXResourceReader how to depersist the object. This is currently not 
    4.44 +    extensible. For a given mimetype the value must be set accordingly:
    4.45 +    
    4.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
    4.47 +    that the ResXResourceWriter will generate, however the reader can 
    4.48 +    read any of the formats listed below.
    4.49 +    
    4.50 +    mimetype: application/x-microsoft.net.object.binary.base64
    4.51 +    value   : The object must be serialized with 
    4.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    4.53 +            : and then encoded with base64 encoding.
    4.54 +    
    4.55 +    mimetype: application/x-microsoft.net.object.soap.base64
    4.56 +    value   : The object must be serialized with 
    4.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
    4.58 +            : and then encoded with base64 encoding.
    4.59 +
    4.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
    4.61 +    value   : The object must be serialized into a byte array 
    4.62 +            : using a System.ComponentModel.TypeConverter
    4.63 +            : and then encoded with base64 encoding.
    4.64 +    -->
    4.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    4.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    4.67 +    <xsd:element name="root" msdata:IsDataSet="true">
    4.68 +      <xsd:complexType>
    4.69 +        <xsd:choice maxOccurs="unbounded">
    4.70 +          <xsd:element name="metadata">
    4.71 +            <xsd:complexType>
    4.72 +              <xsd:sequence>
    4.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    4.74 +              </xsd:sequence>
    4.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
    4.76 +              <xsd:attribute name="type" type="xsd:string" />
    4.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
    4.78 +              <xsd:attribute ref="xml:space" />
    4.79 +            </xsd:complexType>
    4.80 +          </xsd:element>
    4.81 +          <xsd:element name="assembly">
    4.82 +            <xsd:complexType>
    4.83 +              <xsd:attribute name="alias" type="xsd:string" />
    4.84 +              <xsd:attribute name="name" type="xsd:string" />
    4.85 +            </xsd:complexType>
    4.86 +          </xsd:element>
    4.87 +          <xsd:element name="data">
    4.88 +            <xsd:complexType>
    4.89 +              <xsd:sequence>
    4.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    4.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    4.92 +              </xsd:sequence>
    4.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    4.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    4.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    4.96 +              <xsd:attribute ref="xml:space" />
    4.97 +            </xsd:complexType>
    4.98 +          </xsd:element>
    4.99 +          <xsd:element name="resheader">
   4.100 +            <xsd:complexType>
   4.101 +              <xsd:sequence>
   4.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   4.103 +              </xsd:sequence>
   4.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
   4.105 +            </xsd:complexType>
   4.106 +          </xsd:element>
   4.107 +        </xsd:choice>
   4.108 +      </xsd:complexType>
   4.109 +    </xsd:element>
   4.110 +  </xsd:schema>
   4.111 +  <resheader name="resmimetype">
   4.112 +    <value>text/microsoft-resx</value>
   4.113 +  </resheader>
   4.114 +  <resheader name="version">
   4.115 +    <value>2.0</value>
   4.116 +  </resheader>
   4.117 +  <resheader name="reader">
   4.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   4.119 +  </resheader>
   4.120 +  <resheader name="writer">
   4.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   4.122 +  </resheader>
   4.123 +  <metadata name="fontDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   4.124 +    <value>17, 17</value>
   4.125 +  </metadata>
   4.126 +  <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   4.127 +    <value>126, 17</value>
   4.128 +  </metadata>
   4.129 +  <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   4.130 +    <value>206, 17</value>
   4.131 +  </metadata>
   4.132 +  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   4.133 +    <value>315, 17</value>
   4.134 +  </metadata>
   4.135 +  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   4.136 +  <data name="pictureBoxGreenStart.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   4.137 +    <value>
   4.138 +        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAC45JREFUWEd9
   4.139 +        lgdYVUcaho8l+Ohq1FWwETR2TSJIiRpsQEQEgiDVRkeqgoj0cvEiICASuYgKdhGJ2BAJKmKLLUaxoy4W
   4.140 +        0ICiWFcwbrLvzsGymrB7nue9d+7cmf/75p9yRuJ1yH+B/0kfG0ld4CEoFjQK6GunRl97NeSy4HfBfkGw
   4.141 +        QKulGO/5QPOjHy01FsGGCzK17NowYHpHBjh3QS+gP45KM2xijZpxEuVRcwczYHYXBszoJIx9IhtaJ/i6
   4.142 +        pZgfan70488NRYAkWXiIWxeMQ3RYmO1N7p4Mth/aRP6BXPL3v0WUC8s3sqZ4OcEqd3Tm9GGwaxf62Tcb
   4.143 +        WSro/FHsDzTfF/79238NiA5afayllUOcO2EUOoLU/Gi2la//WLQFtrz93vhjNnMzZqLvq8kwYV7E2vBh
   4.144 +        NvQ92n1sQBZvrnwj/pUsPsKrK25LvmPTjytYv1fFuuLMj9n7J/7yv4r1JarmGCO8uvGZbWvZiOU7A+9M
   4.145 +        NH/83rTgvYHeU6VVej7qeKVZs2pXKqptiW8oTHrD9iSydrSAqH/fRrTPfNsve2cKXqnW6PtpoDmtlTwl
   4.146 +        n39kQB79y2eBzRXC4XIdz66YhX5J6pYokjaEvWFTGMmbw1lZsIg9u1Qc2LOSwp1LUW2NIyU/gpQtb1iS
   4.147 +        F96M3DZpYxiJoq/Mkk2RmIfqoC8GJg/wnQFZW/pXU7B0v9ZXFrccNqsDhvN64p/uSES2TzORq3yIzvHj
   4.148 +        eGEWz0u287RwLc+25fCiaAMvDmzjzLZ00tfNI3adLzFrBWt8icr1IWq16L/Sh/AsGW98U20Z5aeOttun
   4.149 +        sgl/2cDrxmBJanweKFVccZVTXzpxfm8MvLrjl+qAT6q9MOLA3O8dUap8qE+P40GcD/cX2lEfacejODse
   4.150 +        p7jwSGlHTpojqqKFhOc6Mz/LiSDBvEwnApY54pvmIMQd8UmxQ9+jOyYhfd5NRZt/Pg2UpIZ6f6m3lWQ0
   4.151 +        wrUTE+f3Eo00cE6YgmviFNxTLfBMsyQrxYP6Rb48CDLnYagpj2NNeZZkypNlltRmOxGYZkV5pZIj1zJZ
   4.152 +        XRpO3EZ3woSZmHVzyNwRR95BFc7x5hi492BsgAajvLshNF3r6/wkqabaWx59oVmYJqN8uqLj2h372PHM
   4.153 +        UE5kdrIRLikmHFjixUPFbOqDxvEkxpAXKYY0qgx5st6MEzkWhOaasuuyFdsv2FB8MYD9lxdz4OJyyi6s
   4.154 +        ofhMNvOWz8Q2fLyIrY6+Z2csIvvK03Dy5k0vSd52alpii9gp+qPn8SnDZv6NqVEG2MaPwil5DI6JY6hS
   4.155 +        uvMwwpLHYiG9SNahMUuHpvW6PNrxLdmZE0jfa8y+Kkt+uKTDhjM6ZB/VI/OAMbnlXuSdzsBRMQWLBfoM
   4.156 +        FaektsvfsI7+nAGOn9D7O6mbnH5DPc9PsYnui657RwbOUMM0dChTFdrYJY3ESzmeu5H2VC6y4mrubKq2
   4.157 +        TKN2mxGPi8ZQV27CnAQ9dlc6cPCuDbtujGTLhcHknvqCnKMmbD4xj7S90UwJ1sN43hAGOrXjq9kdsAzX
   4.158 +        ZFyA2BFW0kxJuAgwXdBTuNJC16MTw1zbMzpIHcv4YVgnDUeRaEFCpCMhSgdcIybiHTOZmMTZFG7z4/Ax
   4.159 +        O9wzDDn+IJhDdY4U3/6GgqsD2XB2KJtOTWbruQg8ltljHDxEnIo9GDyrPV+4dBRbsg9WkVpyBlKlXpZS
   4.160 +        gnWUFrYxWuh7dxanVkcMgjpjquiLVdJA7JaYEZC7lNDtpcQdvk50aRmBG5VMjR6Jb/LXxOy259jzJRxu
   4.161 +        8KO0xojCa4PYXDGY/Ipp5F9OZFLEaMaFaKLj15nhYguOcO/Cd2GfMX3RANlAntTLQvreKb4/TvGfMzqg
   4.162 +        G7oBXTEME9tF2QOL5H54rz7JjLW3GL26Du28F0zb/5pll/7NussNzFg2AZulX+Jf7kzGg6Xk3I8kq9qZ
   4.163 +        lBtexF1ahMsOT4wiBjEmTJ2vF2ig7dMN+ZS1ie6Ha9IQxOB3Sj2nSIsd4/rhsWQ440N6MSqkJ0YKTcxS
   4.164 +        BPGm6Icfp3PQWdTi7qD2/VM0N7/CfP8fRPzSiEumPsfPf4+/aiJjg3tirBzCpOUjGa8YxDdBPXCKG4ZR
   4.165 +        nIin1MRQZFkvSFPUf8asxcNwSxYGLEQGek6W/KeKRRGUpceU2AGiQ3/MUwdildEfs5hoRgYforXXCaSw
   4.166 +        G0gpD+mQ08jIon9hs30/SfkTePF4DfW1q7helcnOQ3NZX+RM6ZFwqi6pUC0bheWyz7FYNhjjxUMZGzUE
   4.167 +        k8ihBGSOEefMEMTgl0saRpLJOP+/k5Bnwow0PSxStZm2YiR2WV8yIbCAvu4lSLPLkQIvIsXfQxJZ6Jn/
   4.168 +        CqPsCEqPWvD6YTivH3jSVOvCizuzefoPL17eWMijqwkEJw3GdtVwbFfrYp5hwKQkfaYlGaDYZI6VGHSP
   4.169 +        SZKHpNZN6vSZbStUu60I32zN9OyxzFg3jpmZDox03UZ7yy1IdnuRvE4ihV6ndVId7XKe4aAyorbSilf3
   4.170 +        nHhVbU7TTWOaro2j6YoVjZVBVJbNZ/rSoczabMCsvInYr5mEjepb5q61JqvYUZwJ7ej8ldRPEk8bkYrd
   4.171 +        MWsnsGKfD76bzfEqMMdCqWTQnB8YGLkHneSj9Es4Sff4C7RffBON9OOkF+jyonIyTZXf0HR1FI0X9Wg8
   4.172 +        a8Crs1N5eimcPbk2uGzQxb/oW7x3W+O61R63jbYsKwkgtcBCnv8zQltN+uPVAqnbGMnSOLAXO88sJKnU
   4.173 +        g7m77ES6YhmX4Mbk5MlYpY3FLM0ew4wEhqw4zVhVGvt2fkHjL2NpPDWMxpNDaTw6mMbD4oT8yYaGszGk
   4.174 +        pYwmsMiEsKOOzD/kztySOUQX+1BwOhrH2MGoT5T8hYFWb97JktRJZOFUdvEstp9ToChzI3iPHcG7LYgs
   4.175 +        MUNROgVliSmxO40J3WpGaKEDx8r0qDxiTPXBr2n4cRDPi/rytFiX2iMenD+ySLyOJxB7zIH4c77E/ryA
   4.176 +        2MPzyTujJO+wf/PtqG1HqXuzdvOtRJJadx8neY72VudkVQYF5xWkn/Yh84Ifa675knfDmx+q5lB43ZPt
   4.177 +        lZ78cNGN7HJrVpZZsvWEM3tP+PLjT+IgOhHJun0ixYU2KPZNI/2yPxnXoki9EM3GC4s5cTMb84X95dEr
   4.178 +        hGbb91eytyY69vhWKpip1OXCvTUUVcaT948QCmvC2FsXRnl9OMcbIvnlWTRnHkdz8M58CircWHnYjtQS
   4.179 +        C5Q7TVEIFhVbsPTYdFZdnsva29HkVCnIv5bIzzVrCFkxCQ0TabfQ6vL+SvaBgVYCDQ1jqTRWrNSrdesp
   4.180 +        uymuYLdCKBMn3MnHcZx/qaTyVSJVvyVxU3Dl+SJ+eRjFsV9DOSAMldwOouhOMLuE6cKaKLbeiqb4ZiIV
   4.181 +        tetZXewrix9p110aKHTa/MWAXCGeth36StoiRWVxa+2pbtjGz9UpHLodwnGRhYoncVx7mcCt35Kp+T2F
   4.182 +        u3+kUiO4LcqVTYmcf67k+KM4yn6NoORWGMfuLKHqYQGqHb7Ir/y/G0i2QuMTWatFA29NqLXvLWmLA+qA
   4.183 +        Q6weV6sLuFW/iYoaJafvBnOubiGXH0VS+TSG60/juP4sjitPYql4GMHp2lB+qg7m1B0FN+5v4Ob9IvzS
   4.184 +        TeU5PyT2vKWI3e6dzl8M/NmEQEsszPX97NuKFe3E3fpS6p+VcOtBDlfuJXJBpLmiJpBz1fOoqA7l0j0l
   4.185 +        VfdXU/ekmNqGMtLyfRk0vT3q46VCEat/S+J/MfAh4mkj6NqmvWQgjOyUUzgj/htWF4Xxc+UW7j44yD+b
   4.186 +        zjVzv+Eop0Xd5v0KXBZPELeddog+JR20JHMRQ13QvOJbosXKDxGPnA2N1p9IOl20pRj1CVJ5TzPpnrjN
   4.187 +        vBTXOfl2K99sXom6X8W0neiiIyW07SSNEX16CeR0tmop7jtarGwJ8bQVdBL0EQwSfCEYIdAWfPm2TlPQ
   4.188 +        WSC3/b/CbwiR/gNzbuWksIMBOAAAAABJRU5ErkJggg==
   4.189 +</value>
   4.190 +  </data>
   4.191 +  <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   4.192 +    <value>405, 17</value>
   4.193 +  </metadata>
   4.194 +  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   4.195 +    <value>
   4.196 +        AAABAAEAgIAAAAEAIAADNAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAACAAAAAgAgGAAAAwz5hywAAIABJ
   4.197 +        REFUeJztvXmUHGd99/upvXqv7hntGo1GsrxhW5sxGO82JixeMAbCEogTkjcJCbz38uYcbnKTc+V7wj2H
   4.198 +        vCE3yTnk5YQkhBvekIVgMAFDvMjyvkiyJMuyjSWNpNHMaLbuqurq7tqf+0dN98xINrGxcIC3v+f06e7p
   4.199 +        qurq5/t7fvvzDPTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx99
   4.200 +        9NFHH3300UcfZwt/8Od/Ij7wmU+JN+r7pDfqi/p4ZWy66WZhN1zoJEgiQFETNq1awUN33/MT56cvAG8g
   4.201 +        /vDL/yge2HcQAh/n1BxTE2OkYQyA1FYAH13ykXAY2nApv/yBm/mt//LRnyhHfQH4CeIP/vrrot30+Pp3
   4.202 +        H0B4LmrTwe8IQpEiBQKRzFFQQCosh9QH2SRMQJd8SprMslUWj+y8ty8APyt4+2/+H+LkXAPJdnDr0wjb
   4.203 +        QXRc0qjZO0bWSrQSSEspAJXERMjmGdeKQpnBlQNcedklfPmLf/wT46kvAD8mfu3OPxYAxybrPL9nP2Hb
   4.204 +        RfN9pNQnDcIzSM8p0Emy95GZovly9pmhU1JiXGkQKbYBegIRhTJWxeLKW6/nK5/7vZ8IV30BeA0YuuYq
   4.205 +        EbdbiDBGcRNibw5ZK5FGTWSttORYOScwQolOAjkFAlUnDUIqeZlmolI08kixi1wZACBpRQB4Qbt3DSGb
   4.206 +        RIbPslyFX/7wh/js7376rPOlnu0L/jzgc1/6onhy/zMAjP9wlFPHjpN2JMJDL/WOieEVyQcwwoyrSj6b
   4.207 +        6Tox5GVKZoES4Ga+HwXAbUVIsQtASYFmktEipT4087TkhG8+/dxP5Lf+L68B/vvffVmEfojb8vjK176B
   4.208 +        CNoI30dptnrHnE50ToGW36RaVnA6+SXqvavSAYRapqwmSIYPgIcFQOrMUaoM0AKENIuwJYRaRiloQKYN
   4.209 +        uppAyCaRgMGBZXz8fVfye7/3B2eVs/8lBeCW3/o1MTU1RbM+g3O8SSTXkdyXz710yS+YJVr+ghCcLhBa
   4.210 +        wUIpaBSAFix5BpCNIqWcwoTtkDpzyJWB3mddUUtaEXJpgFQpgz1KM0pBNiH1KeRqvP/Wq/nw7e/mkm3b
   4.211 +        zxpvP/cm4LNf+LwAeOnFWR7e/TgEgsd/8Ayqn6ncNGoiwRlqPMl5SK4gJ3t0tIz8LjK1XiGvgaIUaPot
   4.212 +        SvOzl8AHI3PiVlsV/DSm7rYo5ZukXkoBBSoDJO05WvkBVlsVqnoJx7GRajVEq46dAtYIzByB1CcS0OrU
   4.213 +        ufexJxleUzur4/NzqQEu3P420ZB9aHvQOHNmS4XlRH6IZuq9+Js0U9NRmNlsNbHPcNhKZjZnk6SFohRw
   4.214 +        Y4VyQUM2iqSBh2wUqVQsHCfz5hNDp/3mqyg1xkj37qViVTAthY5bx61nM79WLrB80xaUlsPYtItjZ+em
   4.215 +        Shk5cZk9NYeutnuRwUXnbuQzn/wY77z55rPC3c+0AHzuS18ULxw+TOj7HBs9xpHnf4jmy0tCsNPxcg6b
   4.216 +        bOgI1UJRTZBMioXMoHdJAChrKc3AW6LSASqVzK7X/TZC7qDJy7B/5Q4q374LJfaY+9XfobxrF9qRZym2
   4.217 +        IxQTIrdJs5OQBh4A1eFLqKxYiXPsEG4sE3VivDgTxObMkcwZBMI4j2bq3PH+q7j6bVecFSH4mROAz37h
   4.218 +        8+Ir//BVRBCjd1Ji13tV53Vtefc1LHjorihSyNVQcwqQEd87ryRTmX8ddWK0nAoDQ4SFlM6JcRQjR/yR
   4.219 +        XwRAGj0OgBgZRp6eRD1+lLkPfJi8ECjHx5D37Wf1ngfRyiUit4ljO3hymbKWUlmzhYIuaDoOY7M2cuIS
   4.220 +        qcMookFzbhyAcN7RXDZQ4o5ffPdZCQt/qgXgA5/5lPBGp5juzDIxdpLEb/actdDPRsMsWT2H7HSCF6N7
   4.221 +        TE4B3ciIF2qZguTSEpm3jmHSAkrzDpufKkRBSKVi4cYyolXHLdTgt/8LqZZDchyk0eOkWy6BiRnSCzfS
   4.222 +        OTRK4bLz4eQMtCJwbFi9rHfssie/hd6CZjdsANxIpmJZrFo+RCuUcJo2smoxM+egliu06zbtuSOAD5hI
   4.223 +        kcvG8zfyu594L+//0IdeF4c/NQLwuS99UQAcOHiQnY/vQqtLxN7cjzynS7TvRejzodbiz9KoiVouYoTS
   4.224 +        EtKBnscOCx66nyoEbh3ZKCIVaohaBbfuUKyfoGJVeteeuPmDJJvOxy+a5ManaCWCdOMwxecOQ8Wi5bgU
   4.225 +        VmcJHv7tfspxm1a1gnzoBZKpSfJGES+WkUvZPVUAB6gMDGFZQ0RNh/HZJu26ja5KIBdp2SeIOhOASRpn
   4.226 +        wnP7zZfx6x+5lcuuuOLH5vE/VQAuueVmQQtie47ZRhPF93+k/V6M02Pzxa8reblHNEBZTXoOGywQLs97
   4.227 +        383AozRv0xNDRwlClFXLCH79d5AOj6J++26KqYNpKSRpHkfWqN/+sYWbsR2wKpQffopgZZ7g4EtUZJjz
   4.228 +        YgYaY7iRTFlLcSOZvFFEy6k43XtTynixRuzNoBaXsXLFSqS8SmuygZuWCOYdSlKPllsnaM70vrZQLPBL
   4.229 +        t731dYWGb1gY+Dt3/l9iyqmza+cTiFCHjs/kwYnsw0gGTNoUQBtAVxLCRCHPUg3QSqCgLLxfHIfr+coC
   4.230 +        6fNZte4sd1tg1apUKhZtv82cFwMJqX0So1ygREZ+bYWFu/pcGpdtI/23H5CUyqhrV7K+mBK5kKR5yjok
   4.231 +        bkRj5y7iO34Jv9GkuHMXwq7TtB3YbSMBaeqiA00AObuvspYynwCkrJQpqSDrMrQj5swBklbMqalTrBpZ
   4.232 +        S75Swm0AqUcYC3RVQstXiUMPkYTZeHgt/n3X/tcVGv7ENMAf/PmfiL/52j8QtwLwsxAm9DV0ZcH2JVKm
   4.233 +        hGU1y4OHIkWXZNJYQ1YXmJYUHZGESIpOEnTI6RJF9eWdv242rcDCTB8bn10y+9333A7HjlGtnyDYfjUt
   4.234 +        yyK/5ynicp7O+z9E5Zn9qN++G3frVpJrrmb4b75K6hwnCRO0YiZEURBm/sB82CalLiWj2IsUus4dgGbo
   4.235 +        vfsrWXkSn8ynUMo9R3RuehYvlkm9BqK0geENa1HCJicyWSb2kiVaQFGbBEJHl2S2XPgmbrhi3Y+VJTwr
   4.236 +        AvDhz3xapGHEsdFjHB09gWpn1bCOXFoyYwFixUJNbGLFetlrJVIBxcgBoOrZzNTy1Z4tJD2TeEU0AKiW
   4.237 +        skF1504A9AjoQjMEwZtvwL3mmuy8XQ+RXHM1xf0H8DZfQuGb34C3vwNp9BjV+7+FnSq03n4z5QN7YWy0
   4.238 +        d51m4CHkMlLq9p5Li3IBQC8f0A0TAdp+m7yZ771f/HnbbzM1EyDHNnJpgIplUbbW4TRtbNvGbQrKJQm3
   4.239 +        KYjdY6iJvWRM1y/XeHrPY2+MAHzuS18UX/r7vyXwO6SNAICw4ZJbNGsXe+Jd1Z2YJiLKtEEQ2hj6gjCE
   4.240 +        iYJmFtBymTrT8tXe+bq6cJtqudKbDUZ1LaWSwLY9FGXeHFy9EW/nPiqSjSMsytvXIR89jn31pYhHn4KP
   4.241 +        vL/nsbf3HaDypnPJPbYbb/MlKLsewpybxh9YTu3ph4mCTNW6UTZLFxMuFqn1LjRD70UNXfRIz9WgU18i
   4.242 +        BKli0bDrDMw7g45jM9FIyAsXuTRAeWAdJRWa9WPYqQX2KF5cJAw81MTujWv3+abbbnvNvQOv6uC33f5R
   4.243 +        AWAfG2UmmEW0kyXFksUI/QSkAmZRozWv7bs3aehWj3gAzdQJE5OcAaYin3EtuVhd8r42uJ40tvFijaAV
   4.244 +        Y1TXEq8fQG40SW+7HPmuxxHb15BzJWpHjjKR6hSu3wyActE6xFfvZ+KGLRTsRuatL7Mo/MsjtEbyGHUJ
   4.245 +        8+mniL0FJ6ubBALOIF0q1CirKY6wkBKXajElkWqkznE8uZK99zMBiNUiRSM71wtcxLz9BxifOkGqlBka
   4.246 +        tJATm+ePzSHkgEISUBwcZmD5IG7TZm5yjnZrgqKRpy2ViZ0TSwRA6USYRY1Pf+qXX5MpOMMJ/OwXPi8m
   4.247 +        Jk/xg8d3IRoBqhTx0otPE4xnana+0IViLtXt3bg8FlAsafhNm0LJ6gmBoVsITadkrKWoepmEayn1+bhe
   4.248 +        LlaRE7eXhJETl7yaohZrxF6d6XoHOEZRTTEB8hWaFTA+eg35Jw7TLmi0Lj2PlS+NUf/g1Whxg1JdIN/3
   4.249 +        FI23b6E0OgdXb8HYe5TOYIUUl8KDB1GPzVE5NkeSNEmUAlIl80tiLyEx2xCkGPmYorYOWbUQRYGwHdJt
   4.250 +        l2A36sRXvwXu+3eiqSayDrJeImrGJGom0HkzjxuDnNiQq1GkzPFjo1SGqlRqFmOzZVKvQVO2KdXWUyy6
   4.251 +        xB0ZCHBtBy2nUjTKiHIdNTdE2pzDVGRaheUUWtO98Y/TFmCxb98Bdt1/v7jmhhtelRD0Dlr/rhvE3PQp
   4.252 +        hOMjz2WSX8hZ+M3M1uimQugnJGomBLEAVcqeAYrl7NhYgCpnGiBWLDR9XkXKJhUrU9PxfBLET3WKhaSX
   4.253 +        cs0bRapWjYZdpx14vZAp6sSoxQVPV7IquBvXIfI6zXMvzO5VCNI1A8hfu4vStkuhUIATY3g798Gt2+Hb
   4.254 +        e5b88NhLUIunOSiLUNWgce0lFCuDqPffD6JE4/ZrSdcMUPzBPoKkTn79JsRQBeXb9yKNnqRSyjRbswNp
   4.255 +        bGdefs5ibvIoTjLAhrUV0o7N2Gw2pkODFl7g0mhmY1QtyZTVlLlmimtngaKaU3qmYGzWJvUavXu0HXuJ
   4.256 +        L9BKoFgs86lfu4333Xwr51108X8oBArA8u0XiqjloTQC0rqLiEAV4Ac+KSBLkMwzLYsCiRqhzhMvS5AC
   4.257 +        aeijmwqaJqPlclTyMnk1QNdMDEXCkBNE2Mke84WNFastTNPEjBu0WikFPWS6BbosyJfyuD6Y+QriHe+i
   4.258 +        efU2fLdFtG6Q9i3vRNSWQatDcOAZcts2U33saSJDRdJ08o8+jjN9iuTA86T2OPLRFxFuAwK795CFSxJK
   4.259 +        SP4pCGwSSWEgZ2CWi5imjhSFSLWVuNs2Yh6xcUNB8vYtyONzBFs3IP/gOfJHTtB4y8WseW6KQOiE7RC1
   4.260 +        UEIzDY6fdDGLFoYGiVql3QloYmIVTRTdwutIKDqUdINK3kTWTZANzNJK8qUqbUVHSDJCNogVjUq5hiRD
   4.261 +        kEqkxmpagUAdqBGGGkGsEiYdALQkYHLa5U0XjPD1f/znO1+VAKxbU92Rl1LygUIchUSxQJbAzCmIRKCb
   4.262 +        Sk8AIMLUFRRV7j2MfAXVMMnrBrpqoMmQJIIkEahyiJQGIBtYtSq1Yg7ZnyPyZ+l4bcx5I5QzJOquoLpp
   4.263 +        Nc2bb8K//K0QJuSA8Q++C+PYCawn92FOHMd8+nlWHD5B6fCLxJMNpGKe3MEJosf2Ir90mPbMNJyaQnQy
   4.264 +        P0WESyuCaqEEZkw1Z5BbuYJlQxvwwyna115O6/3XE6xdQUiHwuEX0RMFccl55F84TGimkC/RNg301QX8
   4.265 +        J1/E8h2Mk2P47jSzjYCBgoSchGiKz2wjQKkalBUJWfJpuQGy5FOUfaw81IOEkibTwqIo+0SRix8J9DTr
   4.266 +        CnbbWXYzjUIkGWTVQgnrpNEMcZiQiz1EkkAaYOKjy5kW6Lg2jXbCn/4/O3Z87etf/5FCoADcdtsndpwY
   4.267 +        fwERVwhjgSpHJLHokR5EAjOXCYE+b/tlrYSkGEiKQU720GSdlt8kkQxiAfmSRbVaIldZTtByQDbwOz5S
   4.268 +        2ALDxDDzBFFKbnAN7jvejbZiFfHJE4RbtpEuWwVPPgM33UDwzJMYuQJFrUL1hcfxmw0kVSbwHQJ3knYo
   4.269 +        w6EX8Z1p0rAN/ixCNno/MFkxgJGTkcwqYnWN4lVvZkV9Gin0kWrLsW+5AWfTRkp1h7Cgk65fR+HQBOHW
   4.270 +        TfjPPcfy6Q6d85Yj1q6h8G+PodcnKE1Ms+yFAzjHR8k1HEzDJAh9Qt9Gkum97wQSmjeBqUoYMqiKiyQC
   4.271 +        dDW7v5Im4wUuxXl1GmAQe3VyZo5mDL4/LwBegyCVGMxDrObohALN0On4KZKiUcxptEVKJwgoKFlWdHxq
   4.272 +        lnVDy7j//gd+pAD0nMCiGKQZZ5m30E96tr2LrncPPgVzUYjnN+loJcpli3XLl0Hgc7I+n84NfNzaOkrm
   4.273 +        LE3fpbJ8GIZG8C/cRNRKkHfuJL7hFsS6GvoDL1GxLJyGjVTQkUsaCSBZNcq7HsCuDdGePpk1T9YzO5iq
   4.274 +        FnI8SqpmtleObWLVAhrUyhInr78FafNm1KhFsV5HfeQZ4nKJdGCYYpgypqTQCmF1Bee6a/EefpCi7dJZ
   4.275 +        ZVB6dhRlrkkrGWfwm02KVcFzs8dhFoaH1mfCJVVxE4dSB8TIWpTaxTi7x6CZ2f/KKgm3ueBnL44Euq+j
   4.276 +        TkxTgZIKUuJmZWC73vMBupATl7FZsCyLaknGsW3SMCBvqrQ6dYjkXs5F1kqkQcg3v/E9vvSXXxS/+cnf
   4.277 +        fkVfQAbYtnkz1eVrASiXLZAKqHIB9bTTzKLWI1835F6BJaeAXBrAk8tZzv26W3DXnoOXW07uvE3I5UFK
   4.278 +        lQHcQg3n1tsINl2UXfC9tzExewJsh0grY//KHXBsFPHwbtL162nu3AX7nsHevxd2frvXOdu7+fk2as1o
   4.279 +        Zc5SQaNsVRhekQ16RQiKUQvr7vsR54zglFTkiTont26gs3IZ1elxeHAXAO28zuqcDv/wDUo7H2Lk2QeR
   4.280 +        Epe5yTmcpo0328SyMkFz7SzRpGwZIl2+hpORhXPTjUTvvh7x6dtwhwaQdZk0TCkaZRp2PbtfXe6Rvhi2
   4.281 +        nTmGc5NzpF6D9nyfgJ/qvVA47iTIiUvs1RHzkVLeVGkt6iI+HScnZ/j2vbt45MEHXnGtoQLw3e988851
   4.282 +        q9bsaPoC17Wzyth8C5QsF5DJBl41TDTJA0K8UENORabOhEdHKaL/0q9SmjyGef4FeG96E+ZzT6Lf+B6S
   4.283 +        OKHqN2k6Ps01a8iNHqP8zDP4111L8PTT5ITAP+8c5BdeRDr0FOKHh+DJxzB++Dxuq4WhnCnASkFDMqtU
   4.284 +        iiZmZSWKUFEUQbWcQ1IMdDnCnZiGrVsojI8T+z7h1s2E370bLn8r0ob1aEeeJag7sGo1A/v3UX12L86h
   4.285 +        /UQNB0MSGLLAdn2iqEkpVyYqV/AHyvinHLwtG2n+4nvRV6/DswSG72PteQ7/mjcjn5qFIxPkTBkpbBAr
   4.286 +        CqbUgbiDJHwi3yHs2JyaahD4ASL0EeFCNTOdV7+qlKAoEVYeOgHgN/BDCU0WBJh4zgSIGNFxkUVWSBNp
   4.287 +        uOQxeeI4pUqJL3z+8zu+/Ld/e4Y56MVB73zPjTuOHZvEVEJks0IUNed9gIhYZN6+LEfoWgndiLEknVxB
   4.288 +        ppArMus0kZQcxq03EysGwfK16Os3wuQUkdMkueqtNNUy2DbG6Cji8stRD+4mPDFOfPgQ6sH9NB/bjX9o
   4.289 +        P76f9AhvRiklbWmCyKpVyQ2uQdEUciJG3XoZ0ZVXwnvfjbf7AKXYRVKMrHbQbuMHGp1rLyfU8ki6QuXR
   4.290 +        Byjt30PJa2PMzmEfP4r10vNYTmZWmolC2pzDqlZxylWiczaC71NXVIId/xsMr4dN59As5SkFIYP3PUCy
   4.291 +        5WLib/8As5Ynsj3E+ecSTo5RqU+Qhk2CdpupyUkc28axbWbcNiIMkFL/ZR8VuYVpCEw1opbTiAQErUzb
   4.292 +        yeE0oe+DbyP7DkFrtkd26Cf4YZsoConjzIFPYsGJ8Qbr16/k3777vVcWgN27d9+5YeXKHV4rII18Esno
   4.293 +        hYGwEArmTJNSzkDSMpLkXBmZFCn0ackFtHe9A5bVSColWkJg7HwAqVAmZ1lE+/aRzowjH3qRYG4Gb+wI
   4.294 +        umej6CaBN0cscljmwmzPWYNw3gVYsY8uJ+RKFdStl2F/6P3oa0fwjp5AWbcO5fpr4J5/xzxyCL/VxJi/
   4.295 +        N0OT8RouzYEBTK/JuQfvY/z5Y7S9FpWoiUhC3GabGbeNocqYpglRB7/j00wU/Dt+BbFlM1xwAV4cYQws
   4.296 +        Y/Cuf6Vz3ibCmVn0detQpyeJOgHyRecTWlXE8DpSq4z04IPYLz6P22wTNKeR0qD3MKQQFjmqXcHWoxY5
   4.297 +        a4CyVSISGiIJieWskKRHLYJUxvU6mEpI1OnQSUBSDIJ2hzjuIKEiSwmCHPncQqTmd1waHvzZn/zfO04P
   4.298 +        DZdkArdfdRkP3ruTMEjnVVD291gsJH4QHlBGUebbKQKfklngZLuJ+thTKB97f5ZbH5tBFFTS5hzc/Q0m
   4.299 +        3EyCK3kZd7ZNGoS9fno9dimXrV52ELKCS2lgHfHWbdTiBpGr4NgO9Ruvx12+knjZCtT9zxLseZRwyxZK
   4.300 +        QCmn4Lg+SVhE0efbu8aOIP5mjKFz1tBVslHLptnJysPVoQpK/QR2vUEaeBTzRUprBhl3BdLocaxnD2Pf
   4.301 +        cgOlVkzr0IsUN2yitPMhWldfhfLYbsSWK0grKsquhxA7dyJZFp7tUGzOAiDF7pLehMUoFzQ8uUzh9o8j
   4.302 +        3DrG49/v1R9KOQUngNSdBcNELg9SdmeJFHDa2Ri9XO+EhHmG7wZw4oePMj5xzRl/PyMV7IoiJi45BShZ
   4.303 +        ePPEKVLWjtQKBEgpA5WF7lgMk0q+RdM/ReOP/gSnMUWx1UQK2kRx2Lt2Tpm/fuzCfC+9BlRqVezUwv3Y
   4.304 +        bZQfepB0eIRCw8Xdtxdh3cDMW97Lsie/hdsqIU3MwPKVKMfHKFYrtOw5pJ27oJp17DT9Fu6MwvDICHkd
   4.305 +        YBbTn6YxLaguX8uyVRYzk2DXG7hv2o60fDWlwxXSw89mv3NecMpaivutu3DeexsA1YYD+xp4114D51xA
   4.306 +        vqCR3P8wE0deQGr6SMdeJA0FpeYcxUXELyZfKWgkrQirVoWhEdLhEcToKO23noej5xh6+hFczwYS8goU
   4.307 +        80W6tc808HBjZQnx7UVtZaq0sMC0m7XthuxrBivUVm+gYGhnRAVLcqG7d+++c+Wai3a4ARj4xALCIJs3
   4.308 +        AnWJGcibBvK8epILFrqq4thNZHeWUuhkqoqETpLlBOTYRytYGIqEopsouolVq2KeeyHpJduIjr5IsPEc
   4.309 +        0ne8g7BaJdhyCWJiFmv0RewP3kocqeR9m/CZfZjtGLF8AOPUKfyDBxEnjrIy9CkYMTN2jOva6HKCapbR
   4.310 +        cwbtpISZNPGDNgKDZbUibrONJSQ6F20mePN28i+OIuwpzGJWzjU0mWYA7lvfgl4awL/0IpqzM+QeuBd3
   4.311 +        dpboX+6hOTOONXMCvTFFEEaU1JRmlGY+zGkqfnhkBOXci8ivW099KsD/xK9RX7OOcM0w2j9+HSNXwL/g
   4.312 +        AkpVC/HSs+iaTjshM1OtiLBj43odPNcmiAQiyZJ13YduLqh8gHJBoVhQyJlllg8P4OGz56WX2LVvNxvO
   4.313 +        GdoxfvTknWcIAMBv/Pqv7Diw90nyJQvDMOk07d6XdKVLVyIMTUaWdZKkhRTFyAULx7YxSUgSQb5k0RlY
   4.314 +        S2XdCElboKpQHBxmxeoNyEOr8acmMc+9EPvjdxCsX0++Pkvr0GH0N29j8J77UKcnCS+5iHDng5SDEJYv
   4.315 +        R9l3gM7YEaSTJ7m4PoE6NUpj1l4gPDdIQZMIEwiiFEmWSFevI3r7DUQvPYdpFEmvvJ6Za96N1fZwJ6ew
   4.316 +        xk8QvudGVK9N68QRUj/IfAFASlMcp0XYdAm+dTfxoYNEp8bh2BFo17H0hVJw13HtPlu1KstqRSrlPB45
   4.317 +        nF/8CLNveRvx6tW01q4izulw4QhFu4H0xJOoo8dJN51DNHoc//BhPHeaoOUw02jR8Wao223S0CdRIW8s
   4.318 +        JOUWJ+eqZYWcIZMzZBRVok6K7/rMpgktVWXGbtAOA5SgxQ3v++CO557afecZJuCyy67kiYceZmKmQVlN
   4.319 +        sOfVSdcHyKp+CuAyYBWWnFsuW3hBO1sbd/E2SrfdRrMVs3r0GM43v4o4b5ixX7gVKW4j1x1stYh0/ARi
   4.320 +        eB3tG26kvHMXzUMvUq6VqD67lxYSSXMO+ZEHWDeyHkdNsWMXe9zmhJZSqViZOiVbYMn0yXnp12g6c6SB
   4.321 +        BsMjiJFhykYRN5IRW7ZQOXiYWtjAWT9MNDlH/uCLiHXrqJVrzExOQTDVU7el+lM0n36CWEBNl2lCLzLx
   4.322 +        gmzBRkmTUQoatXKNWC0SrltDcvRFZD2r+w8U24xOzMCWixn41ncQt92E9/gein4EBR1hVYie3Qt/cZBm
   4.323 +        0Cb25nrqfbE9T1QQEaBmE1GIFrpZQIhuab5M2ar0kkg1ZChD3VSpahol32AWm5NCQ3p8f3b90wXgtluv
   4.324 +        ky7bfqGQ4gSXMgWzRLtjLzkm9BMKRnZq1xlM3Vms2iDRmI0TgLz9Uir79rPm+NHeeZ0N5yLfew9i6xa4
   4.325 +        9jrkb90FeR1v2WoKlQoSUPrnf8SzLDbUoP30fRxxbaTY5QRZl02pMoCYbyFzHJs08CgXNNxWRDG/4PyV
   4.326 +        tISm56M8s4/C9dcQXXAx5eef5WSjgVTQaF56A9KbNtH+3B8jnRhDPPMM3thLuO2UbheAbOhZ4Uo2qSnh
   4.327 +        GWHp2lVrkAo15LLC3HhE58Yb6LRCclddSusLf44aQ7J1S0bNk48gLjyHsFaicM/3kIMY73v/Qr7dxgva
   4.328 +        uDPTSPOry5QY8jmlV2LXTQUdEKKFpC5MOknKyJekAtWywlU3XMfW9efw13//ddqhR50UrCodJGabLgNS
   4.329 +        zABgd+BEMJV91+kCADA+OXNnOa/vUPQyaeQTLqoKxiIrEkUJyEobQyv2zitqEe0wwNQkdK2G9M5rWf7Y
   4.330 +        I5iBjzu0AbcdUNuwnrBUBV1FtCNoOZhtj7XP7kM6uJepsaPoQQc5ldBVlSBMiTodCpUqQeAjqTq6nODW
   4.331 +        JzELFurQGqL1F5BufTPy8VGMeYIkPceM41MqCNJQRlxxJS3bxnh6D1K1irtyOf73fkD40gH8F17EnzhG
   4.332 +        EGUJmEpeJpK1bGVupYq8ajVxq8XagQqaVaE0vIbAtDDOHcK57hdon7cFpaQx13DQt11CqJvkG3XcY7NE
   4.333 +        H76VYGAZ1r59BPv2EZ46RbjvaZyDe4kbEzSaDYL55hpVQJqpu/R9AAATvklEQVRk1dVuEa5r0zPCdQqG
   4.334 +        RNRttDEkBq0ilUIRTdHpOG2eOvgMXltQt3IYVo1qLk85apGXFszV8mUDjO4+IMGP6ArWzTJhy0YrWJgJ
   4.335 +        eK7dqw+02h6anCM0JBJ9IRJoRlCqDHBycgZl35MU33MjjYu30Vw/QjFNkL76/9Fy65RHRpAPHMU+9gyO
   4.336 +        a7Nxdhx5vk1KNnSk2MUVw5RDN5vdWNj1RtbZu3ID9orVSLsfA1Lqt3+MeOUq9O9/H7veoGDJyIWsd2D1
   4.337 +        sioTkw2G9uxivOEgWj6MPsPsC0fQ1TZlJSaMU3QjW7sfBim6ka0HFLJJumwlA5/+FKJSIfnLv8bJq8g3
   4.338 +        /QKTm85HPnIc96mnkdcNU3Bt0i2bEXd/h7wkIY+OwvkXIE1Nwxf/CgkYO/wsTXs6U+FkM3ypF7/w99NR
   4.339 +        LSu90Fw3y+iGR8PNzpXnvX81r+DNRwflioJcKlNSJZLEodt+9JEP/BKf+eTvLwkSX1EANm/fzP7dj0J8
   4.340 +        ZqtWdiMKSAuzn/loQS4PUsnPUe84SF/5O9LrrkMO23iPPoEzfoRKY5QNcoOGBF3DMjM5xfDICJVKRrQA
   4.341 +        vNnjqLUqFauCUqtkffRKmeOf+GVSq4xy8Xm4d91F4dhxOquXsfbZPTQKGk3Pp1KAJEzw2h5S7DI2Dt7R
   4.342 +        u3u5hxJ2tsODIhOoOszH3lrBQgBrl1ezPsCLL8G5+AIKrof2tsuwn/8hqpxDrrukG4cR+/eTb4fIz70E
   4.343 +        URvpnAvoPPAgHBsF28YZP0JrkfkUEQiR1e3bndwS8jXDR5IW1HvByBazhEFKGKRYpTLt0MNUffwIAj9b
   4.344 +        fD64QiFuJ0uKR2WrQkmVWDe0HFUd4utf/mcJYPfO3z+Dx1cUgH/6p3+Wzt+4RkCmEtNoQWIlKUe7kxD6
   4.345 +        NmAxUIFSUaMZKZRyCs3KAMrkDO7hZxlSUxQTZk+cxCFLYhw46jI0WO45cABjsUz+uuuwnH/NYt5WRHrl
   4.346 +        9ciHj5Gcs55004WMPfE40ny8XxxehwQEjz1BbtslOGuXw/TJLA8wPkvUsnubNuQUGwNg0bKw7owqGnnK
   4.347 +        tQpNZ45SQUM+52LizdsQ64dx9+5DThM6E3XSW96JdPQY+e/fh3TFZbQYplit4vzgHipJm/IPn6fpB9in
   4.348 +        srUOXeK7M16RfBJMNDlHokIqsmbagtbtEs7I7xXb9DZhmEc32uT1Yka+piJLJnkd9OUpVWRmpscx5run
   4.349 +        g9Bj2fI13Hz7bfzh739OevKVyH01AgCgWDKJ011OtbQ8KUQHPVfsDXLTi8DIsnUFoAHE3hyN6ZMU80Vk
   4.350 +        o4hsONlS69SlMe0iG0WsWjbbtDSzg6VLtiEfP0pr+iTNLVvwKlVqE2Owehm0XIqNRfexfoTo4ftIvvDn
   4.351 +        pGNHeqTnFBuER05Z0FC6IdMxLaRclbQ5h05WnlZWLSPaeDGV46O4R48jrrme9NrLUf7f/0Hl2Cg4Dt6t
   4.352 +        t7KelDk/RHnhcSz/FK61Dvv4MTi0GxsYP43w0yFhkjMXz/KF9vDu5hPVsgJk1b28XiSvQzukR74fxdBN
   4.353 +        DTkeQU7G0Ius2TDMhpENfPmvviaNjjk8tefQj6J1Kcc/6sPf+I3f2nFo/24kkSV/kiQkTTookopAQ9Nk
   4.354 +        RBoSJ2BoMXIqQxKDqiKlPmGqU9YV4vlwCNNCvvkDNA8coVw0YWgEse1qondfS/Lw02gXXMDc5i0ohw+S
   4.355 +        T2Umpxyqb9lOvG6YopzArkeQnngStxMQPLGb+MCTaFGEc3KUIPDRZOg56ZKOPh8PK6pEGKSYWy9H3rqN
   4.356 +        dWGHNIlpCpPO+z5E45ItOJaFbttIM5Nw2aVU7rufwdY042NtpGsuxz5wkNLTD1I/ZdMYPQqHD5FOvEir
   4.357 +        1cmSZSmwdBkC+ZxCLAnyRubMSZKOrJUQadgjvphPUFSDgZKJpuhESUheXxDcKAkJg5QgTHBaTWQ5QlV0
   4.358 +        cqbBde/4Bf79vkel0aNjd+7dc+A/bP96zQLw0IOP3rl+y9CO0BUItYzfcQkjpfc7ozjLSKVElPMmQkTI
   4.359 +        st7LDLpemygMiRIoWRVyF1xI6x1vx9cUpLpD+JlP0zp/E8rDT5A+u4e47lB53y3Yooi0fgTlkYcoPP8C
   4.360 +        LSQ6Dz2Ce+ggQaOOdGgv4vAhUq9JEPhU8jJyulDy7hIvVUfIv+VKCnIBM/KIm3Vy296KSBKKvkszgNbV
   4.361 +        1yAGByjrMjz7HNJLR5BkAz2SCU8eJ7Unad5/P/LDD9GaHMdvTGVFstDvRQ1dCDVASlXyuaw3EkCTF3wo
   4.362 +        WSuRkz2KBYWBUhldC4jTlLyu0w49NEUnV8oRhx06kU+r7eO0moRxiK7qLBsyue29n+Cuu++RZhvNH5v0
   4.363 +        Vy0AAG9982U7ZiZPgFIip0s0vc6Sz2UpSzumsoGmgCzrxO0Z5FRGkmLclouZr6Be/04a73wXkuMQn3c+
   4.364 +        /r2PU1s1SDpoMfy9f0GkEp2pCZSWT7R6FdHjj8HoPnz7FO7BZwknTiCJGEnElJSYUC1R0SNMTerZc62Q
   4.365 +        taGVl6+l1Y6R3nIF9V+9A1GtUT42ild3kVYvx7toK/JsjClCGqdmKa9aDjN1ZElCOnoA6fn9BJPTzEyf
   4.366 +        pO2cwndmCVyHdL5m322PS8kcOFkCoYEkqeSNhZa57kzvZuhM3aCUM4hSnSjx0NU8URISpXoWaksRTadD
   4.367 +        vRnT8T00Lea89RewYngle/c9L52aaN758COPvG7SF+NV9Y5fcOm5oruTlT03RruTLKkUFssWOdnDKs0v
   4.368 +        vVYWvNmT9WaWIfzUZyjbLkWnwamrryX/3fuQZscofOIO1K/8HenhZ7NsHuC6NrKR7asHmRPqtNOsW4ms
   4.369 +        T6Aseb2dtbpbrQ1fuJ3WqkE6V15F66GncZsNKu++EYCBB+4jOPICLS+m8Msfx6vVqHz7Luz9e3sbMzVn
   4.370 +        jpC440vCM0nL7Lq6KBXe7iQvG66dvi9BJS/PV085w5FLhT9v0zOH1PMXlrwVcjK/+lu/Q6VQ5dP/9Xf/
   4.371 +        87eKfcvbLxfO6AmQijQcpycA3byAOl+MWDNYWUI+hsnc9ExWt37X+6ncfCM89xLudVchPfoUua/+T7yV
   4.372 +        g5RPHsZdVC7uxbyL1vR3q2teZQPlW66Hb93F0GCZxtpzSEeGCR57gsaVb4Orr6C882FE1cI9Okr5+Cji
   4.373 +        jjsouC7c9++0Hn2I0qoVtNQi6dgR7LkxADrza+4XO3Hd37U4I7eY/NMJ78qEVZRJRaYt/CjOyI8gr2UO
   4.374 +        HUDDTRalcGF4+GKGNlT55r989w1dsv8fmgCA//a7n9yx5/GnKeWqyKpMu9VAQu35AmZOoWCW8EOBocUI
   4.375 +        EWX+gJYnRicIfJS5OQw/xh2okX73XnjiAXLOcaK5Gfz2oj35UkEnyZy5tqQhRTFp5CObFapDG6mdew7a
   4.376 +        7Tcxs+cgwZohZn/lY9CKENs3E+x6COktl7HqsUfRpmy8q67G+O53qJw4Rmtiinj/AcLGJPWZOdoTP8x8
   4.377 +        Gj8hiEQvC9dV6d3M5+L2dwBNk3sd0ZCRvqwsoygSpZxESosoCYnTFFWRiUWeKPEIA5+5pk/H9+gEARAh
   4.378 +        SQVufd+7efjh3dLE5Nidzx966ayq91eDVy1tL2cGYGF1kCL5GGbh5bXA1Gi2kKE4QCiZqL6LPL9kWsgm
   4.379 +        Zuj2kh5awaIZpazJiSypVLGYUArZzhq33YZ7zZXItot37Bhi9DjFX/0ILduj9NhepH/6Gu7tt7MyTdF2
   4.380 +        7sRZP0LzsYcpBjM47ZQ0ar5sx3NXvQt8UtVcssi1C1kr9UxRV7V31Xl3dnfRneVd1d7N2QOsHx5i8/Zt
   4.381 +        fPmvvvZTsTvLq94gYnV1kPHGcaCMWi6i+k6vUwiyOHdxu/hiaMW1yKmd2XRlPiSUA0gNypJHSKbmByrZ
   4.382 +        lmvUG8jlKuLaW6ivrhHXakhf+Tta64dRH3wEqR0iX/5mkr0HkEbHKbYixAUbkSyL8r/+KxOVKvKRZ0mf
   4.383 +        20OrY+NEC4KqSkuXtEFWZctIX1rd7G1AIXvoRhsEVHKQ14pAkVT4tCPm7Xxm48MgRUhtWp2FmLBaqbB2
   4.384 +        eCv33X+PND176DXF6T9pvGoBuP/ex6TzN64RUuxSkhRiU+mt8VuM8VmHdeuyjRABlADKBRN7LtttM1Db
   4.385 +        hOXlaL5PyZARgKbChgtGOL5pO/l1Q/D4HtwfPoe46BzSLRdSvfNzuLaNu3cfpeuuQdn1EGmtjLRpA/KO
   4.386 +        O2HLVhrPHkCZOkazHUJo9xw3sYjoxY4rnJl3X7ztTE7JsnFIRfLa0pauduiR14v4UUwYZLXDujOx5Jii
   4.387 +        WeQjv/ZxVus5Pvn7O6QXDr/4aof6DcVr2iKmbFVwnQShlpG1FDp2bzbFAhq2nTUptOewKlaWHZxHtVLB
   4.388 +        aafEmsnA//mHVL59V+8ze/9ept98A9E1V9K0XaRajea+J1m1bx/axeeRAGvKEux6MGvyWL4G8Td/T/TM
   4.389 +        04yPH6cwfgQRNXEXRSeJBsSc0R/XLa0uxuKZjiFhleQeyZkzZ/bUehft0KPuLFo+LhUYXlejVLO4/97H
   4.390 +        pGma/NGOz7+W4f1PwWsSgCuvfzv37Pw+wsuaP9Ko2fMFuj2DBbOUqUXHRlEKWd9gACWzQMOZAMWilQjE
   4.391 +        299DeuFGlONjNIdGaGkGabmIHCYUnz9CKV8k2PMoydataIBjOwhnDvtrR4BsDZxo2UgadOVM0iCOFlXa
   4.392 +        FoVup6NglnpbuZcLIX5s9mZ6OwJTy4Ym8+KzcxaHa92UbtEscsv73sef/cUXpamZU69lOH8q8JodkQsu
   4.393 +        PVeIRguhrcaeG1uyLwDAMkulFQjWrVgNZEUi27FR8gM0nbmso/X6W5A++2kqd3+f0skpnJtuxP36Nyh/
   4.394 +        ONu9Q4o6SHfdRTp2hJZikDSmlghbF6er9MV/W7yGsYvuHv4ID90sk9cgFX6vpNqOwFSz93ZzYXa3AtFz
   4.395 +        4opmkcEVVdZuGHnDQ7afBF7zLmGy6FA3C5STTK2Pd+pLPp+xY1Qp6xi2Kha2Y8+bA7+nBdJD+6mdmEBy
   4.396 +        bKT6OHLUQTJ0kr/8a1pVC05NwKE9L0s6LHXiuo7d6bO8a88Xm3ldUsgXAeZnethN0mSCgIhxvRQIe6QX
   4.397 +        zWKP/FqlzEc/cQd/+Pufk36aHLnXgx9Lgs8/5zwB9ELCxVpAkXxq1kogS4gsCQmht3BUuvodlK++Gukr
   4.398 +        XwFgtt1EbWQ7XnRb0U/H6ckneHniYSEp000mdcO0rm3vvu4iCD3afq5HtiQVyJsdNm+5kg3nb+RP//tf
   4.399 +        /MzP9pfDj/Wjbrr9JnF43zPI1jD+1CgNZ2GxY28BCTCytoaiFLJeAS+iVNSYmLVx2ilSroxkVUgnx15x
   4.400 +        pp9xs/Mknh6nL94sslpZ2NEzr9EL03qk98I2qDtuz5Z3e+sKhsTgiipvu+I6/uwvvvhzSfpi/FgbRRbU
   4.401 +        PA03wdKirEUpcHpaYPHMtL2U9Wsy8pOkxcRs1hDiuTa4Nky9uu/r5uNzqtJL2cJpcbpZJq9Veja96713
   4.402 +        EzbdGB0WbPriBM3aZav5wMc/xu/93h9IR09O/lTF6j9J/NgS/nJmYPG+QcX5KGHNYAW76dIKRE9Iulh8
   4.403 +        fJfkJTenZR2yL+fQLcm7twVyXspmN/Rm/Omkw8JMB7hoywYq1huff/9pwo/9w3/zt35TPHjvzt77bpHo
   4.404 +        dCz21E/PwL2cFw8v3xgJWZ+cVSqTtgXkgiWFltB3KRf1+eRMRvriCltXvQP8+m//9ln/3zs/q3hdg/Cm
   4.405 +        7UMicfKvqAW6WJyMWfz37gzvagy/aZ+x/XvBkHohWzvKYnGrKGM33UwYhI/rLaw/7M70LoRocfHWi3st
   4.406 +        U6/n9/484nUNyA03vk2Mj871yrUNx3lFNQ+LVrawkKzpbim3mPxuTcEqZhk5My4sqPh5m94lfXFiZrFd
   4.407 +        X5ygeT2/8ecdL9/z/Spx+RVXIVmi9z/vZK2UpVpfJvMGS733MDDJ5xR0wycne1Qtq7fqVTdkdL3dm/G+
   4.408 +        2srsue8SBimTcwGe7/UqbZDN9PXDQ3z0jg8yPduUjp6clPrk/8d43QPULRND5gdA1lyhxK98jm4qvVle
   4.409 +        liV8TaLhOLTa2Wwu5IusGjB69lw35DMaKLr4z2qk+HnB69IAAFu2bkGpLN2oaPFMj9IOschIr1ZUqpbF
   4.410 +        qnwZqyhjFWV8TVpSS4dsNrteSMNN8HzvDPIlqcD//t8+y/RsU3p6z2NSn/wfH2dl4HpaQGQVsjAAw1y6
   4.411 +        yiX7tmKWmVuUmFHz2cqW8VmHVtTuLZQ4nfD1m0dYlavxre/0yT6bOCuDeel1FwrvhEOdtPdPnbqktwLR
   4.412 +        W0s4sjZbs9clvVtwWWLLy9l53et89I4P/tymYX8acFYG9pOf+aTY+dB9BKeavSxbu7M0HMvnJNYuW90j
   4.413 +        fXFipodKkZGR9WzdtJkv/Y8v9Ul/A3DWBvmy7ReK4yfqtDtJbwEkZMRDVkkDljRRQKbeq5UKm7dv5p/+
   4.414 +        6Z/7pL/BOGv/NGrbZVfj2t+hFbWRpRw5VaFaVlAsGV3OMnPj9ey5u6HB+z/2S/zRjs9LUzOn+Gltmfp5
   4.415 +        x1kTgMEVFaRqgQvn28YQ3vzy8YUI4eINI0hphfvuv0eamuFnomXq5x1nVeUu336hGCyVEV6dsjVAMxYU
   4.416 +        m25vufLZ/K4+zg7OKimf+9IXxXe/cxdDI5sY0CX+8k//sk96H3300UcfffTRRx999NFHH3300UcfffTR
   4.417 +        Rx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH328fvz/S2i/
   4.418 +        CYub2lgAAAAASUVORK5CYII=
   4.419 +</value>
   4.420 +  </data>
   4.421 +</root>
   4.422 \ No newline at end of file
     5.1 --- a/Server/MainForm.Designer.cs	Thu Jul 28 19:32:40 2016 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,1321 +0,0 @@
     5.4 -namespace SharpDisplayManager
     5.5 -{
     5.6 -    partial class MainForm
     5.7 -    {
     5.8 -        /// <summary>
     5.9 -        /// Required designer variable.
    5.10 -        /// </summary>
    5.11 -        private System.ComponentModel.IContainer components = null;
    5.12 -
    5.13 -        /// <summary>
    5.14 -        /// Clean up any resources being used.
    5.15 -        /// </summary>
    5.16 -        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    5.17 -        protected override void Dispose(bool disposing)
    5.18 -        {
    5.19 -            if (disposing)
    5.20 -            {
    5.21 -                if (iNotifyIcon != null)
    5.22 -                {
    5.23 -                    iNotifyIcon.Dispose();
    5.24 -                    iNotifyIcon = null;
    5.25 -                }
    5.26 -                
    5.27 -                if (components != null)
    5.28 -                {
    5.29 -                    components.Dispose();
    5.30 -                }
    5.31 -            }
    5.32 -            base.Dispose(disposing);
    5.33 -        }
    5.34 -
    5.35 -        #region Windows Form Designer generated code
    5.36 -
    5.37 -        /// <summary>
    5.38 -        /// Required method for Designer support - do not modify
    5.39 -        /// the contents of this method with the code editor.
    5.40 -        /// </summary>
    5.41 -        private void InitializeComponent()
    5.42 -        {
    5.43 -            this.components = new System.ComponentModel.Container();
    5.44 -            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
    5.45 -            this.panelDisplay = new System.Windows.Forms.Panel();
    5.46 -            this.iTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
    5.47 -            this.marqueeLabelTop = new SharpDisplayManager.MarqueeLabel();
    5.48 -            this.marqueeLabelBottom = new SharpDisplayManager.MarqueeLabel();
    5.49 -            this.fontDialog = new System.Windows.Forms.FontDialog();
    5.50 -            this.timer = new System.Windows.Forms.Timer(this.components);
    5.51 -            this.statusStrip = new System.Windows.Forms.StatusStrip();
    5.52 -            this.toolStripStatusLabelConnect = new System.Windows.Forms.ToolStripStatusLabel();
    5.53 -            this.toolStripStatusLabelSpring = new System.Windows.Forms.ToolStripStatusLabel();
    5.54 -            this.toolStripStatusLabelPower = new System.Windows.Forms.ToolStripStatusLabel();
    5.55 -            this.toolStripStatusLabelFps = new System.Windows.Forms.ToolStripStatusLabel();
    5.56 -            this.tabPageClients = new System.Windows.Forms.TabPage();
    5.57 -            this.iCheckBoxStartIdleClient = new System.Windows.Forms.CheckBox();
    5.58 -            this.iButtonStartIdleClient = new System.Windows.Forms.Button();
    5.59 -            this.buttonCloseClients = new System.Windows.Forms.Button();
    5.60 -            this.buttonStartClient = new System.Windows.Forms.Button();
    5.61 -            this.iTreeViewClients = new System.Windows.Forms.TreeView();
    5.62 -            this.tabPageDisplay = new System.Windows.Forms.TabPage();
    5.63 -            this.buttonShowClock = new System.Windows.Forms.Button();
    5.64 -            this.buttonHideClock = new System.Windows.Forms.Button();
    5.65 -            this.buttonPowerOff = new System.Windows.Forms.Button();
    5.66 -            this.buttonPowerOn = new System.Windows.Forms.Button();
    5.67 -            this.labelTimerInterval = new System.Windows.Forms.Label();
    5.68 -            this.maskedTextBoxTimerInterval = new System.Windows.Forms.MaskedTextBox();
    5.69 -            this.comboBoxDisplayType = new System.Windows.Forms.ComboBox();
    5.70 -            this.buttonSuspend = new System.Windows.Forms.Button();
    5.71 -            this.checkBoxConnectOnStartup = new System.Windows.Forms.CheckBox();
    5.72 -            this.trackBarBrightness = new System.Windows.Forms.TrackBar();
    5.73 -            this.buttonFill = new System.Windows.Forms.Button();
    5.74 -            this.buttonClear = new System.Windows.Forms.Button();
    5.75 -            this.buttonClose = new System.Windows.Forms.Button();
    5.76 -            this.buttonOpen = new System.Windows.Forms.Button();
    5.77 -            this.buttonCapture = new System.Windows.Forms.Button();
    5.78 -            this.labelWarning = new System.Windows.Forms.Label();
    5.79 -            this.checkBoxFixedPitchFontOnly = new System.Windows.Forms.CheckBox();
    5.80 -            this.checkBoxShowBorders = new System.Windows.Forms.CheckBox();
    5.81 -            this.buttonFont = new System.Windows.Forms.Button();
    5.82 -            this.tabControl = new System.Windows.Forms.TabControl();
    5.83 -            this.tabPageDesign = new System.Windows.Forms.TabPage();
    5.84 -            this.labelScrollingSpeed = new System.Windows.Forms.Label();
    5.85 -            this.maskedTextBoxScrollingSpeed = new System.Windows.Forms.MaskedTextBox();
    5.86 -            this.labelScrollLoopSeparator = new System.Windows.Forms.Label();
    5.87 -            this.textBoxScrollLoopSeparator = new System.Windows.Forms.TextBox();
    5.88 -            this.labelMinFontSize = new System.Windows.Forms.Label();
    5.89 -            this.maskedTextBoxMinFontSize = new System.Windows.Forms.MaskedTextBox();
    5.90 -            this.checkBoxScaleToFit = new System.Windows.Forms.CheckBox();
    5.91 -            this.checkBoxInverseColors = new System.Windows.Forms.CheckBox();
    5.92 -            this.checkBoxReverseScreen = new System.Windows.Forms.CheckBox();
    5.93 -            this.tabPageAudio = new System.Windows.Forms.TabPage();
    5.94 -            this.labelDefaultAudioDevice = new System.Windows.Forms.Label();
    5.95 -            this.checkBoxShowVolumeLabel = new System.Windows.Forms.CheckBox();
    5.96 -            this.checkBoxMute = new System.Windows.Forms.CheckBox();
    5.97 -            this.trackBarMasterVolume = new System.Windows.Forms.TrackBar();
    5.98 -            this.tabPageInput = new System.Windows.Forms.TabPage();
    5.99 -            this.comboBoxOpticalDrives = new System.Windows.Forms.ComboBox();
   5.100 -            this.labelOpticalDriveEject = new System.Windows.Forms.Label();
   5.101 -            this.pictureBoxGreenStart = new System.Windows.Forms.PictureBox();
   5.102 -            this.labelStartFileName = new System.Windows.Forms.Label();
   5.103 -            this.buttonSelectFile = new System.Windows.Forms.Button();
   5.104 -            this.tabPageCec = new System.Windows.Forms.TabPage();
   5.105 -            this.groupBoxCecLogOptions = new System.Windows.Forms.GroupBox();
   5.106 -            this.checkBoxCecLogNoPoll = new System.Windows.Forms.CheckBox();
   5.107 -            this.checkBoxCecLogTraffic = new System.Windows.Forms.CheckBox();
   5.108 -            this.checkBoxCecLogDebug = new System.Windows.Forms.CheckBox();
   5.109 -            this.checkBoxCecLogNotice = new System.Windows.Forms.CheckBox();
   5.110 -            this.checkBoxCecLogError = new System.Windows.Forms.CheckBox();
   5.111 -            this.checkBoxCecLogWarning = new System.Windows.Forms.CheckBox();
   5.112 -            this.checkBoxCecEnabled = new System.Windows.Forms.CheckBox();
   5.113 -            this.labelHdmiPort = new System.Windows.Forms.Label();
   5.114 -            this.comboBoxHdmiPort = new System.Windows.Forms.ComboBox();
   5.115 -            this.tabPageEvent = new System.Windows.Forms.TabPage();
   5.116 -            this.buttonActionMoveUp = new System.Windows.Forms.Button();
   5.117 -            this.buttonActionMoveDown = new System.Windows.Forms.Button();
   5.118 -            this.buttonTestAction = new System.Windows.Forms.Button();
   5.119 -            this.buttonDeleteAction = new System.Windows.Forms.Button();
   5.120 -            this.buttonAddAction = new System.Windows.Forms.Button();
   5.121 -            this.iTreeViewEvents = new System.Windows.Forms.TreeView();
   5.122 -            this.tabPageApp = new System.Windows.Forms.TabPage();
   5.123 -            this.checkBoxStartMinimized = new System.Windows.Forms.CheckBox();
   5.124 -            this.checkBoxMinimizeToTray = new System.Windows.Forms.CheckBox();
   5.125 -            this.checkBoxAutoStart = new System.Windows.Forms.CheckBox();
   5.126 -            this.buttonUpdate = new System.Windows.Forms.Button();
   5.127 -            this.tabPageLogs = new System.Windows.Forms.TabPage();
   5.128 -            this.buttonClearLogs = new System.Windows.Forms.Button();
   5.129 -            this.richTextBoxLogs = new System.Windows.Forms.RichTextBox();
   5.130 -            this.labelFontWidth = new System.Windows.Forms.Label();
   5.131 -            this.labelFontHeight = new System.Windows.Forms.Label();
   5.132 -            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
   5.133 -            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
   5.134 -            this.panelDisplay.SuspendLayout();
   5.135 -            this.iTableLayoutPanel.SuspendLayout();
   5.136 -            this.statusStrip.SuspendLayout();
   5.137 -            this.tabPageClients.SuspendLayout();
   5.138 -            this.tabPageDisplay.SuspendLayout();
   5.139 -            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).BeginInit();
   5.140 -            this.tabControl.SuspendLayout();
   5.141 -            this.tabPageDesign.SuspendLayout();
   5.142 -            this.tabPageAudio.SuspendLayout();
   5.143 -            ((System.ComponentModel.ISupportInitialize)(this.trackBarMasterVolume)).BeginInit();
   5.144 -            this.tabPageInput.SuspendLayout();
   5.145 -            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxGreenStart)).BeginInit();
   5.146 -            this.tabPageCec.SuspendLayout();
   5.147 -            this.groupBoxCecLogOptions.SuspendLayout();
   5.148 -            this.tabPageEvent.SuspendLayout();
   5.149 -            this.tabPageApp.SuspendLayout();
   5.150 -            this.tabPageLogs.SuspendLayout();
   5.151 -            this.SuspendLayout();
   5.152 -            // 
   5.153 -            // panelDisplay
   5.154 -            // 
   5.155 -            this.panelDisplay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
   5.156 -            this.panelDisplay.Controls.Add(this.iTableLayoutPanel);
   5.157 -            this.panelDisplay.Location = new System.Drawing.Point(173, 40);
   5.158 -            this.panelDisplay.Margin = new System.Windows.Forms.Padding(0);
   5.159 -            this.panelDisplay.Name = "panelDisplay";
   5.160 -            this.panelDisplay.Size = new System.Drawing.Size(258, 66);
   5.161 -            this.panelDisplay.TabIndex = 12;
   5.162 -            // 
   5.163 -            // iTableLayoutPanel
   5.164 -            // 
   5.165 -            this.iTableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   5.166 -            | System.Windows.Forms.AnchorStyles.Left) 
   5.167 -            | System.Windows.Forms.AnchorStyles.Right)));
   5.168 -            this.iTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
   5.169 -            this.iTableLayoutPanel.BackColor = System.Drawing.SystemColors.ControlLightLight;
   5.170 -            this.iTableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
   5.171 -            this.iTableLayoutPanel.ColumnCount = 1;
   5.172 -            this.iTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
   5.173 -            this.iTableLayoutPanel.Controls.Add(this.marqueeLabelTop, 0, 0);
   5.174 -            this.iTableLayoutPanel.Controls.Add(this.marqueeLabelBottom, 0, 1);
   5.175 -            this.iTableLayoutPanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
   5.176 -            this.iTableLayoutPanel.Location = new System.Drawing.Point(0, 0);
   5.177 -            this.iTableLayoutPanel.Margin = new System.Windows.Forms.Padding(0);
   5.178 -            this.iTableLayoutPanel.Name = "iTableLayoutPanel";
   5.179 -            this.iTableLayoutPanel.RowCount = 2;
   5.180 -            this.iTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   5.181 -            this.iTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
   5.182 -            this.iTableLayoutPanel.Size = new System.Drawing.Size(256, 64);
   5.183 -            this.iTableLayoutPanel.TabIndex = 5;
   5.184 -            this.iTableLayoutPanel.SizeChanged += new System.EventHandler(this.tableLayoutPanel_SizeChanged);
   5.185 -            // 
   5.186 -            // marqueeLabelTop
   5.187 -            // 
   5.188 -            this.marqueeLabelTop.AutoEllipsis = true;
   5.189 -            this.marqueeLabelTop.AutoSize = true;
   5.190 -            this.marqueeLabelTop.BackColor = System.Drawing.Color.Transparent;
   5.191 -            this.marqueeLabelTop.Dock = System.Windows.Forms.DockStyle.Fill;
   5.192 -            this.marqueeLabelTop.Location = new System.Drawing.Point(1, 1);
   5.193 -            this.marqueeLabelTop.Margin = new System.Windows.Forms.Padding(0);
   5.194 -            this.marqueeLabelTop.MinFontSize = 15F;
   5.195 -            this.marqueeLabelTop.Name = "marqueeLabelTop";
   5.196 -            this.marqueeLabelTop.OwnTimer = false;
   5.197 -            this.marqueeLabelTop.PixelsPerSecond = 64;
   5.198 -            this.marqueeLabelTop.ScaleToFit = true;
   5.199 -            this.marqueeLabelTop.Separator = "|";
   5.200 -            this.marqueeLabelTop.Size = new System.Drawing.Size(254, 30);
   5.201 -            this.marqueeLabelTop.TabIndex = 2;
   5.202 -            this.marqueeLabelTop.Text = "ABCDEFGHIJKLMNOPQRST-0123456789";
   5.203 -            this.marqueeLabelTop.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   5.204 -            this.marqueeLabelTop.UseCompatibleTextRendering = true;
   5.205 -            // 
   5.206 -            // marqueeLabelBottom
   5.207 -            // 
   5.208 -            this.marqueeLabelBottom.AutoEllipsis = true;
   5.209 -            this.marqueeLabelBottom.AutoSize = true;
   5.210 -            this.marqueeLabelBottom.Dock = System.Windows.Forms.DockStyle.Fill;
   5.211 -            this.marqueeLabelBottom.Location = new System.Drawing.Point(1, 32);
   5.212 -            this.marqueeLabelBottom.Margin = new System.Windows.Forms.Padding(0);
   5.213 -            this.marqueeLabelBottom.MinFontSize = 15F;
   5.214 -            this.marqueeLabelBottom.Name = "marqueeLabelBottom";
   5.215 -            this.marqueeLabelBottom.OwnTimer = false;
   5.216 -            this.marqueeLabelBottom.PixelsPerSecond = 64;
   5.217 -            this.marqueeLabelBottom.ScaleToFit = true;
   5.218 -            this.marqueeLabelBottom.Separator = "|";
   5.219 -            this.marqueeLabelBottom.Size = new System.Drawing.Size(254, 31);
   5.220 -            this.marqueeLabelBottom.TabIndex = 3;
   5.221 -            this.marqueeLabelBottom.Text = "abcdefghijklmnopqrst-0123456789";
   5.222 -            this.marqueeLabelBottom.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   5.223 -            this.marqueeLabelBottom.UseCompatibleTextRendering = true;
   5.224 -            // 
   5.225 -            // timer
   5.226 -            // 
   5.227 -            this.timer.Interval = 50;
   5.228 -            this.timer.Tick += new System.EventHandler(this.timer_Tick);
   5.229 -            // 
   5.230 -            // statusStrip
   5.231 -            // 
   5.232 -            this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
   5.233 -            this.toolStripStatusLabelConnect,
   5.234 -            this.toolStripStatusLabelSpring,
   5.235 -            this.toolStripStatusLabelPower,
   5.236 -            this.toolStripStatusLabelFps});
   5.237 -            this.statusStrip.Location = new System.Drawing.Point(0, 539);
   5.238 -            this.statusStrip.Name = "statusStrip";
   5.239 -            this.statusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
   5.240 -            this.statusStrip.Size = new System.Drawing.Size(784, 22);
   5.241 -            this.statusStrip.TabIndex = 1;
   5.242 -            this.statusStrip.Text = "statusStrip";
   5.243 -            // 
   5.244 -            // toolStripStatusLabelConnect
   5.245 -            // 
   5.246 -            this.toolStripStatusLabelConnect.Name = "toolStripStatusLabelConnect";
   5.247 -            this.toolStripStatusLabelConnect.Size = new System.Drawing.Size(86, 17);
   5.248 -            this.toolStripStatusLabelConnect.Text = "Not connected";
   5.249 -            // 
   5.250 -            // toolStripStatusLabelSpring
   5.251 -            // 
   5.252 -            this.toolStripStatusLabelSpring.Name = "toolStripStatusLabelSpring";
   5.253 -            this.toolStripStatusLabelSpring.Size = new System.Drawing.Size(633, 17);
   5.254 -            this.toolStripStatusLabelSpring.Spring = true;
   5.255 -            // 
   5.256 -            // toolStripStatusLabelPower
   5.257 -            // 
   5.258 -            this.toolStripStatusLabelPower.Name = "toolStripStatusLabelPower";
   5.259 -            this.toolStripStatusLabelPower.Size = new System.Drawing.Size(24, 17);
   5.260 -            this.toolStripStatusLabelPower.Text = "NA";
   5.261 -            // 
   5.262 -            // toolStripStatusLabelFps
   5.263 -            // 
   5.264 -            this.toolStripStatusLabelFps.Name = "toolStripStatusLabelFps";
   5.265 -            this.toolStripStatusLabelFps.Size = new System.Drawing.Size(26, 17);
   5.266 -            this.toolStripStatusLabelFps.Text = "FPS";
   5.267 -            // 
   5.268 -            // tabPageClients
   5.269 -            // 
   5.270 -            this.tabPageClients.Controls.Add(this.iCheckBoxStartIdleClient);
   5.271 -            this.tabPageClients.Controls.Add(this.iButtonStartIdleClient);
   5.272 -            this.tabPageClients.Controls.Add(this.buttonCloseClients);
   5.273 -            this.tabPageClients.Controls.Add(this.buttonStartClient);
   5.274 -            this.tabPageClients.Controls.Add(this.iTreeViewClients);
   5.275 -            this.tabPageClients.Location = new System.Drawing.Point(4, 22);
   5.276 -            this.tabPageClients.Name = "tabPageClients";
   5.277 -            this.tabPageClients.Padding = new System.Windows.Forms.Padding(3);
   5.278 -            this.tabPageClients.Size = new System.Drawing.Size(752, 385);
   5.279 -            this.tabPageClients.TabIndex = 2;
   5.280 -            this.tabPageClients.Text = "Clients";
   5.281 -            this.tabPageClients.UseVisualStyleBackColor = true;
   5.282 -            // 
   5.283 -            // iCheckBoxStartIdleClient
   5.284 -            // 
   5.285 -            this.iCheckBoxStartIdleClient.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.286 -            this.iCheckBoxStartIdleClient.AutoSize = true;
   5.287 -            this.iCheckBoxStartIdleClient.Location = new System.Drawing.Point(108, 340);
   5.288 -            this.iCheckBoxStartIdleClient.Name = "iCheckBoxStartIdleClient";
   5.289 -            this.iCheckBoxStartIdleClient.Size = new System.Drawing.Size(145, 17);
   5.290 -            this.iCheckBoxStartIdleClient.TabIndex = 22;
   5.291 -            this.iCheckBoxStartIdleClient.Text = "Start idle client on startup";
   5.292 -            this.iCheckBoxStartIdleClient.UseVisualStyleBackColor = true;
   5.293 -            this.iCheckBoxStartIdleClient.CheckedChanged += new System.EventHandler(this.checkBoxStartIdleClient_CheckedChanged);
   5.294 -            // 
   5.295 -            // iButtonStartIdleClient
   5.296 -            // 
   5.297 -            this.iButtonStartIdleClient.Location = new System.Drawing.Point(6, 35);
   5.298 -            this.iButtonStartIdleClient.Name = "iButtonStartIdleClient";
   5.299 -            this.iButtonStartIdleClient.Size = new System.Drawing.Size(96, 23);
   5.300 -            this.iButtonStartIdleClient.TabIndex = 21;
   5.301 -            this.iButtonStartIdleClient.Text = "Start Idle Client";
   5.302 -            this.iButtonStartIdleClient.UseVisualStyleBackColor = true;
   5.303 -            this.iButtonStartIdleClient.Click += new System.EventHandler(this.ButtonStartIdleClient_Click);
   5.304 -            // 
   5.305 -            // buttonCloseClients
   5.306 -            // 
   5.307 -            this.buttonCloseClients.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.308 -            this.buttonCloseClients.Location = new System.Drawing.Point(6, 336);
   5.309 -            this.buttonCloseClients.Name = "buttonCloseClients";
   5.310 -            this.buttonCloseClients.Size = new System.Drawing.Size(96, 23);
   5.311 -            this.buttonCloseClients.TabIndex = 20;
   5.312 -            this.buttonCloseClients.Text = "Close Clients";
   5.313 -            this.buttonCloseClients.UseVisualStyleBackColor = true;
   5.314 -            this.buttonCloseClients.Click += new System.EventHandler(this.buttonCloseClients_Click);
   5.315 -            // 
   5.316 -            // buttonStartClient
   5.317 -            // 
   5.318 -            this.buttonStartClient.Location = new System.Drawing.Point(6, 6);
   5.319 -            this.buttonStartClient.Name = "buttonStartClient";
   5.320 -            this.buttonStartClient.Size = new System.Drawing.Size(96, 23);
   5.321 -            this.buttonStartClient.TabIndex = 19;
   5.322 -            this.buttonStartClient.Text = "Start Test Client";
   5.323 -            this.buttonStartClient.UseVisualStyleBackColor = true;
   5.324 -            this.buttonStartClient.Click += new System.EventHandler(this.buttonStartClient_Click);
   5.325 -            // 
   5.326 -            // iTreeViewClients
   5.327 -            // 
   5.328 -            this.iTreeViewClients.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   5.329 -            | System.Windows.Forms.AnchorStyles.Left) 
   5.330 -            | System.Windows.Forms.AnchorStyles.Right)));
   5.331 -            this.iTreeViewClients.Location = new System.Drawing.Point(108, 6);
   5.332 -            this.iTreeViewClients.Name = "iTreeViewClients";
   5.333 -            this.iTreeViewClients.Size = new System.Drawing.Size(638, 328);
   5.334 -            this.iTreeViewClients.TabIndex = 0;
   5.335 -            this.iTreeViewClients.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeViewClients_AfterSelect);
   5.336 -            // 
   5.337 -            // tabPageDisplay
   5.338 -            // 
   5.339 -            this.tabPageDisplay.Controls.Add(this.buttonShowClock);
   5.340 -            this.tabPageDisplay.Controls.Add(this.buttonHideClock);
   5.341 -            this.tabPageDisplay.Controls.Add(this.buttonPowerOff);
   5.342 -            this.tabPageDisplay.Controls.Add(this.buttonPowerOn);
   5.343 -            this.tabPageDisplay.Controls.Add(this.labelTimerInterval);
   5.344 -            this.tabPageDisplay.Controls.Add(this.maskedTextBoxTimerInterval);
   5.345 -            this.tabPageDisplay.Controls.Add(this.comboBoxDisplayType);
   5.346 -            this.tabPageDisplay.Controls.Add(this.buttonSuspend);
   5.347 -            this.tabPageDisplay.Controls.Add(this.checkBoxConnectOnStartup);
   5.348 -            this.tabPageDisplay.Controls.Add(this.trackBarBrightness);
   5.349 -            this.tabPageDisplay.Controls.Add(this.buttonFill);
   5.350 -            this.tabPageDisplay.Controls.Add(this.buttonClear);
   5.351 -            this.tabPageDisplay.Controls.Add(this.buttonClose);
   5.352 -            this.tabPageDisplay.Controls.Add(this.buttonOpen);
   5.353 -            this.tabPageDisplay.Controls.Add(this.buttonCapture);
   5.354 -            this.tabPageDisplay.Location = new System.Drawing.Point(4, 22);
   5.355 -            this.tabPageDisplay.Name = "tabPageDisplay";
   5.356 -            this.tabPageDisplay.Padding = new System.Windows.Forms.Padding(3);
   5.357 -            this.tabPageDisplay.Size = new System.Drawing.Size(752, 385);
   5.358 -            this.tabPageDisplay.TabIndex = 0;
   5.359 -            this.tabPageDisplay.Text = "Display";
   5.360 -            this.tabPageDisplay.UseVisualStyleBackColor = true;
   5.361 -            // 
   5.362 -            // buttonShowClock
   5.363 -            // 
   5.364 -            this.buttonShowClock.Location = new System.Drawing.Point(6, 122);
   5.365 -            this.buttonShowClock.Name = "buttonShowClock";
   5.366 -            this.buttonShowClock.Size = new System.Drawing.Size(75, 23);
   5.367 -            this.buttonShowClock.TabIndex = 23;
   5.368 -            this.buttonShowClock.Text = "Show Clock";
   5.369 -            this.buttonShowClock.UseVisualStyleBackColor = true;
   5.370 -            this.buttonShowClock.Click += new System.EventHandler(this.buttonShowClock_Click);
   5.371 -            // 
   5.372 -            // buttonHideClock
   5.373 -            // 
   5.374 -            this.buttonHideClock.Location = new System.Drawing.Point(6, 151);
   5.375 -            this.buttonHideClock.Name = "buttonHideClock";
   5.376 -            this.buttonHideClock.Size = new System.Drawing.Size(75, 23);
   5.377 -            this.buttonHideClock.TabIndex = 22;
   5.378 -            this.buttonHideClock.Text = "Hide Clock";
   5.379 -            this.buttonHideClock.UseVisualStyleBackColor = true;
   5.380 -            this.buttonHideClock.Click += new System.EventHandler(this.buttonHideClock_Click);
   5.381 -            // 
   5.382 -            // buttonPowerOff
   5.383 -            // 
   5.384 -            this.buttonPowerOff.Location = new System.Drawing.Point(6, 209);
   5.385 -            this.buttonPowerOff.Name = "buttonPowerOff";
   5.386 -            this.buttonPowerOff.Size = new System.Drawing.Size(75, 23);
   5.387 -            this.buttonPowerOff.TabIndex = 21;
   5.388 -            this.buttonPowerOff.Text = "OFF";
   5.389 -            this.buttonPowerOff.UseVisualStyleBackColor = true;
   5.390 -            this.buttonPowerOff.Click += new System.EventHandler(this.buttonPowerOff_Click);
   5.391 -            // 
   5.392 -            // buttonPowerOn
   5.393 -            // 
   5.394 -            this.buttonPowerOn.Location = new System.Drawing.Point(6, 180);
   5.395 -            this.buttonPowerOn.Name = "buttonPowerOn";
   5.396 -            this.buttonPowerOn.Size = new System.Drawing.Size(75, 23);
   5.397 -            this.buttonPowerOn.TabIndex = 20;
   5.398 -            this.buttonPowerOn.Text = "ON";
   5.399 -            this.buttonPowerOn.UseVisualStyleBackColor = true;
   5.400 -            this.buttonPowerOn.Click += new System.EventHandler(this.buttonPowerOn_Click);
   5.401 -            // 
   5.402 -            // labelTimerInterval
   5.403 -            // 
   5.404 -            this.labelTimerInterval.AutoSize = true;
   5.405 -            this.labelTimerInterval.Location = new System.Drawing.Point(184, 45);
   5.406 -            this.labelTimerInterval.Name = "labelTimerInterval";
   5.407 -            this.labelTimerInterval.Size = new System.Drawing.Size(98, 13);
   5.408 -            this.labelTimerInterval.TabIndex = 19;
   5.409 -            this.labelTimerInterval.Text = "Timer interval (ms) :";
   5.410 -            // 
   5.411 -            // maskedTextBoxTimerInterval
   5.412 -            // 
   5.413 -            this.maskedTextBoxTimerInterval.Location = new System.Drawing.Point(288, 42);
   5.414 -            this.maskedTextBoxTimerInterval.Mask = "000";
   5.415 -            this.maskedTextBoxTimerInterval.Name = "maskedTextBoxTimerInterval";
   5.416 -            this.maskedTextBoxTimerInterval.PromptChar = ' ';
   5.417 -            this.maskedTextBoxTimerInterval.Size = new System.Drawing.Size(24, 20);
   5.418 -            this.maskedTextBoxTimerInterval.TabIndex = 18;
   5.419 -            this.maskedTextBoxTimerInterval.TextChanged += new System.EventHandler(this.maskedTextBoxTimerInterval_TextChanged);
   5.420 -            // 
   5.421 -            // comboBoxDisplayType
   5.422 -            // 
   5.423 -            this.comboBoxDisplayType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   5.424 -            this.comboBoxDisplayType.FormattingEnabled = true;
   5.425 -            this.comboBoxDisplayType.Location = new System.Drawing.Point(187, 9);
   5.426 -            this.comboBoxDisplayType.Name = "comboBoxDisplayType";
   5.427 -            this.comboBoxDisplayType.Size = new System.Drawing.Size(181, 21);
   5.428 -            this.comboBoxDisplayType.TabIndex = 17;
   5.429 -            this.comboBoxDisplayType.SelectedIndexChanged += new System.EventHandler(this.comboBoxDisplayType_SelectedIndexChanged);
   5.430 -            // 
   5.431 -            // buttonSuspend
   5.432 -            // 
   5.433 -            this.buttonSuspend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.434 -            this.buttonSuspend.Location = new System.Drawing.Point(6, 317);
   5.435 -            this.buttonSuspend.Name = "buttonSuspend";
   5.436 -            this.buttonSuspend.Size = new System.Drawing.Size(75, 23);
   5.437 -            this.buttonSuspend.TabIndex = 16;
   5.438 -            this.buttonSuspend.Text = "Pause";
   5.439 -            this.buttonSuspend.UseVisualStyleBackColor = true;
   5.440 -            this.buttonSuspend.Click += new System.EventHandler(this.buttonSuspend_Click);
   5.441 -            // 
   5.442 -            // checkBoxConnectOnStartup
   5.443 -            // 
   5.444 -            this.checkBoxConnectOnStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.445 -            this.checkBoxConnectOnStartup.AutoSize = true;
   5.446 -            this.checkBoxConnectOnStartup.Location = new System.Drawing.Point(113, 350);
   5.447 -            this.checkBoxConnectOnStartup.Name = "checkBoxConnectOnStartup";
   5.448 -            this.checkBoxConnectOnStartup.Size = new System.Drawing.Size(119, 17);
   5.449 -            this.checkBoxConnectOnStartup.TabIndex = 13;
   5.450 -            this.checkBoxConnectOnStartup.Text = "Connect on stratup ";
   5.451 -            this.checkBoxConnectOnStartup.UseVisualStyleBackColor = true;
   5.452 -            this.checkBoxConnectOnStartup.CheckedChanged += new System.EventHandler(this.checkBoxConnectOnStartup_CheckedChanged);
   5.453 -            // 
   5.454 -            // trackBarBrightness
   5.455 -            // 
   5.456 -            this.trackBarBrightness.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   5.457 -            | System.Windows.Forms.AnchorStyles.Right)));
   5.458 -            this.trackBarBrightness.BackColor = System.Drawing.SystemColors.Window;
   5.459 -            this.trackBarBrightness.Location = new System.Drawing.Point(704, 9);
   5.460 -            this.trackBarBrightness.Name = "trackBarBrightness";
   5.461 -            this.trackBarBrightness.Orientation = System.Windows.Forms.Orientation.Vertical;
   5.462 -            this.trackBarBrightness.Size = new System.Drawing.Size(45, 358);
   5.463 -            this.trackBarBrightness.TabIndex = 10;
   5.464 -            this.trackBarBrightness.TickStyle = System.Windows.Forms.TickStyle.Both;
   5.465 -            this.toolTip.SetToolTip(this.trackBarBrightness, "Brightness adjustment");
   5.466 -            this.trackBarBrightness.Scroll += new System.EventHandler(this.trackBarBrightness_Scroll);
   5.467 -            // 
   5.468 -            // buttonFill
   5.469 -            // 
   5.470 -            this.buttonFill.Location = new System.Drawing.Point(6, 93);
   5.471 -            this.buttonFill.Name = "buttonFill";
   5.472 -            this.buttonFill.Size = new System.Drawing.Size(75, 23);
   5.473 -            this.buttonFill.TabIndex = 9;
   5.474 -            this.buttonFill.Text = "Fill";
   5.475 -            this.buttonFill.UseVisualStyleBackColor = true;
   5.476 -            this.buttonFill.Click += new System.EventHandler(this.buttonFill_Click);
   5.477 -            // 
   5.478 -            // buttonClear
   5.479 -            // 
   5.480 -            this.buttonClear.Location = new System.Drawing.Point(6, 64);
   5.481 -            this.buttonClear.Name = "buttonClear";
   5.482 -            this.buttonClear.Size = new System.Drawing.Size(75, 23);
   5.483 -            this.buttonClear.TabIndex = 8;
   5.484 -            this.buttonClear.Text = "Clear";
   5.485 -            this.buttonClear.UseVisualStyleBackColor = true;
   5.486 -            this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click);
   5.487 -            // 
   5.488 -            // buttonClose
   5.489 -            // 
   5.490 -            this.buttonClose.Location = new System.Drawing.Point(6, 35);
   5.491 -            this.buttonClose.Name = "buttonClose";
   5.492 -            this.buttonClose.Size = new System.Drawing.Size(75, 23);
   5.493 -            this.buttonClose.TabIndex = 7;
   5.494 -            this.buttonClose.Text = "Close";
   5.495 -            this.buttonClose.UseVisualStyleBackColor = true;
   5.496 -            this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
   5.497 -            // 
   5.498 -            // buttonOpen
   5.499 -            // 
   5.500 -            this.buttonOpen.Location = new System.Drawing.Point(6, 6);
   5.501 -            this.buttonOpen.Name = "buttonOpen";
   5.502 -            this.buttonOpen.Size = new System.Drawing.Size(75, 23);
   5.503 -            this.buttonOpen.TabIndex = 6;
   5.504 -            this.buttonOpen.Text = "Open";
   5.505 -            this.buttonOpen.UseVisualStyleBackColor = true;
   5.506 -            this.buttonOpen.Click += new System.EventHandler(this.buttonOpen_Click);
   5.507 -            // 
   5.508 -            // buttonCapture
   5.509 -            // 
   5.510 -            this.buttonCapture.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.511 -            this.buttonCapture.Location = new System.Drawing.Point(6, 346);
   5.512 -            this.buttonCapture.Name = "buttonCapture";
   5.513 -            this.buttonCapture.Size = new System.Drawing.Size(75, 23);
   5.514 -            this.buttonCapture.TabIndex = 5;
   5.515 -            this.buttonCapture.Text = "Capture";
   5.516 -            this.buttonCapture.UseVisualStyleBackColor = true;
   5.517 -            this.buttonCapture.Click += new System.EventHandler(this.buttonCapture_Click);
   5.518 -            // 
   5.519 -            // labelWarning
   5.520 -            // 
   5.521 -            this.labelWarning.AutoSize = true;
   5.522 -            this.labelWarning.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
   5.523 -            this.labelWarning.ForeColor = System.Drawing.Color.Red;
   5.524 -            this.labelWarning.Location = new System.Drawing.Point(9, 9);
   5.525 -            this.labelWarning.Name = "labelWarning";
   5.526 -            this.labelWarning.Size = new System.Drawing.Size(80, 16);
   5.527 -            this.labelWarning.TabIndex = 18;
   5.528 -            this.labelWarning.Text = "WARNING";
   5.529 -            this.labelWarning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   5.530 -            this.labelWarning.Visible = false;
   5.531 -            // 
   5.532 -            // checkBoxFixedPitchFontOnly
   5.533 -            // 
   5.534 -            this.checkBoxFixedPitchFontOnly.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.535 -            this.checkBoxFixedPitchFontOnly.AutoSize = true;
   5.536 -            this.checkBoxFixedPitchFontOnly.Location = new System.Drawing.Point(87, 362);
   5.537 -            this.checkBoxFixedPitchFontOnly.Name = "checkBoxFixedPitchFontOnly";
   5.538 -            this.checkBoxFixedPitchFontOnly.Size = new System.Drawing.Size(120, 17);
   5.539 -            this.checkBoxFixedPitchFontOnly.TabIndex = 17;
   5.540 -            this.checkBoxFixedPitchFontOnly.Text = "Fixed pitch font only";
   5.541 -            this.checkBoxFixedPitchFontOnly.UseVisualStyleBackColor = true;
   5.542 -            // 
   5.543 -            // checkBoxShowBorders
   5.544 -            // 
   5.545 -            this.checkBoxShowBorders.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   5.546 -            this.checkBoxShowBorders.AutoSize = true;
   5.547 -            this.checkBoxShowBorders.Location = new System.Drawing.Point(645, 29);
   5.548 -            this.checkBoxShowBorders.Name = "checkBoxShowBorders";
   5.549 -            this.checkBoxShowBorders.Size = new System.Drawing.Size(91, 17);
   5.550 -            this.checkBoxShowBorders.TabIndex = 11;
   5.551 -            this.checkBoxShowBorders.Text = "Show borders";
   5.552 -            this.checkBoxShowBorders.UseVisualStyleBackColor = true;
   5.553 -            this.checkBoxShowBorders.CheckedChanged += new System.EventHandler(this.checkBoxShowBorders_CheckedChanged);
   5.554 -            // 
   5.555 -            // buttonFont
   5.556 -            // 
   5.557 -            this.buttonFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.558 -            this.buttonFont.Location = new System.Drawing.Point(6, 356);
   5.559 -            this.buttonFont.Name = "buttonFont";
   5.560 -            this.buttonFont.Size = new System.Drawing.Size(75, 23);
   5.561 -            this.buttonFont.TabIndex = 0;
   5.562 -            this.buttonFont.Text = "Select Font";
   5.563 -            this.buttonFont.UseVisualStyleBackColor = true;
   5.564 -            this.buttonFont.Click += new System.EventHandler(this.buttonFont_Click);
   5.565 -            // 
   5.566 -            // tabControl
   5.567 -            // 
   5.568 -            this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   5.569 -            | System.Windows.Forms.AnchorStyles.Left) 
   5.570 -            | System.Windows.Forms.AnchorStyles.Right)));
   5.571 -            this.tabControl.Controls.Add(this.tabPageDisplay);
   5.572 -            this.tabControl.Controls.Add(this.tabPageClients);
   5.573 -            this.tabControl.Controls.Add(this.tabPageDesign);
   5.574 -            this.tabControl.Controls.Add(this.tabPageAudio);
   5.575 -            this.tabControl.Controls.Add(this.tabPageInput);
   5.576 -            this.tabControl.Controls.Add(this.tabPageCec);
   5.577 -            this.tabControl.Controls.Add(this.tabPageEvent);
   5.578 -            this.tabControl.Controls.Add(this.tabPageApp);
   5.579 -            this.tabControl.Controls.Add(this.tabPageLogs);
   5.580 -            this.tabControl.Location = new System.Drawing.Point(12, 125);
   5.581 -            this.tabControl.Name = "tabControl";
   5.582 -            this.tabControl.SelectedIndex = 0;
   5.583 -            this.tabControl.Size = new System.Drawing.Size(760, 411);
   5.584 -            this.tabControl.TabIndex = 0;
   5.585 -            // 
   5.586 -            // tabPageDesign
   5.587 -            // 
   5.588 -            this.tabPageDesign.Controls.Add(this.labelScrollingSpeed);
   5.589 -            this.tabPageDesign.Controls.Add(this.maskedTextBoxScrollingSpeed);
   5.590 -            this.tabPageDesign.Controls.Add(this.labelScrollLoopSeparator);
   5.591 -            this.tabPageDesign.Controls.Add(this.textBoxScrollLoopSeparator);
   5.592 -            this.tabPageDesign.Controls.Add(this.labelMinFontSize);
   5.593 -            this.tabPageDesign.Controls.Add(this.maskedTextBoxMinFontSize);
   5.594 -            this.tabPageDesign.Controls.Add(this.checkBoxScaleToFit);
   5.595 -            this.tabPageDesign.Controls.Add(this.checkBoxInverseColors);
   5.596 -            this.tabPageDesign.Controls.Add(this.checkBoxFixedPitchFontOnly);
   5.597 -            this.tabPageDesign.Controls.Add(this.buttonFont);
   5.598 -            this.tabPageDesign.Controls.Add(this.checkBoxReverseScreen);
   5.599 -            this.tabPageDesign.Controls.Add(this.checkBoxShowBorders);
   5.600 -            this.tabPageDesign.Location = new System.Drawing.Point(4, 22);
   5.601 -            this.tabPageDesign.Name = "tabPageDesign";
   5.602 -            this.tabPageDesign.Padding = new System.Windows.Forms.Padding(3);
   5.603 -            this.tabPageDesign.Size = new System.Drawing.Size(752, 385);
   5.604 -            this.tabPageDesign.TabIndex = 3;
   5.605 -            this.tabPageDesign.Text = "Design";
   5.606 -            this.tabPageDesign.UseVisualStyleBackColor = true;
   5.607 -            // 
   5.608 -            // labelScrollingSpeed
   5.609 -            // 
   5.610 -            this.labelScrollingSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.611 -            this.labelScrollingSpeed.AutoSize = true;
   5.612 -            this.labelScrollingSpeed.Location = new System.Drawing.Point(92, 248);
   5.613 -            this.labelScrollingSpeed.Name = "labelScrollingSpeed";
   5.614 -            this.labelScrollingSpeed.Size = new System.Drawing.Size(115, 13);
   5.615 -            this.labelScrollingSpeed.TabIndex = 28;
   5.616 -            this.labelScrollingSpeed.Text = "Scrolling speed (px/s) :";
   5.617 -            // 
   5.618 -            // maskedTextBoxScrollingSpeed
   5.619 -            // 
   5.620 -            this.maskedTextBoxScrollingSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.621 -            this.maskedTextBoxScrollingSpeed.Location = new System.Drawing.Point(213, 245);
   5.622 -            this.maskedTextBoxScrollingSpeed.Mask = "000";
   5.623 -            this.maskedTextBoxScrollingSpeed.Name = "maskedTextBoxScrollingSpeed";
   5.624 -            this.maskedTextBoxScrollingSpeed.PromptChar = ' ';
   5.625 -            this.maskedTextBoxScrollingSpeed.Size = new System.Drawing.Size(24, 20);
   5.626 -            this.maskedTextBoxScrollingSpeed.TabIndex = 27;
   5.627 -            this.maskedTextBoxScrollingSpeed.TextChanged += new System.EventHandler(this.maskedTextBoxScrollingSpeed_TextChanged);
   5.628 -            // 
   5.629 -            // labelScrollLoopSeparator
   5.630 -            // 
   5.631 -            this.labelScrollLoopSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.632 -            this.labelScrollLoopSeparator.AutoSize = true;
   5.633 -            this.labelScrollLoopSeparator.Location = new System.Drawing.Point(98, 274);
   5.634 -            this.labelScrollLoopSeparator.Name = "labelScrollLoopSeparator";
   5.635 -            this.labelScrollLoopSeparator.Size = new System.Drawing.Size(109, 13);
   5.636 -            this.labelScrollLoopSeparator.TabIndex = 26;
   5.637 -            this.labelScrollLoopSeparator.Text = "Scroll loop separator :";
   5.638 -            // 
   5.639 -            // textBoxScrollLoopSeparator
   5.640 -            // 
   5.641 -            this.textBoxScrollLoopSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.642 -            this.textBoxScrollLoopSeparator.Location = new System.Drawing.Point(213, 271);
   5.643 -            this.textBoxScrollLoopSeparator.Name = "textBoxScrollLoopSeparator";
   5.644 -            this.textBoxScrollLoopSeparator.Size = new System.Drawing.Size(74, 20);
   5.645 -            this.textBoxScrollLoopSeparator.TabIndex = 25;
   5.646 -            this.textBoxScrollLoopSeparator.TextChanged += new System.EventHandler(this.textBoxScrollLoopSeparator_TextChanged);
   5.647 -            // 
   5.648 -            // labelMinFontSize
   5.649 -            // 
   5.650 -            this.labelMinFontSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.651 -            this.labelMinFontSize.AutoSize = true;
   5.652 -            this.labelMinFontSize.Location = new System.Drawing.Point(88, 323);
   5.653 -            this.labelMinFontSize.Name = "labelMinFontSize";
   5.654 -            this.labelMinFontSize.Size = new System.Drawing.Size(119, 13);
   5.655 -            this.labelMinFontSize.TabIndex = 24;
   5.656 -            this.labelMinFontSize.Text = "Minimum font size (pts) :";
   5.657 -            // 
   5.658 -            // maskedTextBoxMinFontSize
   5.659 -            // 
   5.660 -            this.maskedTextBoxMinFontSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.661 -            this.maskedTextBoxMinFontSize.Location = new System.Drawing.Point(213, 320);
   5.662 -            this.maskedTextBoxMinFontSize.Mask = "000";
   5.663 -            this.maskedTextBoxMinFontSize.Name = "maskedTextBoxMinFontSize";
   5.664 -            this.maskedTextBoxMinFontSize.PromptChar = ' ';
   5.665 -            this.maskedTextBoxMinFontSize.Size = new System.Drawing.Size(24, 20);
   5.666 -            this.maskedTextBoxMinFontSize.TabIndex = 23;
   5.667 -            this.maskedTextBoxMinFontSize.TextChanged += new System.EventHandler(this.maskedTextBoxMinFontSize_TextChanged);
   5.668 -            // 
   5.669 -            // checkBoxScaleToFit
   5.670 -            // 
   5.671 -            this.checkBoxScaleToFit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.672 -            this.checkBoxScaleToFit.AutoSize = true;
   5.673 -            this.checkBoxScaleToFit.Location = new System.Drawing.Point(86, 297);
   5.674 -            this.checkBoxScaleToFit.Name = "checkBoxScaleToFit";
   5.675 -            this.checkBoxScaleToFit.Size = new System.Drawing.Size(201, 17);
   5.676 -            this.checkBoxScaleToFit.TabIndex = 22;
   5.677 -            this.checkBoxScaleToFit.Text = "Try scale font down to avoid scrolling";
   5.678 -            this.checkBoxScaleToFit.UseVisualStyleBackColor = true;
   5.679 -            this.checkBoxScaleToFit.CheckedChanged += new System.EventHandler(this.checkBoxScaleToFit_CheckedChanged);
   5.680 -            // 
   5.681 -            // checkBoxInverseColors
   5.682 -            // 
   5.683 -            this.checkBoxInverseColors.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   5.684 -            this.checkBoxInverseColors.AutoSize = true;
   5.685 -            this.checkBoxInverseColors.Location = new System.Drawing.Point(645, 52);
   5.686 -            this.checkBoxInverseColors.Name = "checkBoxInverseColors";
   5.687 -            this.checkBoxInverseColors.Size = new System.Drawing.Size(92, 17);
   5.688 -            this.checkBoxInverseColors.TabIndex = 21;
   5.689 -            this.checkBoxInverseColors.Text = "Inverse colors";
   5.690 -            this.checkBoxInverseColors.UseVisualStyleBackColor = true;
   5.691 -            this.checkBoxInverseColors.CheckedChanged += new System.EventHandler(this.checkBoxInverseColors_CheckedChanged);
   5.692 -            // 
   5.693 -            // checkBoxReverseScreen
   5.694 -            // 
   5.695 -            this.checkBoxReverseScreen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
   5.696 -            this.checkBoxReverseScreen.AutoSize = true;
   5.697 -            this.checkBoxReverseScreen.Location = new System.Drawing.Point(645, 6);
   5.698 -            this.checkBoxReverseScreen.Name = "checkBoxReverseScreen";
   5.699 -            this.checkBoxReverseScreen.Size = new System.Drawing.Size(101, 17);
   5.700 -            this.checkBoxReverseScreen.TabIndex = 14;
   5.701 -            this.checkBoxReverseScreen.Text = "Reverse screen";
   5.702 -            this.checkBoxReverseScreen.UseVisualStyleBackColor = true;
   5.703 -            this.checkBoxReverseScreen.CheckedChanged += new System.EventHandler(this.checkBoxReverseScreen_CheckedChanged);
   5.704 -            // 
   5.705 -            // tabPageAudio
   5.706 -            // 
   5.707 -            this.tabPageAudio.Controls.Add(this.labelDefaultAudioDevice);
   5.708 -            this.tabPageAudio.Controls.Add(this.checkBoxShowVolumeLabel);
   5.709 -            this.tabPageAudio.Controls.Add(this.checkBoxMute);
   5.710 -            this.tabPageAudio.Controls.Add(this.trackBarMasterVolume);
   5.711 -            this.tabPageAudio.Location = new System.Drawing.Point(4, 22);
   5.712 -            this.tabPageAudio.Name = "tabPageAudio";
   5.713 -            this.tabPageAudio.Padding = new System.Windows.Forms.Padding(3);
   5.714 -            this.tabPageAudio.Size = new System.Drawing.Size(752, 385);
   5.715 -            this.tabPageAudio.TabIndex = 5;
   5.716 -            this.tabPageAudio.Text = "Audio";
   5.717 -            this.tabPageAudio.UseVisualStyleBackColor = true;
   5.718 -            // 
   5.719 -            // labelDefaultAudioDevice
   5.720 -            // 
   5.721 -            this.labelDefaultAudioDevice.AutoSize = true;
   5.722 -            this.labelDefaultAudioDevice.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
   5.723 -            this.labelDefaultAudioDevice.Location = new System.Drawing.Point(3, 6);
   5.724 -            this.labelDefaultAudioDevice.Name = "labelDefaultAudioDevice";
   5.725 -            this.labelDefaultAudioDevice.Size = new System.Drawing.Size(120, 13);
   5.726 -            this.labelDefaultAudioDevice.TabIndex = 19;
   5.727 -            this.labelDefaultAudioDevice.Text = "Audio Device Unknown";
   5.728 -            // 
   5.729 -            // checkBoxShowVolumeLabel
   5.730 -            // 
   5.731 -            this.checkBoxShowVolumeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.732 -            this.checkBoxShowVolumeLabel.AutoSize = true;
   5.733 -            this.checkBoxShowVolumeLabel.Location = new System.Drawing.Point(3, 329);
   5.734 -            this.checkBoxShowVolumeLabel.Name = "checkBoxShowVolumeLabel";
   5.735 -            this.checkBoxShowVolumeLabel.Size = new System.Drawing.Size(115, 17);
   5.736 -            this.checkBoxShowVolumeLabel.TabIndex = 18;
   5.737 -            this.checkBoxShowVolumeLabel.Text = "Show volume label";
   5.738 -            this.checkBoxShowVolumeLabel.UseVisualStyleBackColor = true;
   5.739 -            this.checkBoxShowVolumeLabel.CheckedChanged += new System.EventHandler(this.checkBoxShowVolumeLabel_CheckedChanged);
   5.740 -            // 
   5.741 -            // checkBoxMute
   5.742 -            // 
   5.743 -            this.checkBoxMute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.744 -            this.checkBoxMute.AutoSize = true;
   5.745 -            this.checkBoxMute.Location = new System.Drawing.Point(3, 352);
   5.746 -            this.checkBoxMute.Name = "checkBoxMute";
   5.747 -            this.checkBoxMute.Size = new System.Drawing.Size(50, 17);
   5.748 -            this.checkBoxMute.TabIndex = 17;
   5.749 -            this.checkBoxMute.Text = "Mute";
   5.750 -            this.checkBoxMute.UseVisualStyleBackColor = true;
   5.751 -            this.checkBoxMute.CheckedChanged += new System.EventHandler(this.checkBoxMute_CheckedChanged);
   5.752 -            // 
   5.753 -            // trackBarMasterVolume
   5.754 -            // 
   5.755 -            this.trackBarMasterVolume.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
   5.756 -            | System.Windows.Forms.AnchorStyles.Right)));
   5.757 -            this.trackBarMasterVolume.BackColor = System.Drawing.SystemColors.Window;
   5.758 -            this.trackBarMasterVolume.Location = new System.Drawing.Point(701, 6);
   5.759 -            this.trackBarMasterVolume.Maximum = 100;
   5.760 -            this.trackBarMasterVolume.Name = "trackBarMasterVolume";
   5.761 -            this.trackBarMasterVolume.Orientation = System.Windows.Forms.Orientation.Vertical;
   5.762 -            this.trackBarMasterVolume.Size = new System.Drawing.Size(45, 373);
   5.763 -            this.trackBarMasterVolume.TabIndex = 0;
   5.764 -            this.trackBarMasterVolume.TickFrequency = 10;
   5.765 -            this.trackBarMasterVolume.TickStyle = System.Windows.Forms.TickStyle.Both;
   5.766 -            this.toolTip.SetToolTip(this.trackBarMasterVolume, "Master Volume");
   5.767 -            this.trackBarMasterVolume.Scroll += new System.EventHandler(this.trackBarMasterVolume_Scroll);
   5.768 -            // 
   5.769 -            // tabPageInput
   5.770 -            // 
   5.771 -            this.tabPageInput.Controls.Add(this.comboBoxOpticalDrives);
   5.772 -            this.tabPageInput.Controls.Add(this.labelOpticalDriveEject);
   5.773 -            this.tabPageInput.Controls.Add(this.pictureBoxGreenStart);
   5.774 -            this.tabPageInput.Controls.Add(this.labelStartFileName);
   5.775 -            this.tabPageInput.Controls.Add(this.buttonSelectFile);
   5.776 -            this.tabPageInput.Location = new System.Drawing.Point(4, 22);
   5.777 -            this.tabPageInput.Name = "tabPageInput";
   5.778 -            this.tabPageInput.Padding = new System.Windows.Forms.Padding(3);
   5.779 -            this.tabPageInput.Size = new System.Drawing.Size(752, 385);
   5.780 -            this.tabPageInput.TabIndex = 6;
   5.781 -            this.tabPageInput.Text = "Input";
   5.782 -            this.tabPageInput.UseVisualStyleBackColor = true;
   5.783 -            // 
   5.784 -            // comboBoxOpticalDrives
   5.785 -            // 
   5.786 -            this.comboBoxOpticalDrives.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   5.787 -            this.comboBoxOpticalDrives.FormattingEnabled = true;
   5.788 -            this.comboBoxOpticalDrives.Location = new System.Drawing.Point(113, 53);
   5.789 -            this.comboBoxOpticalDrives.Name = "comboBoxOpticalDrives";
   5.790 -            this.comboBoxOpticalDrives.Size = new System.Drawing.Size(55, 21);
   5.791 -            this.comboBoxOpticalDrives.TabIndex = 18;
   5.792 -            this.comboBoxOpticalDrives.SelectedIndexChanged += new System.EventHandler(this.comboBoxOpticalDrives_SelectedIndexChanged);
   5.793 -            // 
   5.794 -            // labelOpticalDriveEject
   5.795 -            // 
   5.796 -            this.labelOpticalDriveEject.AutoSize = true;
   5.797 -            this.labelOpticalDriveEject.Location = new System.Drawing.Point(0, 56);
   5.798 -            this.labelOpticalDriveEject.Name = "labelOpticalDriveEject";
   5.799 -            this.labelOpticalDriveEject.Size = new System.Drawing.Size(107, 13);
   5.800 -            this.labelOpticalDriveEject.TabIndex = 3;
   5.801 -            this.labelOpticalDriveEject.Text = "Optical drive to eject:";
   5.802 -            // 
   5.803 -            // pictureBoxGreenStart
   5.804 -            // 
   5.805 -            this.pictureBoxGreenStart.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxGreenStart.Image")));
   5.806 -            this.pictureBoxGreenStart.Location = new System.Drawing.Point(3, 6);
   5.807 -            this.pictureBoxGreenStart.Name = "pictureBoxGreenStart";
   5.808 -            this.pictureBoxGreenStart.Size = new System.Drawing.Size(32, 32);
   5.809 -            this.pictureBoxGreenStart.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
   5.810 -            this.pictureBoxGreenStart.TabIndex = 2;
   5.811 -            this.pictureBoxGreenStart.TabStop = false;
   5.812 -            // 
   5.813 -            // labelStartFileName
   5.814 -            // 
   5.815 -            this.labelStartFileName.AutoSize = true;
   5.816 -            this.labelStartFileName.Location = new System.Drawing.Point(72, 16);
   5.817 -            this.labelStartFileName.Name = "labelStartFileName";
   5.818 -            this.labelStartFileName.Size = new System.Drawing.Size(33, 13);
   5.819 -            this.labelStartFileName.TabIndex = 1;
   5.820 -            this.labelStartFileName.Text = "None";
   5.821 -            // 
   5.822 -            // buttonSelectFile
   5.823 -            // 
   5.824 -            this.buttonSelectFile.Location = new System.Drawing.Point(41, 11);
   5.825 -            this.buttonSelectFile.Name = "buttonSelectFile";
   5.826 -            this.buttonSelectFile.Size = new System.Drawing.Size(25, 23);
   5.827 -            this.buttonSelectFile.TabIndex = 0;
   5.828 -            this.buttonSelectFile.Text = "...";
   5.829 -            this.buttonSelectFile.UseVisualStyleBackColor = true;
   5.830 -            this.buttonSelectFile.Click += new System.EventHandler(this.buttonSelectFile_Click);
   5.831 -            // 
   5.832 -            // tabPageCec
   5.833 -            // 
   5.834 -            this.tabPageCec.Controls.Add(this.groupBoxCecLogOptions);
   5.835 -            this.tabPageCec.Controls.Add(this.checkBoxCecEnabled);
   5.836 -            this.tabPageCec.Controls.Add(this.labelHdmiPort);
   5.837 -            this.tabPageCec.Controls.Add(this.comboBoxHdmiPort);
   5.838 -            this.tabPageCec.Location = new System.Drawing.Point(4, 22);
   5.839 -            this.tabPageCec.Name = "tabPageCec";
   5.840 -            this.tabPageCec.Padding = new System.Windows.Forms.Padding(3);
   5.841 -            this.tabPageCec.Size = new System.Drawing.Size(752, 385);
   5.842 -            this.tabPageCec.TabIndex = 7;
   5.843 -            this.tabPageCec.Text = "CEC";
   5.844 -            this.tabPageCec.UseVisualStyleBackColor = true;
   5.845 -            // 
   5.846 -            // groupBoxCecLogOptions
   5.847 -            // 
   5.848 -            this.groupBoxCecLogOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   5.849 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogNoPoll);
   5.850 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogTraffic);
   5.851 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogDebug);
   5.852 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogNotice);
   5.853 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogError);
   5.854 -            this.groupBoxCecLogOptions.Controls.Add(this.checkBoxCecLogWarning);
   5.855 -            this.groupBoxCecLogOptions.Location = new System.Drawing.Point(6, 239);
   5.856 -            this.groupBoxCecLogOptions.Name = "groupBoxCecLogOptions";
   5.857 -            this.groupBoxCecLogOptions.Size = new System.Drawing.Size(165, 140);
   5.858 -            this.groupBoxCecLogOptions.TabIndex = 25;
   5.859 -            this.groupBoxCecLogOptions.TabStop = false;
   5.860 -            this.groupBoxCecLogOptions.Text = "Log options";
   5.861 -            // 
   5.862 -            // checkBoxCecLogNoPoll
   5.863 -            // 
   5.864 -            this.checkBoxCecLogNoPoll.AutoSize = true;
   5.865 -            this.checkBoxCecLogNoPoll.Checked = true;
   5.866 -            this.checkBoxCecLogNoPoll.CheckState = System.Windows.Forms.CheckState.Checked;
   5.867 -            this.checkBoxCecLogNoPoll.Location = new System.Drawing.Point(76, 24);
   5.868 -            this.checkBoxCecLogNoPoll.Name = "checkBoxCecLogNoPoll";
   5.869 -            this.checkBoxCecLogNoPoll.Size = new System.Drawing.Size(59, 17);
   5.870 -            this.checkBoxCecLogNoPoll.TabIndex = 30;
   5.871 -            this.checkBoxCecLogNoPoll.Text = "No poll";
   5.872 -            this.checkBoxCecLogNoPoll.UseVisualStyleBackColor = true;
   5.873 -            this.checkBoxCecLogNoPoll.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.874 -            // 
   5.875 -            // checkBoxCecLogTraffic
   5.876 -            // 
   5.877 -            this.checkBoxCecLogTraffic.AutoSize = true;
   5.878 -            this.checkBoxCecLogTraffic.Location = new System.Drawing.Point(6, 93);
   5.879 -            this.checkBoxCecLogTraffic.Name = "checkBoxCecLogTraffic";
   5.880 -            this.checkBoxCecLogTraffic.Size = new System.Drawing.Size(56, 17);
   5.881 -            this.checkBoxCecLogTraffic.TabIndex = 29;
   5.882 -            this.checkBoxCecLogTraffic.Text = "Traffic";
   5.883 -            this.checkBoxCecLogTraffic.UseVisualStyleBackColor = true;
   5.884 -            this.checkBoxCecLogTraffic.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.885 -            // 
   5.886 -            // checkBoxCecLogDebug
   5.887 -            // 
   5.888 -            this.checkBoxCecLogDebug.AutoSize = true;
   5.889 -            this.checkBoxCecLogDebug.Location = new System.Drawing.Point(6, 116);
   5.890 -            this.checkBoxCecLogDebug.Name = "checkBoxCecLogDebug";
   5.891 -            this.checkBoxCecLogDebug.Size = new System.Drawing.Size(58, 17);
   5.892 -            this.checkBoxCecLogDebug.TabIndex = 28;
   5.893 -            this.checkBoxCecLogDebug.Text = "Debug";
   5.894 -            this.checkBoxCecLogDebug.UseVisualStyleBackColor = true;
   5.895 -            this.checkBoxCecLogDebug.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.896 -            // 
   5.897 -            // checkBoxCecLogNotice
   5.898 -            // 
   5.899 -            this.checkBoxCecLogNotice.AutoSize = true;
   5.900 -            this.checkBoxCecLogNotice.Checked = true;
   5.901 -            this.checkBoxCecLogNotice.CheckState = System.Windows.Forms.CheckState.Checked;
   5.902 -            this.checkBoxCecLogNotice.Location = new System.Drawing.Point(6, 70);
   5.903 -            this.checkBoxCecLogNotice.Name = "checkBoxCecLogNotice";
   5.904 -            this.checkBoxCecLogNotice.Size = new System.Drawing.Size(57, 17);
   5.905 -            this.checkBoxCecLogNotice.TabIndex = 27;
   5.906 -            this.checkBoxCecLogNotice.Text = "Notice";
   5.907 -            this.checkBoxCecLogNotice.UseVisualStyleBackColor = true;
   5.908 -            this.checkBoxCecLogNotice.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.909 -            // 
   5.910 -            // checkBoxCecLogError
   5.911 -            // 
   5.912 -            this.checkBoxCecLogError.AutoSize = true;
   5.913 -            this.checkBoxCecLogError.Checked = true;
   5.914 -            this.checkBoxCecLogError.CheckState = System.Windows.Forms.CheckState.Checked;
   5.915 -            this.checkBoxCecLogError.Location = new System.Drawing.Point(6, 24);
   5.916 -            this.checkBoxCecLogError.Name = "checkBoxCecLogError";
   5.917 -            this.checkBoxCecLogError.Size = new System.Drawing.Size(48, 17);
   5.918 -            this.checkBoxCecLogError.TabIndex = 26;
   5.919 -            this.checkBoxCecLogError.Text = "Error";
   5.920 -            this.checkBoxCecLogError.UseVisualStyleBackColor = true;
   5.921 -            this.checkBoxCecLogError.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.922 -            // 
   5.923 -            // checkBoxCecLogWarning
   5.924 -            // 
   5.925 -            this.checkBoxCecLogWarning.AutoSize = true;
   5.926 -            this.checkBoxCecLogWarning.Checked = true;
   5.927 -            this.checkBoxCecLogWarning.CheckState = System.Windows.Forms.CheckState.Checked;
   5.928 -            this.checkBoxCecLogWarning.Location = new System.Drawing.Point(6, 47);
   5.929 -            this.checkBoxCecLogWarning.Name = "checkBoxCecLogWarning";
   5.930 -            this.checkBoxCecLogWarning.Size = new System.Drawing.Size(66, 17);
   5.931 -            this.checkBoxCecLogWarning.TabIndex = 25;
   5.932 -            this.checkBoxCecLogWarning.Text = "Warning";
   5.933 -            this.checkBoxCecLogWarning.UseVisualStyleBackColor = true;
   5.934 -            this.checkBoxCecLogWarning.CheckedChanged += new System.EventHandler(this.checkBoxCecLogs_CheckedChanged);
   5.935 -            // 
   5.936 -            // checkBoxCecEnabled
   5.937 -            // 
   5.938 -            this.checkBoxCecEnabled.AutoSize = true;
   5.939 -            this.checkBoxCecEnabled.Location = new System.Drawing.Point(6, 6);
   5.940 -            this.checkBoxCecEnabled.Name = "checkBoxCecEnabled";
   5.941 -            this.checkBoxCecEnabled.Size = new System.Drawing.Size(83, 17);
   5.942 -            this.checkBoxCecEnabled.TabIndex = 21;
   5.943 -            this.checkBoxCecEnabled.Text = "Enable CEC";
   5.944 -            this.checkBoxCecEnabled.UseVisualStyleBackColor = true;
   5.945 -            this.checkBoxCecEnabled.CheckedChanged += new System.EventHandler(this.checkBoxCecEnabled_CheckedChanged);
   5.946 -            // 
   5.947 -            // labelHdmiPort
   5.948 -            // 
   5.949 -            this.labelHdmiPort.AutoSize = true;
   5.950 -            this.labelHdmiPort.Location = new System.Drawing.Point(3, 26);
   5.951 -            this.labelHdmiPort.Name = "labelHdmiPort";
   5.952 -            this.labelHdmiPort.Size = new System.Drawing.Size(182, 13);
   5.953 -            this.labelHdmiPort.TabIndex = 20;
   5.954 -            this.labelHdmiPort.Text = "TV HDMI port connected to your PC:";
   5.955 -            // 
   5.956 -            // comboBoxHdmiPort
   5.957 -            // 
   5.958 -            this.comboBoxHdmiPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   5.959 -            this.comboBoxHdmiPort.FormattingEnabled = true;
   5.960 -            this.comboBoxHdmiPort.Items.AddRange(new object[] {
   5.961 -            "HDMI 1",
   5.962 -            "HDMI 2",
   5.963 -            "HDMI 3",
   5.964 -            "HDMI 4",
   5.965 -            "HDMI 5",
   5.966 -            "HDMI 6",
   5.967 -            "HDMI 7",
   5.968 -            "HDMI 8",
   5.969 -            "HDMI 9"});
   5.970 -            this.comboBoxHdmiPort.Location = new System.Drawing.Point(6, 42);
   5.971 -            this.comboBoxHdmiPort.Name = "comboBoxHdmiPort";
   5.972 -            this.comboBoxHdmiPort.Size = new System.Drawing.Size(87, 21);
   5.973 -            this.comboBoxHdmiPort.TabIndex = 19;
   5.974 -            this.comboBoxHdmiPort.SelectedIndexChanged += new System.EventHandler(this.comboBoxHdmiPort_SelectedIndexChanged);
   5.975 -            // 
   5.976 -            // tabPageEvent
   5.977 -            // 
   5.978 -            this.tabPageEvent.Controls.Add(this.buttonActionMoveUp);
   5.979 -            this.tabPageEvent.Controls.Add(this.buttonActionMoveDown);
   5.980 -            this.tabPageEvent.Controls.Add(this.buttonTestAction);
   5.981 -            this.tabPageEvent.Controls.Add(this.buttonDeleteAction);
   5.982 -            this.tabPageEvent.Controls.Add(this.buttonAddAction);
   5.983 -            this.tabPageEvent.Controls.Add(this.iTreeViewEvents);
   5.984 -            this.tabPageEvent.Location = new System.Drawing.Point(4, 22);
   5.985 -            this.tabPageEvent.Name = "tabPageEvent";
   5.986 -            this.tabPageEvent.Padding = new System.Windows.Forms.Padding(3);
   5.987 -            this.tabPageEvent.Size = new System.Drawing.Size(752, 385);
   5.988 -            this.tabPageEvent.TabIndex = 9;
   5.989 -            this.tabPageEvent.Text = "Events";
   5.990 -            this.tabPageEvent.UseVisualStyleBackColor = true;
   5.991 -            // 
   5.992 -            // buttonActionMoveUp
   5.993 -            // 
   5.994 -            this.buttonActionMoveUp.Enabled = false;
   5.995 -            this.buttonActionMoveUp.Location = new System.Drawing.Point(6, 327);
   5.996 -            this.buttonActionMoveUp.Name = "buttonActionMoveUp";
   5.997 -            this.buttonActionMoveUp.Size = new System.Drawing.Size(96, 23);
   5.998 -            this.buttonActionMoveUp.TabIndex = 24;
   5.999 -            this.buttonActionMoveUp.Text = "Move Up";
  5.1000 -            this.buttonActionMoveUp.UseVisualStyleBackColor = true;
  5.1001 -            this.buttonActionMoveUp.Click += new System.EventHandler(this.buttonActionMoveUp_Click);
  5.1002 -            // 
  5.1003 -            // buttonActionMoveDown
  5.1004 -            // 
  5.1005 -            this.buttonActionMoveDown.Enabled = false;
  5.1006 -            this.buttonActionMoveDown.Location = new System.Drawing.Point(6, 356);
  5.1007 -            this.buttonActionMoveDown.Name = "buttonActionMoveDown";
  5.1008 -            this.buttonActionMoveDown.Size = new System.Drawing.Size(96, 23);
  5.1009 -            this.buttonActionMoveDown.TabIndex = 23;
  5.1010 -            this.buttonActionMoveDown.Text = "Move Down";
  5.1011 -            this.buttonActionMoveDown.UseVisualStyleBackColor = true;
  5.1012 -            this.buttonActionMoveDown.Click += new System.EventHandler(this.buttonActionMoveDown_Click);
  5.1013 -            // 
  5.1014 -            // buttonTestAction
  5.1015 -            // 
  5.1016 -            this.buttonTestAction.Enabled = false;
  5.1017 -            this.buttonTestAction.Location = new System.Drawing.Point(6, 64);
  5.1018 -            this.buttonTestAction.Name = "buttonTestAction";
  5.1019 -            this.buttonTestAction.Size = new System.Drawing.Size(96, 23);
  5.1020 -            this.buttonTestAction.TabIndex = 22;
  5.1021 -            this.buttonTestAction.Text = "Test Action";
  5.1022 -            this.buttonTestAction.UseVisualStyleBackColor = true;
  5.1023 -            this.buttonTestAction.Click += new System.EventHandler(this.buttonTestAction_Click);
  5.1024 -            // 
  5.1025 -            // buttonDeleteAction
  5.1026 -            // 
  5.1027 -            this.buttonDeleteAction.Enabled = false;
  5.1028 -            this.buttonDeleteAction.Location = new System.Drawing.Point(6, 35);
  5.1029 -            this.buttonDeleteAction.Name = "buttonDeleteAction";
  5.1030 -            this.buttonDeleteAction.Size = new System.Drawing.Size(96, 23);
  5.1031 -            this.buttonDeleteAction.TabIndex = 21;
  5.1032 -            this.buttonDeleteAction.Text = "Delete Action";
  5.1033 -            this.buttonDeleteAction.UseVisualStyleBackColor = true;
  5.1034 -            this.buttonDeleteAction.Click += new System.EventHandler(this.buttonDeleteAction_Click);
  5.1035 -            // 
  5.1036 -            // buttonAddAction
  5.1037 -            // 
  5.1038 -            this.buttonAddAction.Enabled = false;
  5.1039 -            this.buttonAddAction.Location = new System.Drawing.Point(6, 6);
  5.1040 -            this.buttonAddAction.Name = "buttonAddAction";
  5.1041 -            this.buttonAddAction.Size = new System.Drawing.Size(96, 23);
  5.1042 -            this.buttonAddAction.TabIndex = 20;
  5.1043 -            this.buttonAddAction.Text = "Add Action";
  5.1044 -            this.buttonAddAction.UseVisualStyleBackColor = true;
  5.1045 -            this.buttonAddAction.Click += new System.EventHandler(this.buttonAddAction_Click);
  5.1046 -            // 
  5.1047 -            // iTreeViewEvents
  5.1048 -            // 
  5.1049 -            this.iTreeViewEvents.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  5.1050 -            | System.Windows.Forms.AnchorStyles.Left) 
  5.1051 -            | System.Windows.Forms.AnchorStyles.Right)));
  5.1052 -            this.iTreeViewEvents.HideSelection = false;
  5.1053 -            this.iTreeViewEvents.Location = new System.Drawing.Point(111, 3);
  5.1054 -            this.iTreeViewEvents.Name = "iTreeViewEvents";
  5.1055 -            this.iTreeViewEvents.Size = new System.Drawing.Size(638, 376);
  5.1056 -            this.iTreeViewEvents.TabIndex = 1;
  5.1057 -            this.iTreeViewEvents.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.iTreeViewEvents_AfterSelect);
  5.1058 -            // 
  5.1059 -            // tabPageApp
  5.1060 -            // 
  5.1061 -            this.tabPageApp.Controls.Add(this.checkBoxStartMinimized);
  5.1062 -            this.tabPageApp.Controls.Add(this.checkBoxMinimizeToTray);
  5.1063 -            this.tabPageApp.Controls.Add(this.checkBoxAutoStart);
  5.1064 -            this.tabPageApp.Controls.Add(this.buttonUpdate);
  5.1065 -            this.tabPageApp.Location = new System.Drawing.Point(4, 22);
  5.1066 -            this.tabPageApp.Name = "tabPageApp";
  5.1067 -            this.tabPageApp.Padding = new System.Windows.Forms.Padding(3);
  5.1068 -            this.tabPageApp.Size = new System.Drawing.Size(752, 385);
  5.1069 -            this.tabPageApp.TabIndex = 4;
  5.1070 -            this.tabPageApp.Text = "Application";
  5.1071 -            this.tabPageApp.UseVisualStyleBackColor = true;
  5.1072 -            // 
  5.1073 -            // checkBoxStartMinimized
  5.1074 -            // 
  5.1075 -            this.checkBoxStartMinimized.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  5.1076 -            this.checkBoxStartMinimized.AutoSize = true;
  5.1077 -            this.checkBoxStartMinimized.Location = new System.Drawing.Point(6, 285);
  5.1078 -            this.checkBoxStartMinimized.Name = "checkBoxStartMinimized";
  5.1079 -            this.checkBoxStartMinimized.Size = new System.Drawing.Size(96, 17);
  5.1080 -            this.checkBoxStartMinimized.TabIndex = 16;
  5.1081 -            this.checkBoxStartMinimized.Text = "Start minimized";
  5.1082 -            this.checkBoxStartMinimized.UseVisualStyleBackColor = true;
  5.1083 -            this.checkBoxStartMinimized.CheckedChanged += new System.EventHandler(this.checkBoxStartMinimized_CheckedChanged);
  5.1084 -            // 
  5.1085 -            // checkBoxMinimizeToTray
  5.1086 -            // 
  5.1087 -            this.checkBoxMinimizeToTray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  5.1088 -            this.checkBoxMinimizeToTray.AutoSize = true;
  5.1089 -            this.checkBoxMinimizeToTray.Location = new System.Drawing.Point(6, 308);
  5.1090 -            this.checkBoxMinimizeToTray.Name = "checkBoxMinimizeToTray";
  5.1091 -            this.checkBoxMinimizeToTray.Size = new System.Drawing.Size(133, 17);
  5.1092 -            this.checkBoxMinimizeToTray.TabIndex = 15;
  5.1093 -            this.checkBoxMinimizeToTray.Text = "Minimize to system tray";
  5.1094 -            this.checkBoxMinimizeToTray.UseVisualStyleBackColor = true;
  5.1095 -            this.checkBoxMinimizeToTray.CheckedChanged += new System.EventHandler(this.checkBoxMinimizeToTray_CheckedChanged);
  5.1096 -            // 
  5.1097 -            // checkBoxAutoStart
  5.1098 -            // 
  5.1099 -            this.checkBoxAutoStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  5.1100 -            this.checkBoxAutoStart.AutoSize = true;
  5.1101 -            this.checkBoxAutoStart.Location = new System.Drawing.Point(6, 331);
  5.1102 -            this.checkBoxAutoStart.Name = "checkBoxAutoStart";
  5.1103 -            this.checkBoxAutoStart.Size = new System.Drawing.Size(143, 17);
  5.1104 -            this.checkBoxAutoStart.TabIndex = 14;
  5.1105 -            this.checkBoxAutoStart.Text = "Run on Windows startup";
  5.1106 -            this.checkBoxAutoStart.UseVisualStyleBackColor = true;
  5.1107 -            this.checkBoxAutoStart.CheckedChanged += new System.EventHandler(this.checkBoxAutoStart_CheckedChanged);
  5.1108 -            // 
  5.1109 -            // buttonUpdate
  5.1110 -            // 
  5.1111 -            this.buttonUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  5.1112 -            this.buttonUpdate.Location = new System.Drawing.Point(6, 354);
  5.1113 -            this.buttonUpdate.Name = "buttonUpdate";
  5.1114 -            this.buttonUpdate.Size = new System.Drawing.Size(75, 23);
  5.1115 -            this.buttonUpdate.TabIndex = 0;
  5.1116 -            this.buttonUpdate.Text = "Update";
  5.1117 -            this.buttonUpdate.UseVisualStyleBackColor = true;
  5.1118 -            this.buttonUpdate.Click += new System.EventHandler(this.buttonUpdate_Click);
  5.1119 -            // 
  5.1120 -            // tabPageLogs
  5.1121 -            // 
  5.1122 -            this.tabPageLogs.Controls.Add(this.buttonClearLogs);
  5.1123 -            this.tabPageLogs.Controls.Add(this.richTextBoxLogs);
  5.1124 -            this.tabPageLogs.Location = new System.Drawing.Point(4, 22);
  5.1125 -            this.tabPageLogs.Name = "tabPageLogs";
  5.1126 -            this.tabPageLogs.Padding = new System.Windows.Forms.Padding(3);
  5.1127 -            this.tabPageLogs.Size = new System.Drawing.Size(752, 385);
  5.1128 -            this.tabPageLogs.TabIndex = 8;
  5.1129 -            this.tabPageLogs.Text = "Logs";
  5.1130 -            this.tabPageLogs.UseVisualStyleBackColor = true;
  5.1131 -            // 
  5.1132 -            // buttonClearLogs
  5.1133 -            // 
  5.1134 -            this.buttonClearLogs.Location = new System.Drawing.Point(671, 6);
  5.1135 -            this.buttonClearLogs.Name = "buttonClearLogs";
  5.1136 -            this.buttonClearLogs.Size = new System.Drawing.Size(75, 23);
  5.1137 -            this.buttonClearLogs.TabIndex = 2;
  5.1138 -            this.buttonClearLogs.Text = "Clear";
  5.1139 -            this.buttonClearLogs.UseVisualStyleBackColor = true;
  5.1140 -            this.buttonClearLogs.Click += new System.EventHandler(this.buttonClearLogs_Click);
  5.1141 -            // 
  5.1142 -            // richTextBoxLogs
  5.1143 -            // 
  5.1144 -            this.richTextBoxLogs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  5.1145 -            | System.Windows.Forms.AnchorStyles.Left) 
  5.1146 -            | System.Windows.Forms.AnchorStyles.Right)));
  5.1147 -            this.richTextBoxLogs.BorderStyle = System.Windows.Forms.BorderStyle.None;
  5.1148 -            this.richTextBoxLogs.DetectUrls = false;
  5.1149 -            this.richTextBoxLogs.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  5.1150 -            this.richTextBoxLogs.Location = new System.Drawing.Point(6, 6);
  5.1151 -            this.richTextBoxLogs.Name = "richTextBoxLogs";
  5.1152 -            this.richTextBoxLogs.ReadOnly = true;
  5.1153 -            this.richTextBoxLogs.Size = new System.Drawing.Size(740, 373);
  5.1154 -            this.richTextBoxLogs.TabIndex = 1;
  5.1155 -            this.richTextBoxLogs.Text = "";
  5.1156 -            this.richTextBoxLogs.WordWrap = false;
  5.1157 -            // 
  5.1158 -            // labelFontWidth
  5.1159 -            // 
  5.1160 -            this.labelFontWidth.AutoSize = true;
  5.1161 -            this.labelFontWidth.Location = new System.Drawing.Point(13, 29);
  5.1162 -            this.labelFontWidth.Name = "labelFontWidth";
  5.1163 -            this.labelFontWidth.Size = new System.Drawing.Size(56, 13);
  5.1164 -            this.labelFontWidth.TabIndex = 19;
  5.1165 -            this.labelFontWidth.Text = "Font width";
  5.1166 -            // 
  5.1167 -            // labelFontHeight
  5.1168 -            // 
  5.1169 -            this.labelFontHeight.AutoSize = true;
  5.1170 -            this.labelFontHeight.Location = new System.Drawing.Point(13, 46);
  5.1171 -            this.labelFontHeight.Name = "labelFontHeight";
  5.1172 -            this.labelFontHeight.Size = new System.Drawing.Size(60, 13);
  5.1173 -            this.labelFontHeight.TabIndex = 20;
  5.1174 -            this.labelFontHeight.Text = "Font height";
  5.1175 -            // 
  5.1176 -            // openFileDialog
  5.1177 -            // 
  5.1178 -            this.openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
  5.1179 -            // 
  5.1180 -            // MainForm
  5.1181 -            // 
  5.1182 -            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  5.1183 -            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  5.1184 -            this.ClientSize = new System.Drawing.Size(784, 561);
  5.1185 -            this.Controls.Add(this.labelFontHeight);
  5.1186 -            this.Controls.Add(this.labelFontWidth);
  5.1187 -            this.Controls.Add(this.labelWarning);
  5.1188 -            this.Controls.Add(this.statusStrip);
  5.1189 -            this.Controls.Add(this.tabControl);
  5.1190 -            this.Controls.Add(this.panelDisplay);
  5.1191 -            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  5.1192 -            this.MinimumSize = new System.Drawing.Size(800, 600);
  5.1193 -            this.Name = "MainForm";
  5.1194 -            this.Text = "Sharp Display Manager";
  5.1195 -            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
  5.1196 -            this.Load += new System.EventHandler(this.MainForm_Load);
  5.1197 -            this.SizeChanged += new System.EventHandler(this.MainForm_SizeChanged);
  5.1198 -            this.Resize += new System.EventHandler(this.MainForm_Resize);
  5.1199 -            this.panelDisplay.ResumeLayout(false);
  5.1200 -            this.iTableLayoutPanel.ResumeLayout(false);
  5.1201 -            this.iTableLayoutPanel.PerformLayout();
  5.1202 -            this.statusStrip.ResumeLayout(false);
  5.1203 -            this.statusStrip.PerformLayout();
  5.1204 -            this.tabPageClients.ResumeLayout(false);
  5.1205 -            this.tabPageClients.PerformLayout();
  5.1206 -            this.tabPageDisplay.ResumeLayout(false);
  5.1207 -            this.tabPageDisplay.PerformLayout();
  5.1208 -            ((System.ComponentModel.ISupportInitialize)(this.trackBarBrightness)).EndInit();
  5.1209 -            this.tabControl.ResumeLayout(false);
  5.1210 -            this.tabPageDesign.ResumeLayout(false);
  5.1211 -            this.tabPageDesign.PerformLayout();
  5.1212 -            this.tabPageAudio.ResumeLayout(false);
  5.1213 -            this.tabPageAudio.PerformLayout();
  5.1214 -            ((System.ComponentModel.ISupportInitialize)(this.trackBarMasterVolume)).EndInit();
  5.1215 -            this.tabPageInput.ResumeLayout(false);
  5.1216 -            this.tabPageInput.PerformLayout();
  5.1217 -            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxGreenStart)).EndInit();
  5.1218 -            this.tabPageCec.ResumeLayout(false);
  5.1219 -            this.tabPageCec.PerformLayout();
  5.1220 -            this.groupBoxCecLogOptions.ResumeLayout(false);
  5.1221 -            this.groupBoxCecLogOptions.PerformLayout();
  5.1222 -            this.tabPageEvent.ResumeLayout(false);
  5.1223 -            this.tabPageApp.ResumeLayout(false);
  5.1224 -            this.tabPageApp.PerformLayout();
  5.1225 -            this.tabPageLogs.ResumeLayout(false);
  5.1226 -            this.ResumeLayout(false);
  5.1227 -            this.PerformLayout();
  5.1228 -
  5.1229 -        }
  5.1230 -
  5.1231 -        #endregion
  5.1232 -
  5.1233 -        private System.Windows.Forms.FontDialog fontDialog;
  5.1234 -        private System.Windows.Forms.Timer timer;
  5.1235 -        private System.Windows.Forms.StatusStrip statusStrip;
  5.1236 -        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelConnect;
  5.1237 -        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelFps;
  5.1238 -        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSpring;
  5.1239 -        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelPower;
  5.1240 -        private System.Windows.Forms.Panel panelDisplay;
  5.1241 -        private System.Windows.Forms.TableLayoutPanel iTableLayoutPanel;
  5.1242 -        private MarqueeLabel marqueeLabelTop;
  5.1243 -        private MarqueeLabel marqueeLabelBottom;
  5.1244 -        private System.Windows.Forms.TabPage tabPageClients;
  5.1245 -        private System.Windows.Forms.TreeView iTreeViewClients;
  5.1246 -        private System.Windows.Forms.TabPage tabPageDisplay;
  5.1247 -        private System.Windows.Forms.CheckBox checkBoxFixedPitchFontOnly;
  5.1248 -        private System.Windows.Forms.Button buttonSuspend;
  5.1249 -        private System.Windows.Forms.CheckBox checkBoxConnectOnStartup;
  5.1250 -        private System.Windows.Forms.CheckBox checkBoxShowBorders;
  5.1251 -        private System.Windows.Forms.TrackBar trackBarBrightness;
  5.1252 -        private System.Windows.Forms.Button buttonFill;
  5.1253 -        private System.Windows.Forms.Button buttonClear;
  5.1254 -        private System.Windows.Forms.Button buttonClose;
  5.1255 -        private System.Windows.Forms.Button buttonOpen;
  5.1256 -        private System.Windows.Forms.Button buttonCapture;
  5.1257 -        private System.Windows.Forms.Button buttonFont;
  5.1258 -        private System.Windows.Forms.TabControl tabControl;
  5.1259 -        private System.Windows.Forms.Button buttonCloseClients;
  5.1260 -        private System.Windows.Forms.Button buttonStartClient;
  5.1261 -        private System.Windows.Forms.Label labelWarning;
  5.1262 -		private System.Windows.Forms.TabPage tabPageDesign;
  5.1263 -		private System.Windows.Forms.CheckBox checkBoxReverseScreen;
  5.1264 -        private System.Windows.Forms.ComboBox comboBoxDisplayType;
  5.1265 -        private System.Windows.Forms.MaskedTextBox maskedTextBoxTimerInterval;
  5.1266 -        private System.Windows.Forms.Label labelTimerInterval;
  5.1267 -        private System.Windows.Forms.Button buttonPowerOff;
  5.1268 -        private System.Windows.Forms.Button buttonPowerOn;
  5.1269 -        private System.Windows.Forms.Button buttonShowClock;
  5.1270 -        private System.Windows.Forms.Button buttonHideClock;
  5.1271 -        private System.Windows.Forms.Label labelFontWidth;
  5.1272 -        private System.Windows.Forms.Label labelFontHeight;
  5.1273 -        private System.Windows.Forms.CheckBox checkBoxInverseColors;
  5.1274 -        private System.Windows.Forms.TabPage tabPageApp;
  5.1275 -        private System.Windows.Forms.Button buttonUpdate;
  5.1276 -		private System.Windows.Forms.CheckBox checkBoxAutoStart;
  5.1277 -		private System.Windows.Forms.CheckBox checkBoxStartMinimized;
  5.1278 -		private System.Windows.Forms.CheckBox checkBoxMinimizeToTray;
  5.1279 -        private System.Windows.Forms.MaskedTextBox maskedTextBoxMinFontSize;
  5.1280 -        private System.Windows.Forms.CheckBox checkBoxScaleToFit;
  5.1281 -        private System.Windows.Forms.Label labelMinFontSize;
  5.1282 -        private System.Windows.Forms.Label labelScrollLoopSeparator;
  5.1283 -        private System.Windows.Forms.TextBox textBoxScrollLoopSeparator;
  5.1284 -		private System.Windows.Forms.Label labelScrollingSpeed;
  5.1285 -		private System.Windows.Forms.MaskedTextBox maskedTextBoxScrollingSpeed;
  5.1286 -		private System.Windows.Forms.ToolTip toolTip;
  5.1287 -		private System.Windows.Forms.TabPage tabPageAudio;
  5.1288 -		private System.Windows.Forms.TrackBar trackBarMasterVolume;
  5.1289 -		private System.Windows.Forms.CheckBox checkBoxMute;
  5.1290 -		private System.Windows.Forms.CheckBox checkBoxShowVolumeLabel;
  5.1291 -		private System.Windows.Forms.Label labelDefaultAudioDevice;
  5.1292 -		private System.Windows.Forms.TabPage tabPageInput;
  5.1293 -		private System.Windows.Forms.Button buttonSelectFile;
  5.1294 -		private System.Windows.Forms.OpenFileDialog openFileDialog;
  5.1295 -		private System.Windows.Forms.Label labelStartFileName;
  5.1296 -		private System.Windows.Forms.PictureBox pictureBoxGreenStart;
  5.1297 -        private System.Windows.Forms.ComboBox comboBoxOpticalDrives;
  5.1298 -        private System.Windows.Forms.Label labelOpticalDriveEject;
  5.1299 -        private System.Windows.Forms.TabPage tabPageCec;
  5.1300 -        private System.Windows.Forms.CheckBox checkBoxCecEnabled;
  5.1301 -        private System.Windows.Forms.Label labelHdmiPort;
  5.1302 -        private System.Windows.Forms.ComboBox comboBoxHdmiPort;
  5.1303 -        private System.Windows.Forms.Button iButtonStartIdleClient;
  5.1304 -        private System.Windows.Forms.CheckBox iCheckBoxStartIdleClient;
  5.1305 -        private System.Windows.Forms.TabPage tabPageLogs;
  5.1306 -        private System.Windows.Forms.RichTextBox richTextBoxLogs;
  5.1307 -        private System.Windows.Forms.Button buttonClearLogs;
  5.1308 -        private System.Windows.Forms.GroupBox groupBoxCecLogOptions;
  5.1309 -        private System.Windows.Forms.CheckBox checkBoxCecLogWarning;
  5.1310 -        private System.Windows.Forms.CheckBox checkBoxCecLogError;
  5.1311 -        private System.Windows.Forms.CheckBox checkBoxCecLogDebug;
  5.1312 -        private System.Windows.Forms.CheckBox checkBoxCecLogNotice;
  5.1313 -        private System.Windows.Forms.CheckBox checkBoxCecLogTraffic;
  5.1314 -        private System.Windows.Forms.CheckBox checkBoxCecLogNoPoll;
  5.1315 -        private System.Windows.Forms.TabPage tabPageEvent;
  5.1316 -        private System.Windows.Forms.TreeView iTreeViewEvents;
  5.1317 -        private System.Windows.Forms.Button buttonDeleteAction;
  5.1318 -        private System.Windows.Forms.Button buttonAddAction;
  5.1319 -        private System.Windows.Forms.Button buttonActionMoveUp;
  5.1320 -        private System.Windows.Forms.Button buttonActionMoveDown;
  5.1321 -        private System.Windows.Forms.Button buttonTestAction;
  5.1322 -    }
  5.1323 -}
  5.1324 -
     6.1 --- a/Server/MainForm.Hid.cs	Thu Jul 28 19:32:40 2016 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,425 +0,0 @@
     6.4 -using System;
     6.5 -using System.IO;
     6.6 -using System.Collections.Generic;
     6.7 -using System.Linq;
     6.8 -using System.Text;
     6.9 -using System.Threading.Tasks;
    6.10 -using System.Diagnostics;
    6.11 -using System.Runtime.InteropServices;
    6.12 -using System.Windows.Forms;
    6.13 -using Microsoft.Win32.SafeHandles;
    6.14 -using System.ComponentModel;
    6.15 -//
    6.16 -using Hid = SharpLib.Hid;
    6.17 -using SharpLib.Win32;
    6.18 -
    6.19 -namespace SharpDisplayManager
    6.20 -{
    6.21 -    /// <summary>
    6.22 -    /// Implement handling of HID input reports notably to be able to launch an application using the Green Start button from IR remotes.
    6.23 -    /// </summary>
    6.24 -    [System.ComponentModel.DesignerCategory("Code")]
    6.25 -    public class MainFormHid : Form
    6.26 -    {
    6.27 -        [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SwitchToThisWindow")]
    6.28 -        public static extern void SwitchToThisWindow([System.Runtime.InteropServices.InAttribute()] System.IntPtr hwnd, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] bool fUnknown);
    6.29 -        //
    6.30 -        public delegate void OnHidEventDelegate(object aSender, Hid.Event aHidEvent);
    6.31 -
    6.32 -        /// <summary>
    6.33 -        /// Use notably to handle green start key from IR remote control
    6.34 -        /// </summary>
    6.35 -        private Hid.Handler iHidHandler;
    6.36 -
    6.37 -        /// <summary>
    6.38 -        /// Register HID devices so that we receive corresponding WM_INPUT messages.
    6.39 -        /// </summary>
    6.40 -        protected void RegisterHidDevices()
    6.41 -        {
    6.42 -            // Register the input device to receive the commands from the
    6.43 -            // remote device. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/remote_control.asp
    6.44 -            // for the vendor defined usage page.
    6.45 -
    6.46 -            RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[5];
    6.47 -
    6.48 -            int i = 0;
    6.49 -            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.WindowsMediaCenterRemoteControl;
    6.50 -            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl;
    6.51 -            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    6.52 -            rid[i].hwndTarget = Handle;
    6.53 -
    6.54 -            i++;
    6.55 -            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer;
    6.56 -            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.ConsumerControl;
    6.57 -            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    6.58 -            rid[i].hwndTarget = Handle;
    6.59 -
    6.60 -            i++;
    6.61 -            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer;
    6.62 -            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.Selection;
    6.63 -            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    6.64 -            rid[i].hwndTarget = Handle;
    6.65 -
    6.66 -            i++;
    6.67 -            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    6.68 -            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.SystemControl;
    6.69 -            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    6.70 -            rid[i].hwndTarget = Handle;
    6.71 -
    6.72 -            i++;
    6.73 -            rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    6.74 -            rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.GamePad;
    6.75 -            rid[i].dwFlags = Const.RIDEV_INPUTSINK;
    6.76 -            rid[i].hwndTarget = Handle;
    6.77 -
    6.78 -            //i++;
    6.79 -            //rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls;
    6.80 -            //rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.Keyboard;
    6.81 -            //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    6.82 -            //rid[i].hwndTarget = Handle;
    6.83 -
    6.84 -            //i++;
    6.85 -            //rid[i].usUsagePage = (ushort)Hid.UsagePage.GenericDesktopControls;
    6.86 -            //rid[i].usUsage = (ushort)Hid.UsageCollection.GenericDesktop.Mouse;
    6.87 -            //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK;
    6.88 -            //rid[i].hwndTarget = aHWND;
    6.89 -
    6.90 -
    6.91 -            iHidHandler = new SharpLib.Hid.Handler(rid);
    6.92 -            if (!iHidHandler.IsRegistered)
    6.93 -            {
    6.94 -                Debug.WriteLine("Failed to register raw input devices: " + Marshal.GetLastWin32Error().ToString());
    6.95 -            }
    6.96 -            iHidHandler.OnHidEvent += HandleHidEventThreadSafe;
    6.97 -
    6.98 -        }
    6.99 -
   6.100 -
   6.101 -
   6.102 -
   6.103 -        /// <summary>
   6.104 -        /// Here we receive HID events from our HID library.
   6.105 -        /// </summary>
   6.106 -        /// <param name="aSender"></param>
   6.107 -        /// <param name="aHidEvent"></param>
   6.108 -        public void HandleHidEventThreadSafe(object aSender, SharpLib.Hid.Event aHidEvent)
   6.109 -        {
   6.110 -            if (aHidEvent.IsStray)
   6.111 -            {
   6.112 -                //Stray event just ignore it
   6.113 -                return;
   6.114 -            }
   6.115 -
   6.116 -            if (this.InvokeRequired)
   6.117 -            {
   6.118 -                //Not in the proper thread, invoke ourselves
   6.119 -                OnHidEventDelegate d = new OnHidEventDelegate(HandleHidEventThreadSafe);
   6.120 -                this.Invoke(d, new object[] { aSender, aHidEvent });
   6.121 -            }
   6.122 -            else
   6.123 -            {
   6.124 -                if (aHidEvent.Usages.Count == 0)
   6.125 -                {
   6.126 -                    //No usage, nothing to do then
   6.127 -                    return;
   6.128 -                }
   6.129 -
   6.130 -                //We are in the proper thread
   6.131 -                if (aHidEvent.UsagePage == (ushort) Hid.UsagePage.WindowsMediaCenterRemoteControl)
   6.132 -                {
   6.133 -                    switch (aHidEvent.Usages[0])
   6.134 -                    {
   6.135 -                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.GreenStart:
   6.136 -                            HandleGreenStart();
   6.137 -                            break;
   6.138 -                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.Eject:
   6.139 -                        case (ushort)Hid.Usage.WindowsMediaCenterRemoteControl.Ext2:
   6.140 -                            HandleEject();
   6.141 -                            break;
   6.142 -                    }
   6.143 -                }
   6.144 -
   6.145 -                //Keep this for debug when only ThinkPad keyboard is available
   6.146 -                if (aHidEvent.UsagePage == (ushort)Hid.UsagePage.Consumer && aHidEvent.Usages[0] == (ushort)Hid.Usage.ConsumerControl.ThinkPadFullscreenMagnifier)
   6.147 -                {
   6.148 -                    HandleEject();
   6.149 -                }
   6.150 -
   6.151 -            }
   6.152 -        }
   6.153 -
   6.154 -        /// <summary>
   6.155 -        /// 
   6.156 -        /// </summary>
   6.157 -        /// <param name="aPrefix"></param>
   6.158 -        private void CheckLastError(string aPrefix)
   6.159 -        {
   6.160 -            string errorMessage = new Win32Exception(Marshal.GetLastWin32Error()).Message;
   6.161 -            Debug.WriteLine(aPrefix + Marshal.GetLastWin32Error().ToString() + ": " + errorMessage);
   6.162 -        }
   6.163 -
   6.164 -        /// <summary>
   6.165 -        /// 
   6.166 -        /// </summary>
   6.167 -        /// <param name="data"></param>
   6.168 -        /// <returns></returns>
   6.169 -        private IntPtr MarshalToPointer(object data)
   6.170 -        {
   6.171 -            IntPtr buf = Marshal.AllocHGlobal(
   6.172 -                Marshal.SizeOf(data));
   6.173 -            Marshal.StructureToPtr(data,
   6.174 -                buf, false);
   6.175 -            return buf;
   6.176 -        }
   6.177 -
   6.178 -        /// <summary>
   6.179 -        /// 
   6.180 -        /// </summary>
   6.181 -        /// <returns></returns>
   6.182 -        private SafeFileHandle OpenVolume(string aDriveName)
   6.183 -        {
   6.184 -            return Function.CreateFile("\\\\.\\" + aDriveName,
   6.185 -                               SharpLib.Win32.FileAccess.GENERIC_READ,
   6.186 -                               SharpLib.Win32.FileShare.FILE_SHARE_READ | SharpLib.Win32.FileShare.FILE_SHARE_WRITE,
   6.187 -                               IntPtr.Zero,
   6.188 -                               CreationDisposition.OPEN_EXISTING,
   6.189 -                               0,
   6.190 -                               IntPtr.Zero);
   6.191 -        }
   6.192 -
   6.193 -        /// <summary>
   6.194 -        /// 
   6.195 -        /// </summary>
   6.196 -        /// <param name="aVolume"></param>
   6.197 -        /// <returns></returns>
   6.198 -        private bool LockVolume(SafeFileHandle aVolume)
   6.199 -        {
   6.200 -            //Hope that's doing what I think it does
   6.201 -            IntPtr dwBytesReturned=new IntPtr();
   6.202 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.203 -            OVERLAPPED overlapped=new OVERLAPPED();
   6.204 -
   6.205 -            int tries = 0;
   6.206 -            const int KMaxTries = 100;
   6.207 -            const int KSleepTime = 10;
   6.208 -            bool success = false;
   6.209 -
   6.210 -            while (!success && tries < KMaxTries)
   6.211 -            {
   6.212 -                success = Function.DeviceIoControl(aVolume, Const.FSCTL_LOCK_VOLUME, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.213 -                System.Threading.Thread.Sleep(KSleepTime);
   6.214 -                tries++;
   6.215 -            }
   6.216 -
   6.217 -            CheckLastError("Lock volume: ");
   6.218 -
   6.219 -            return success;
   6.220 -        }
   6.221 -
   6.222 -        /// <summary>
   6.223 -        /// 
   6.224 -        /// </summary>
   6.225 -        /// <param name="aVolume"></param>
   6.226 -        /// <returns></returns>
   6.227 -        private bool DismountVolume(SafeFileHandle aVolume)
   6.228 -        {
   6.229 -            //Hope that's doing what I think it does
   6.230 -            IntPtr dwBytesReturned = new IntPtr();
   6.231 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.232 -            OVERLAPPED overlapped=new OVERLAPPED();
   6.233 -
   6.234 -            bool res = Function.DeviceIoControl(aVolume, Const.FSCTL_DISMOUNT_VOLUME, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.235 -            CheckLastError("Dismount volume: ");
   6.236 -            return res;
   6.237 -        }
   6.238 -
   6.239 -
   6.240 -
   6.241 -        /// <summary>
   6.242 -        /// 
   6.243 -        /// </summary>
   6.244 -        /// <param name="aVolume"></param>
   6.245 -        /// <param name="aPreventRemoval"></param>
   6.246 -        /// <returns></returns>
   6.247 -        private bool PreventRemovalOfVolume(SafeFileHandle aVolume, bool aPreventRemoval)
   6.248 -        {
   6.249 -            //Hope that's doing what I think it does
   6.250 -            IntPtr dwBytesReturned = new IntPtr();
   6.251 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.252 -            OVERLAPPED overlapped = new OVERLAPPED();
   6.253 -            //
   6.254 -            PREVENT_MEDIA_REMOVAL preventMediaRemoval = new PREVENT_MEDIA_REMOVAL();
   6.255 -            preventMediaRemoval.PreventMediaRemoval = Convert.ToByte(aPreventRemoval);
   6.256 -            IntPtr preventMediaRemovalParam = MarshalToPointer(preventMediaRemoval);
   6.257 -
   6.258 -            bool result = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_MEDIA_REMOVAL, preventMediaRemovalParam, Convert.ToUInt32(Marshal.SizeOf(preventMediaRemoval)), IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.259 -            CheckLastError("Media removal: ");
   6.260 -            Marshal.FreeHGlobal(preventMediaRemovalParam);
   6.261 -
   6.262 -            return result;
   6.263 -        }
   6.264 -
   6.265 -        /// <summary>
   6.266 -        /// Eject optical drive media opening the tray if any.
   6.267 -        /// </summary>
   6.268 -        /// <param name="aVolume"></param>
   6.269 -        /// <returns></returns>
   6.270 -        private bool MediaEject(SafeFileHandle aVolume)
   6.271 -        {
   6.272 -            //Hope that's doing what I think it does
   6.273 -            IntPtr dwBytesReturned = new IntPtr();
   6.274 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.275 -            OVERLAPPED overlapped=new OVERLAPPED();
   6.276 -
   6.277 -            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_EJECT_MEDIA, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.278 -            CheckLastError("Media eject: ");
   6.279 -            return res;
   6.280 -        }
   6.281 -
   6.282 -        /// <summary>
   6.283 -        /// Close an optical drive tray.
   6.284 -        /// </summary>
   6.285 -        /// <param name="aVolume"></param>
   6.286 -        /// <returns></returns>
   6.287 -        private bool MediaLoad(SafeFileHandle aVolume)
   6.288 -        {
   6.289 -            //Hope that's doing what I think it does
   6.290 -            IntPtr dwBytesReturned = new IntPtr();
   6.291 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.292 -            OVERLAPPED overlapped=new OVERLAPPED();
   6.293 -
   6.294 -            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_LOAD_MEDIA, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.295 -            CheckLastError("Media load: ");
   6.296 -            return res;
   6.297 -        }
   6.298 -
   6.299 -        /// <summary>
   6.300 -        /// 
   6.301 -        /// </summary>
   6.302 -        /// <param name="aVolume"></param>
   6.303 -        /// <returns></returns>
   6.304 -        private bool StorageCheckVerify(SafeFileHandle aVolume)
   6.305 -        {
   6.306 -            //Hope that's doing what I think it does
   6.307 -            IntPtr dwBytesReturned = new IntPtr();
   6.308 -            //Should not be needed but I'm not sure how to pass NULL in there.
   6.309 -            OVERLAPPED overlapped = new OVERLAPPED();
   6.310 -
   6.311 -            bool res = Function.DeviceIoControl(aVolume, Const.IOCTL_STORAGE_CHECK_VERIFY2, IntPtr.Zero, 0, IntPtr.Zero, 0, dwBytesReturned, ref overlapped);
   6.312 -
   6.313 -            CheckLastError("Check verify: ");
   6.314 -
   6.315 -            return res;
   6.316 -        }        
   6.317 -        
   6.318 -
   6.319 -
   6.320 -        /// <summary>
   6.321 -        /// Perform media ejection.
   6.322 -        /// </summary>
   6.323 -        private void HandleEject()
   6.324 -        {
   6.325 -            string drive = ((MainForm)this).OpticalDriveToEject();
   6.326 -            if (drive.Length!=2)
   6.327 -            {
   6.328 -                //Not a proper drive spec.
   6.329 -                //Probably 'None' selected.
   6.330 -                return;
   6.331 -            }
   6.332 -
   6.333 -            SafeFileHandle handle = OpenVolume(drive);
   6.334 -            if (handle.IsInvalid)
   6.335 -            {
   6.336 -                CheckLastError("ERROR: Failed to open volume: ");
   6.337 -                return;
   6.338 -            }
   6.339 -
   6.340 -            if (LockVolume(handle) && DismountVolume(handle))
   6.341 -            {
   6.342 -                Debug.WriteLine("Volume was dismounted.");
   6.343 -
   6.344 -                if (PreventRemovalOfVolume(handle,false))
   6.345 -                {
   6.346 -                    //StorageCheckVerify(handle);
   6.347 -
   6.348 -                    DateTime before;
   6.349 -                    before = DateTime.Now;
   6.350 -                    bool ejectSuccess = MediaEject(handle);
   6.351 -                    double ms = (DateTime.Now - before).TotalMilliseconds;
   6.352 -
   6.353 -                    //We assume that if it take more than a certain time to for eject to execute it means we actually ejected.
   6.354 -                    //If our eject completes too rapidly we assume the tray is already open and we will try to close it. 
   6.355 -                    if (ejectSuccess && ms > 100)
   6.356 -                    {
   6.357 -                        Debug.WriteLine("Media was ejected");
   6.358 -                    }
   6.359 -                    else if (MediaLoad(handle))
   6.360 -                    {
   6.361 -                        Debug.WriteLine("Media was loaded");
   6.362 -                    }                    
   6.363 -                }
   6.364 -            }
   6.365 -            else
   6.366 -            {
   6.367 -                Debug.WriteLine("Volume lock or dismount failed.");
   6.368 -            }
   6.369 -
   6.370 -            //This is needed to make sure we can open the volume next time around
   6.371 -            handle.Dispose();
   6.372 -        }
   6.373 -
   6.374 -        /// <summary>
   6.375 -        /// 
   6.376 -        /// </summary>
   6.377 -        private void HandleGreenStart()
   6.378 -        {
   6.379 -            //First check if the process we want to launch already exists
   6.380 -            string procName = Path.GetFileNameWithoutExtension(Properties.Settings.Default.StartFileName);
   6.381 -            Process[] existingProcesses = Process.GetProcessesByName(procName);
   6.382 -            if (existingProcesses == null || existingProcesses.Length == 0)
   6.383 -            {
   6.384 -                // Process do not exists just try to launch it
   6.385 -                ProcessStartInfo start = new ProcessStartInfo();
   6.386 -                // Enter in the command line arguments, everything you would enter after the executable name itself
   6.387 -                //start.Arguments = arguments; 
   6.388 -                // Enter the executable to run, including the complete path
   6.389 -                start.FileName = Properties.Settings.Default.StartFileName;
   6.390 -                start.WindowStyle = ProcessWindowStyle.Normal;
   6.391 -                start.CreateNoWindow = true;
   6.392 -                start.UseShellExecute = true;
   6.393 -                // Run the external process & wait for it to finish
   6.394 -                Process proc = Process.Start(start);
   6.395 -
   6.396 -                //SL: We could have used that too
   6.397 -                //Shell32.Shell shell = new Shell32.Shell();
   6.398 -                //shell.ShellExecute(Properties.Settings.Default.StartFileName);
   6.399 -            }
   6.400 -            else
   6.401 -            {
   6.402 -                //This won't work properly until we have a manifest that enables uiAccess.
   6.403 -                //However uiAccess just won't work with ClickOnce so we will have to use a different deployment system.
   6.404 -                SwitchToThisWindow(existingProcesses[0].MainWindowHandle, true);
   6.405 -            }            
   6.406 -        }
   6.407 -
   6.408 -
   6.409 -        /// <summary>
   6.410 -        /// We need to handle WM_INPUT.
   6.411 -        /// </summary>
   6.412 -        /// <param name="message"></param>
   6.413 -        protected override void WndProc(ref Message message)
   6.414 -        {
   6.415 -            switch (message.Msg)
   6.416 -            {
   6.417 -                case Const.WM_INPUT:
   6.418 -                    //Returning zero means we processed that message.
   6.419 -                    message.Result = new IntPtr(0);
   6.420 -                    iHidHandler.ProcessInput(ref message);
   6.421 -                    break;
   6.422 -            }
   6.423 -
   6.424 -            //Pass this on to base class.
   6.425 -            base.WndProc(ref message);
   6.426 -        }
   6.427 -    }
   6.428 -}
     7.1 --- a/Server/MainForm.cs	Thu Jul 28 19:32:40 2016 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,2922 +0,0 @@
     7.4 -//
     7.5 -// Copyright (C) 2014-2015 Stéphane Lenclud.
     7.6 -//
     7.7 -// This file is part of SharpDisplayManager.
     7.8 -//
     7.9 -// SharpDisplayManager is free software: you can redistribute it and/or modify
    7.10 -// it under the terms of the GNU General Public License as published by
    7.11 -// the Free Software Foundation, either version 3 of the License, or
    7.12 -// (at your option) any later version.
    7.13 -//
    7.14 -// SharpDisplayManager is distributed in the hope that it will be useful,
    7.15 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.16 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7.17 -// GNU General Public License for more details.
    7.18 -//
    7.19 -// You should have received a copy of the GNU General Public License
    7.20 -// along with SharpDisplayManager.  If not, see <http://www.gnu.org/licenses/>.
    7.21 -//
    7.22 -
    7.23 -using System;
    7.24 -using System.Collections.Generic;
    7.25 -using System.ComponentModel;
    7.26 -using System.Data;
    7.27 -using System.Drawing;
    7.28 -using System.Linq;
    7.29 -using System.Text;
    7.30 -using System.Threading.Tasks;
    7.31 -using System.Windows.Forms;
    7.32 -using System.IO;
    7.33 -using CodeProject.Dialog;
    7.34 -using System.Drawing.Imaging;
    7.35 -using System.ServiceModel;
    7.36 -using System.Threading;
    7.37 -using System.Diagnostics;
    7.38 -using System.Deployment.Application;
    7.39 -using System.Reflection;
    7.40 -//NAudio
    7.41 -using NAudio.CoreAudioApi;
    7.42 -using NAudio.CoreAudioApi.Interfaces;
    7.43 -using System.Runtime.InteropServices;
    7.44 -using CecSharp;
    7.45 -//Network
    7.46 -using NETWORKLIST;
    7.47 -//
    7.48 -using SharpDisplayClient;
    7.49 -using SharpDisplay;
    7.50 -using MiniDisplayInterop;
    7.51 -using SharpLib.Display;
    7.52 -using SharpLib.Ear;
    7.53 -
    7.54 -namespace SharpDisplayManager
    7.55 -{
    7.56 -    //Types declarations
    7.57 -    public delegate uint ColorProcessingDelegate(int aX, int aY, uint aPixel);
    7.58 -
    7.59 -    public delegate int CoordinateTranslationDelegate(System.Drawing.Bitmap aBmp, int aInt);
    7.60 -
    7.61 -    //Delegates are used for our thread safe method
    7.62 -    public delegate void AddClientDelegate(string aSessionId, ICallback aCallback);
    7.63 -
    7.64 -    public delegate void RemoveClientDelegate(string aSessionId);
    7.65 -
    7.66 -    public delegate void SetFieldDelegate(string SessionId, DataField aField);
    7.67 -
    7.68 -    public delegate void SetFieldsDelegate(string SessionId, System.Collections.Generic.IList<DataField> aFields);
    7.69 -
    7.70 -    public delegate void SetLayoutDelegate(string SessionId, TableLayout aLayout);
    7.71 -
    7.72 -    public delegate void SetClientNameDelegate(string aSessionId, string aName);
    7.73 -
    7.74 -    public delegate void SetClientPriorityDelegate(string aSessionId, uint aPriority);
    7.75 -
    7.76 -    public delegate void PlainUpdateDelegate();
    7.77 -
    7.78 -    public delegate void WndProcDelegate(ref Message aMessage);
    7.79 -
    7.80 -    /// <summary>
    7.81 -    /// Our Display manager main form
    7.82 -    /// </summary>
    7.83 -    [System.ComponentModel.DesignerCategory("Form")]
    7.84 -    public partial class MainForm : MainFormHid, IMMNotificationClient
    7.85 -    {
    7.86 -        //public ManagerEventAction iManager = new ManagerEventAction();        
    7.87 -        DateTime LastTickTime;
    7.88 -        Display iDisplay;
    7.89 -        System.Drawing.Bitmap iBmp;
    7.90 -        bool iCreateBitmap; //Workaround render to bitmap issues when minimized
    7.91 -        ServiceHost iServiceHost;
    7.92 -        // Our collection of clients sorted by session id.
    7.93 -        public Dictionary<string, ClientData> iClients;
    7.94 -        // The name of the client which informations are currently displayed.
    7.95 -        public string iCurrentClientSessionId;
    7.96 -        ClientData iCurrentClientData;
    7.97 -        //
    7.98 -        public bool iClosing;
    7.99 -        //
   7.100 -        public bool iSkipFrameRendering;
   7.101 -        //Function pointer for pixel color filtering
   7.102 -        ColorProcessingDelegate iColorFx;
   7.103 -        //Function pointer for pixel X coordinate intercept
   7.104 -        CoordinateTranslationDelegate iScreenX;
   7.105 -        //Function pointer for pixel Y coordinate intercept
   7.106 -        CoordinateTranslationDelegate iScreenY;
   7.107 -        //NAudio
   7.108 -        private MMDeviceEnumerator iMultiMediaDeviceEnumerator;
   7.109 -        private MMDevice iMultiMediaDevice;
   7.110 -        //Network
   7.111 -        private NetworkManager iNetworkManager;
   7.112 -
   7.113 -        /// <summary>
   7.114 -        /// CEC - Consumer Electronic Control.
   7.115 -        /// Notably used to turn TV on and off as Windows broadcast monitor on and off notifications.
   7.116 -        /// </summary>
   7.117 -        private ConsumerElectronicControl iCecManager;
   7.118 -
   7.119 -        /// <summary>
   7.120 -        /// Manage run when Windows startup option
   7.121 -        /// </summary>
   7.122 -        private StartupManager iStartupManager;
   7.123 -
   7.124 -        /// <summary>
   7.125 -        /// System notification icon used to hide our application from the task bar.
   7.126 -        /// </summary>
   7.127 -        private SharpLib.Notification.Control iNotifyIcon;
   7.128 -
   7.129 -        /// <summary>
   7.130 -        /// System recording notification icon.
   7.131 -        /// </summary>
   7.132 -        private SharpLib.Notification.Control iRecordingNotification;
   7.133 -
   7.134 -        /// <summary>
   7.135 -        /// 
   7.136 -        /// </summary>
   7.137 -        RichTextBoxTextWriter iWriter;
   7.138 -
   7.139 -
   7.140 -        /// <summary>
   7.141 -        /// Allow user to receive window messages;
   7.142 -        /// </summary>
   7.143 -        public event WndProcDelegate OnWndProc;
   7.144 -
   7.145 -        public MainForm()
   7.146 -        {
   7.147 -            ManagerEventAction.Current = Properties.Settings.Default.Actions;
   7.148 -            if (ManagerEventAction.Current == null)
   7.149 -            {
   7.150 -                //No actions in our settings yet
   7.151 -                ManagerEventAction.Current = new ManagerEventAction();
   7.152 -                Properties.Settings.Default.Actions = ManagerEventAction.Current;
   7.153 -            }
   7.154 -            else
   7.155 -            {
   7.156 -                //We loaded actions from our settings
   7.157 -                //We need to hook them with corresponding events
   7.158 -                ManagerEventAction.Current.Init();
   7.159 -            }
   7.160 -            iSkipFrameRendering = false;
   7.161 -            iClosing = false;
   7.162 -            iCurrentClientSessionId = "";
   7.163 -            iCurrentClientData = null;
   7.164 -            LastTickTime = DateTime.Now;
   7.165 -            //Instantiate our display and register for events notifications
   7.166 -            iDisplay = new Display();
   7.167 -            iDisplay.OnOpened += OnDisplayOpened;
   7.168 -            iDisplay.OnClosed += OnDisplayClosed;
   7.169 -            //
   7.170 -            iClients = new Dictionary<string, ClientData>();
   7.171 -            iStartupManager = new StartupManager();
   7.172 -            iNotifyIcon = new SharpLib.Notification.Control();
   7.173 -            iRecordingNotification = new SharpLib.Notification.Control();
   7.174 -
   7.175 -            //Have our designer initialize its controls
   7.176 -            InitializeComponent();
   7.177 -
   7.178 -            //Redirect console output
   7.179 -            iWriter = new RichTextBoxTextWriter(richTextBoxLogs);
   7.180 -            Console.SetOut(iWriter);
   7.181 -
   7.182 -            //Populate device types
   7.183 -            PopulateDeviceTypes();
   7.184 -
   7.185 -            //Populate optical drives
   7.186 -            PopulateOpticalDrives();
   7.187 -
   7.188 -            //Initial status update 
   7.189 -            UpdateStatus();
   7.190 -
   7.191 -            //We have a bug when drawing minimized and reusing our bitmap
   7.192 -            //Though I could not reproduce it on Windows 10
   7.193 -            iBmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height,
   7.194 -                PixelFormat.Format32bppArgb);
   7.195 -            iCreateBitmap = false;
   7.196 -
   7.197 -            //Minimize our window if desired
   7.198 -            if (Properties.Settings.Default.StartMinimized)
   7.199 -            {
   7.200 -                WindowState = FormWindowState.Minimized;
   7.201 -            }
   7.202 -
   7.203 -        }
   7.204 -
   7.205 -        /// <summary>
   7.206 -        ///
   7.207 -        /// </summary>
   7.208 -        /// <param name="sender"></param>
   7.209 -        /// <param name="e"></param>
   7.210 -        private void MainForm_Load(object sender, EventArgs e)
   7.211 -        {
   7.212 -            //Check if we are running a Click Once deployed application
   7.213 -            if (ApplicationDeployment.IsNetworkDeployed)
   7.214 -            {
   7.215 -                //This is a proper Click Once installation, fetch and show our version number
   7.216 -                this.Text += " - v" + ApplicationDeployment.CurrentDeployment.CurrentVersion;
   7.217 -            }
   7.218 -            else
   7.219 -            {
   7.220 -                //Not a proper Click Once installation, assuming development build then
   7.221 -                this.Text += " - development";
   7.222 -            }
   7.223 -
   7.224 -            //NAudio
   7.225 -            iMultiMediaDeviceEnumerator = new MMDeviceEnumerator();
   7.226 -            iMultiMediaDeviceEnumerator.RegisterEndpointNotificationCallback(this);
   7.227 -            UpdateAudioDeviceAndMasterVolumeThreadSafe();
   7.228 -
   7.229 -            //Network
   7.230 -            iNetworkManager = new NetworkManager();
   7.231 -            iNetworkManager.OnConnectivityChanged += OnConnectivityChanged;
   7.232 -            UpdateNetworkStatus();
   7.233 -
   7.234 -            //CEC
   7.235 -            iCecManager = new ConsumerElectronicControl();
   7.236 -            OnWndProc += iCecManager.OnWndProc;
   7.237 -            ResetCec();
   7.238 -
   7.239 -            //Setup Events
   7.240 -            PopulateEventsTreeView();
   7.241 -
   7.242 -            //Setup notification icon
   7.243 -            SetupTrayIcon();
   7.244 -
   7.245 -            //Setup recording notification
   7.246 -            SetupRecordingNotification();
   7.247 -
   7.248 -            // To make sure start up with minimize to tray works
   7.249 -            if (WindowState == FormWindowState.Minimized && Properties.Settings.Default.MinimizeToTray)
   7.250 -            {
   7.251 -                Visible = false;
   7.252 -            }
   7.253 -
   7.254 -#if !DEBUG
   7.255 -    //When not debugging we want the screen to be empty until a client takes over
   7.256 -			ClearLayout();
   7.257 -#else
   7.258 -            //When developing we want at least one client for testing
   7.259 -            StartNewClient("abcdefghijklmnopqrst-0123456789", "ABCDEFGHIJKLMNOPQRST-0123456789");
   7.260 -#endif
   7.261 -
   7.262 -            //Open display connection on start-up if needed
   7.263 -            if (Properties.Settings.Default.DisplayConnectOnStartup)
   7.264 -            {
   7.265 -                OpenDisplayConnection();
   7.266 -            }
   7.267 -
   7.268 -            //Start our server so that we can get client requests
   7.269 -            StartServer();
   7.270 -
   7.271 -            //Register for HID events
   7.272 -            RegisterHidDevices();
   7.273 -
   7.274 -            //Start Idle client if needed
   7.275 -            if (Properties.Settings.Default.StartIdleClient)
   7.276 -            {
   7.277 -                StartIdleClient();
   7.278 -            }
   7.279 -        }
   7.280 -
   7.281 -        /// <summary>
   7.282 -        /// Called when our display is opened.
   7.283 -        /// </summary>
   7.284 -        /// <param name="aDisplay"></param>
   7.285 -        private void OnDisplayOpened(Display aDisplay)
   7.286 -        {
   7.287 -            //Make sure we resume frame rendering
   7.288 -            iSkipFrameRendering = false;
   7.289 -
   7.290 -            //Set our screen size now that our display is connected
   7.291 -            //Our panelDisplay is the container of our tableLayoutPanel
   7.292 -            //tableLayoutPanel will resize itself to fit the client size of our panelDisplay
   7.293 -            //panelDisplay needs an extra 2 pixels for borders on each sides
   7.294 -            //tableLayoutPanel will eventually be the exact size of our display
   7.295 -            Size size = new Size(iDisplay.WidthInPixels() + 2, iDisplay.HeightInPixels() + 2);
   7.296 -            panelDisplay.Size = size;
   7.297 -
   7.298 -            //Our display was just opened, update our UI
   7.299 -            UpdateStatus();
   7.300 -            //Initiate asynchronous request
   7.301 -            iDisplay.RequestFirmwareRevision();
   7.302 -
   7.303 -            //Audio
   7.304 -            UpdateMasterVolumeThreadSafe();
   7.305 -            //Network
   7.306 -            UpdateNetworkStatus();
   7.307 -
   7.308 -#if DEBUG
   7.309 -            //Testing icon in debug, no arm done if icon not supported
   7.310 -            //iDisplay.SetIconStatus(Display.TMiniDisplayIconType.EMiniDisplayIconRecording, 0, 1);
   7.311 -            //iDisplay.SetAllIconsStatus(2);
   7.312 -#endif
   7.313 -
   7.314 -        }
   7.315 -
   7.316 -        /// <summary>
   7.317 -        /// Populate tree view with events and actions
   7.318 -        /// </summary>
   7.319 -        private void PopulateEventsTreeView()
   7.320 -        {
   7.321 -            //Disable action buttons
   7.322 -            buttonAddAction.Enabled = false;
   7.323 -            buttonDeleteAction.Enabled = false;
   7.324 -
   7.325 -            Event currentEvent = CurrentEvent();
   7.326 -            SharpLib.Ear.Action currentAction = CurrentAction();
   7.327 -            TreeNode treeNodeToSelect = null;
   7.328 -
   7.329 -            //Reset our tree
   7.330 -            iTreeViewEvents.Nodes.Clear();
   7.331 -            //Populate registered events
   7.332 -            foreach (string key in ManagerEventAction.Current.Events.Keys)
   7.333 -            {
   7.334 -                Event e = ManagerEventAction.Current.Events[key];
   7.335 -                TreeNode eventNode = iTreeViewEvents.Nodes.Add(key, e.Name);
   7.336 -                eventNode.Tag = e;
   7.337 -                eventNode.Nodes.Add(key + ".Description", e.Description);
   7.338 -                TreeNode actionsNodes = eventNode.Nodes.Add(key + ".Actions", "Actions");
   7.339 -
   7.340 -                // Add our actions for that event
   7.341 -                foreach (SharpLib.Ear.Action a in e.Actions)
   7.342 -                {
   7.343 -                    TreeNode actionNode = actionsNodes.Nodes.Add(a.Brief());
   7.344 -                    actionNode.Tag = a;
   7.345 -                    if (a == currentAction)
   7.346 -                    {
   7.347 -                        treeNodeToSelect = actionNode;
   7.348 -                    }
   7.349 -                }
   7.350 -            }
   7.351 -
   7.352 -            iTreeViewEvents.ExpandAll();
   7.353 -            SelectEvent(currentEvent);
   7.354 -            
   7.355 -            if (treeNodeToSelect != null)
   7.356 -            {
   7.357 -                iTreeViewEvents.SelectedNode = treeNodeToSelect;
   7.358 -            }
   7.359 -            else if (iTreeViewEvents.SelectedNode != null && iTreeViewEvents.SelectedNode.Nodes[1].GetNodeCount(false) > 0)
   7.360 -            {
   7.361 -                //Select the last action if any 
   7.362 -                iTreeViewEvents.SelectedNode =
   7.363 -                    iTreeViewEvents.SelectedNode.Nodes[1].Nodes[
   7.364 -                        iTreeViewEvents.SelectedNode.Nodes[1].GetNodeCount(false) - 1];
   7.365 -            }
   7.366 -
   7.367 -        }
   7.368 -
   7.369 -        /// <summary>
   7.370 -        /// Called when our display is closed.
   7.371 -        /// </summary>
   7.372 -        /// <param name="aDisplay"></param>
   7.373 -        private void OnDisplayClosed(Display aDisplay)
   7.374 -        {
   7.375 -            //Our display was just closed, update our UI consequently
   7.376 -            UpdateStatus();
   7.377 -        }
   7.378 -
   7.379 -        public void OnConnectivityChanged(NetworkManager aNetwork, NLM_CONNECTIVITY newConnectivity)
   7.380 -        {
   7.381 -            //Update network status
   7.382 -            UpdateNetworkStatus();
   7.383 -        }
   7.384 -
   7.385 -        /// <summary>
   7.386 -        /// Update our Network Status
   7.387 -        /// </summary>
   7.388 -        private void UpdateNetworkStatus()
   7.389 -        {
   7.390 -            if (iDisplay.IsOpen())
   7.391 -            {
   7.392 -                iDisplay.SetIconOnOff(MiniDisplay.IconType.Internet,
   7.393 -                    iNetworkManager.NetworkListManager.IsConnectedToInternet);
   7.394 -                iDisplay.SetIconOnOff(MiniDisplay.IconType.NetworkSignal, iNetworkManager.NetworkListManager.IsConnected);
   7.395 -            }
   7.396 -        }
   7.397 -
   7.398 -
   7.399 -        int iLastNetworkIconIndex = 0;
   7.400 -        int iUpdateCountSinceLastNetworkAnimation = 0;
   7.401 -
   7.402 -        /// <summary>
   7.403 -        /// 
   7.404 -        /// </summary>
   7.405 -        private void UpdateNetworkSignal(DateTime aLastTickTime, DateTime aNewTickTime)
   7.406 -        {
   7.407 -            iUpdateCountSinceLastNetworkAnimation++;
   7.408 -            iUpdateCountSinceLastNetworkAnimation = iUpdateCountSinceLastNetworkAnimation%4;
   7.409 -
   7.410 -            if (iDisplay.IsOpen() && iNetworkManager.NetworkListManager.IsConnected &&
   7.411 -                iUpdateCountSinceLastNetworkAnimation == 0)
   7.412 -            {
   7.413 -                int iconCount = iDisplay.IconCount(MiniDisplay.IconType.NetworkSignal);
   7.414 -                if (iconCount <= 0)
   7.415 -                {
   7.416 -                    //Prevents div by zero and other undefined behavior
   7.417 -                    return;
   7.418 -                }
   7.419 -                iLastNetworkIconIndex++;
   7.420 -                iLastNetworkIconIndex = iLastNetworkIconIndex%(iconCount*2);
   7.421 -                for (int i = 0; i < iconCount; i++)
   7.422 -                {
   7.423 -                    if (i < iLastNetworkIconIndex && !(i == 0 && iLastNetworkIconIndex > 3) &&
   7.424 -                        !(i == 1 && iLastNetworkIconIndex > 4))
   7.425 -                    {
   7.426 -                        iDisplay.SetIconOn(MiniDisplay.IconType.NetworkSignal, i);
   7.427 -                    }
   7.428 -                    else
   7.429 -                    {
   7.430 -                        iDisplay.SetIconOff(MiniDisplay.IconType.NetworkSignal, i);
   7.431 -                    }
   7.432 -                }
   7.433 -            }
   7.434 -        }
   7.435 -
   7.436 -
   7.437 -
   7.438 -        /// <summary>
   7.439 -        /// Receive volume change notification and reflect changes on our slider.
   7.440 -        /// </summary>
   7.441 -        /// <param name="data"></param>
   7.442 -        public void OnVolumeNotificationThreadSafe(AudioVolumeNotificationData data)
   7.443 -        {
   7.444 -            UpdateMasterVolumeThreadSafe();
   7.445 -        }
   7.446 -
   7.447 -        /// <summary>
   7.448 -        /// Update master volume when user moves our slider.
   7.449 -        /// </summary>
   7.450 -        /// <param name="sender"></param>
   7.451 -        /// <param name="e"></param>
   7.452 -        private void trackBarMasterVolume_Scroll(object sender, EventArgs e)
   7.453 -        {
   7.454 -            //Just like Windows Volume Mixer we unmute if the volume is adjusted
   7.455 -            iMultiMediaDevice.AudioEndpointVolume.Mute = false;
   7.456 -            //Set volume level according to our volume slider new position
   7.457 -            iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar = trackBarMasterVolume.Value/100.0f;
   7.458 -        }
   7.459 -
   7.460 -
   7.461 -        /// <summary>
   7.462 -        /// Mute check box changed.
   7.463 -        /// </summary>
   7.464 -        /// <param name="sender"></param>
   7.465 -        /// <param name="e"></param>
   7.466 -        private void checkBoxMute_CheckedChanged(object sender, EventArgs e)
   7.467 -        {
   7.468 -            iMultiMediaDevice.AudioEndpointVolume.Mute = checkBoxMute.Checked;
   7.469 -        }
   7.470 -
   7.471 -        /// <summary>
   7.472 -        /// Device State Changed
   7.473 -        /// </summary>
   7.474 -        public void OnDeviceStateChanged([MarshalAs(UnmanagedType.LPWStr)] string deviceId,
   7.475 -            [MarshalAs(UnmanagedType.I4)] DeviceState newState)
   7.476 -        {
   7.477 -        }
   7.478 -
   7.479 -        /// <summary>
   7.480 -        /// Device Added
   7.481 -        /// </summary>
   7.482 -        public void OnDeviceAdded([MarshalAs(UnmanagedType.LPWStr)] string pwstrDeviceId)
   7.483 -        {
   7.484 -        }
   7.485 -
   7.486 -        /// <summary>
   7.487 -        /// Device Removed
   7.488 -        /// </summary>
   7.489 -        public void OnDeviceRemoved([MarshalAs(UnmanagedType.LPWStr)] string deviceId)
   7.490 -        {
   7.491 -        }
   7.492 -
   7.493 -        /// <summary>
   7.494 -        /// Default Device Changed
   7.495 -        /// </summary>
   7.496 -        public void OnDefaultDeviceChanged(DataFlow flow, Role role,
   7.497 -            [MarshalAs(UnmanagedType.LPWStr)] string defaultDeviceId)
   7.498 -        {
   7.499 -            if (role == Role.Multimedia && flow == DataFlow.Render)
   7.500 -            {
   7.501 -                UpdateAudioDeviceAndMasterVolumeThreadSafe();
   7.502 -            }
   7.503 -        }
   7.504 -
   7.505 -        /// <summary>
   7.506 -        /// Property Value Changed
   7.507 -        /// </summary>
   7.508 -        /// <param name="pwstrDeviceId"></param>
   7.509 -        /// <param name="key"></param>
   7.510 -        public void OnPropertyValueChanged([MarshalAs(UnmanagedType.LPWStr)] string pwstrDeviceId, PropertyKey key)
   7.511 -        {
   7.512 -        }
   7.513 -
   7.514 -
   7.515 -
   7.516 -
   7.517 -        /// <summary>
   7.518 -        /// Update master volume indicators based our current system states.
   7.519 -        /// This typically includes volume levels and mute status.
   7.520 -        /// </summary>
   7.521 -        private void UpdateMasterVolumeThreadSafe()
   7.522 -        {
   7.523 -            if (this.InvokeRequired)
   7.524 -            {
   7.525 -                //Not in the proper thread, invoke ourselves
   7.526 -                PlainUpdateDelegate d = new PlainUpdateDelegate(UpdateMasterVolumeThreadSafe);
   7.527 -                this.Invoke(d, new object[] {});
   7.528 -                return;
   7.529 -            }
   7.530 -
   7.531 -            //Update volume slider
   7.532 -            float volumeLevelScalar = iMultiMediaDevice.AudioEndpointVolume.MasterVolumeLevelScalar;
   7.533 -            trackBarMasterVolume.Value = Convert.ToInt32(volumeLevelScalar*100);
   7.534 -            //Update mute checkbox
   7.535 -            checkBoxMute.Checked = iMultiMediaDevice.AudioEndpointVolume.Mute;
   7.536 -
   7.537 -            //If our display connection is open we need to update its icons
   7.538 -            if (iDisplay.IsOpen())
   7.539 -            {
   7.540 -                //First take care our our volume level icons
   7.541 -                int volumeIconCount = iDisplay.IconCount(MiniDisplay.IconType.Volume);
   7.542 -                if (volumeIconCount > 0)
   7.543 -                {
   7.544 -                    //Compute current volume level from system level and the number of segments in our display volume bar.
   7.545 -                    //That tells us how many segments in our volume bar needs to be turned on.
   7.546 -                    float currentVolume = volumeLevelScalar*volumeIconCount;
   7.547 -                    int segmentOnCount = Convert.ToInt32(currentVolume);
   7.548 -                    //Check if our segment count was rounded up, this will later be used for half brightness segment
   7.549 -                    bool roundedUp = segmentOnCount > currentVolume;
   7.550 -
   7.551 -                    for (int i = 0; i < volumeIconCount; i++)
   7.552 -                    {
   7.553 -                        if (i < segmentOnCount)
   7.554 -                        {
   7.555 -                            //If we are dealing with our last segment and our segment count was rounded up then we will use half brightness.
   7.556 -                            if (i == segmentOnCount - 1 && roundedUp)
   7.557 -                            {
   7.558 -                                //Half brightness
   7.559 -                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i,
   7.560 -                                    (iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1)/2);
   7.561 -                            }
   7.562 -                            else
   7.563 -                            {
   7.564 -                                //Full brightness
   7.565 -                                iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i,
   7.566 -                                    iDisplay.IconStatusCount(MiniDisplay.IconType.Volume) - 1);
   7.567 -                            }
   7.568 -                        }
   7.569 -                        else
   7.570 -                        {
   7.571 -                            iDisplay.SetIconStatus(MiniDisplay.IconType.Volume, i, 0);
   7.572 -                        }
   7.573 -                    }
   7.574 -                }
   7.575 -
   7.576 -                //Take care of our mute icon
   7.577 -                iDisplay.SetIconOnOff(MiniDisplay.IconType.Mute, iMultiMediaDevice.AudioEndpointVolume.Mute);
   7.578 -            }
   7.579 -
   7.580 -        }
   7.581 -
   7.582 -        /// <summary>
   7.583 -        /// 
   7.584 -        /// </summary>
   7.585 -        private void UpdateAudioDeviceAndMasterVolumeThreadSafe()
   7.586 -        {
   7.587 -            if (this.InvokeRequired)
   7.588 -            {
   7.589 -                //Not in the proper thread, invoke ourselves
   7.590 -                PlainUpdateDelegate d = new PlainUpdateDelegate(UpdateAudioDeviceAndMasterVolumeThreadSafe);
   7.591 -                this.Invoke(d, new object[] {});
   7.592 -                return;
   7.593 -            }
   7.594 -
   7.595 -            //We are in the correct thread just go ahead.
   7.596 -            try
   7.597 -            {
   7.598 -                //Get our master volume            
   7.599 -                iMultiMediaDevice = iMultiMediaDeviceEnumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
   7.600 -                //Update our label
   7.601 -                labelDefaultAudioDevice.Text = iMultiMediaDevice.FriendlyName;
   7.602 -
   7.603 -                //Show our volume in our track bar
   7.604 -                UpdateMasterVolumeThreadSafe();
   7.605 -
   7.606 -                //Register to get volume modifications
   7.607 -                iMultiMediaDevice.AudioEndpointVolume.OnVolumeNotification += OnVolumeNotificationThreadSafe;
   7.608 -                //
   7.609 -                trackBarMasterVolume.Enabled = true;
   7.610 -            }
   7.611 -            catch (Exception ex)
   7.612 -            {
   7.613 -                Debug.WriteLine("Exception thrown in UpdateAudioDeviceAndMasterVolume");
   7.614 -                Debug.WriteLine(ex.ToString());
   7.615 -                //Something went wrong S/PDIF device ca throw exception I guess
   7.616 -                trackBarMasterVolume.Enabled = false;
   7.617 -            }
   7.618 -        }
   7.619 -
   7.620 -        /// <summary>
   7.621 -        /// 
   7.622 -        /// </summary>
   7.623 -        private void PopulateDeviceTypes()
   7.624 -        {
   7.625 -            int count = Display.TypeCount();
   7.626 -
   7.627 -            for (int i = 0; i < count; i++)
   7.628 -            {
   7.629 -                comboBoxDisplayType.Items.Add(Display.TypeName((MiniDisplay.Type) i));
   7.630 -            }
   7.631 -        }
   7.632 -
   7.633 -        /// <summary>
   7.634 -        /// 
   7.635 -        /// </summary>
   7.636 -        private void PopulateOpticalDrives()
   7.637 -        {
   7.638 -            //Reset our list of drives
   7.639 -            comboBoxOpticalDrives.Items.Clear();
   7.640 -            comboBoxOpticalDrives.Items.Add("None");
   7.641 -
   7.642 -            //Go through each drives on our system and collected the optical ones in our list
   7.643 -            DriveInfo[] allDrives = DriveInfo.GetDrives();
   7.644 -            foreach (DriveInfo d in allDrives)
   7.645 -            {
   7.646 -                Debug.WriteLine("Drive " + d.Name);
   7.647 -                Debug.WriteLine("  Drive type: {0}", d.DriveType);
   7.648 -
   7.649 -                if (d.DriveType == DriveType.CDRom)
   7.650 -                {
   7.651 -                    //This is an optical drive, add it now
   7.652 -                    comboBoxOpticalDrives.Items.Add(d.Name.Substring(0, 2));
   7.653 -                }
   7.654 -            }
   7.655 -        }
   7.656 -
   7.657 -        /// <summary>
   7.658 -        /// 
   7.659 -        /// </summary>
   7.660 -        /// <returns></returns>
   7.661 -        public string OpticalDriveToEject()
   7.662 -        {
   7.663 -            return comboBoxOpticalDrives.SelectedItem.ToString();
   7.664 -        }
   7.665 -
   7.666 -
   7.667 -
   7.668 -        /// <summary>
   7.669 -        ///
   7.670 -        /// </summary>
   7.671 -        private void SetupTrayIcon()
   7.672 -        {
   7.673 -            iNotifyIcon.Icon = GetIcon("vfd.ico");
   7.674 -            iNotifyIcon.Text = "Sharp Display Manager";
   7.675 -            iNotifyIcon.Visible = true;
   7.676 -
   7.677 -            //Double click toggles visibility - typically brings up the application
   7.678 -            iNotifyIcon.DoubleClick += delegate(object obj, EventArgs args)
   7.679 -            {
   7.680 -                SysTrayHideShow();
   7.681 -            };
   7.682 -
   7.683 -            //Adding a context menu, useful to be able to exit the application
   7.684 -            ContextMenu contextMenu = new ContextMenu();
   7.685 -            //Context menu item to toggle visibility
   7.686 -            MenuItem hideShowItem = new MenuItem("Hide/Show");
   7.687 -            hideShowItem.Click += delegate(object obj, EventArgs args)
   7.688 -            {
   7.689 -                SysTrayHideShow();
   7.690 -            };
   7.691 -            contextMenu.MenuItems.Add(hideShowItem);
   7.692 -
   7.693 -            //Context menu item separator
   7.694 -            contextMenu.MenuItems.Add(new MenuItem("-"));
   7.695 -
   7.696 -            //Context menu exit item
   7.697 -            MenuItem exitItem = new MenuItem("Exit");
   7.698 -            exitItem.Click += delegate(object obj, EventArgs args)
   7.699 -            {
   7.700 -                Application.Exit();
   7.701 -            };
   7.702 -            contextMenu.MenuItems.Add(exitItem);
   7.703 -
   7.704 -            iNotifyIcon.ContextMenu = contextMenu;
   7.705 -        }
   7.706 -
   7.707 -        /// <summary>
   7.708 -        ///
   7.709 -        /// </summary>
   7.710 -        private void SetupRecordingNotification()
   7.711 -        {
   7.712 -            iRecordingNotification.Icon = GetIcon("record.ico");
   7.713 -            iRecordingNotification.Text = "No recording";
   7.714 -            iRecordingNotification.Visible = false;
   7.715 -        }
   7.716 -
   7.717 -        /// <summary>
   7.718 -        /// Access icons from embedded resources.
   7.719 -        /// </summary>
   7.720 -        /// <param name="aName"></param>
   7.721 -        /// <returns></returns>
   7.722 -        public static Icon GetIcon(string aName)
   7.723 -        {
   7.724 -            string[] names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
   7.725 -            foreach (string name in names)
   7.726 -            {
   7.727 -                //Find a resource name that ends with the given name
   7.728 -                if (name.EndsWith(aName))
   7.729 -                {
   7.730 -                    using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
   7.731 -                    {
   7.732 -                        return new Icon(stream);
   7.733 -                    }
   7.734 -                }
   7.735 -            }
   7.736 -
   7.737 -            return null;
   7.738 -        }
   7.739 -
   7.740 -
   7.741 -        /// <summary>
   7.742 -        /// Set our current client.
   7.743 -        /// This will take care of applying our client layout and set data fields.
   7.744 -        /// </summary>
   7.745 -        /// <param name="aSessionId"></param>
   7.746 -        void SetCurrentClient(string aSessionId, bool aForce = false)
   7.747 -        {
   7.748 -            if (aSessionId == iCurrentClientSessionId)
   7.749 -            {
   7.750 -                //Given client is already the current one.
   7.751 -                //Don't bother changing anything then.
   7.752 -                return;
   7.753 -            }
   7.754 -
   7.755 -            ClientData requestedClientData = iClients[aSessionId];
   7.756 -
   7.757 -            //Check when was the last time we switched to that client
   7.758 -            if (iCurrentClientData != null)
   7.759 -            {
   7.760 -                //Do not switch client if priority of current client is higher 
   7.761 -                if (!aForce && requestedClientData.Priority < iCurrentClientData.Priority)
   7.762 -                {
   7.763 -                    return;
   7.764 -                }
   7.765 -
   7.766 -
   7.767 -                double lastSwitchToClientSecondsAgo = (DateTime.Now - iCurrentClientData.LastSwitchTime).TotalSeconds;
   7.768 -                //TODO: put that hard coded value as a client property
   7.769 -                //Clients should be able to define how often they can be interrupted
   7.770 -                //Thus a background client can set this to zero allowing any other client to interrupt at any time
   7.771 -                //We could also compute this delay by looking at the requests frequencies?
   7.772 -                if (!aForce &&
   7.773 -                    requestedClientData.Priority == iCurrentClientData.Priority &&
   7.774 -                    //Time sharing is only if clients have the same priority
   7.775 -                    (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds
   7.776 -                {
   7.777 -                    //Don't switch clients too often
   7.778 -                    return;
   7.779 -                }
   7.780 -            }
   7.781 -
   7.782 -            //Set current client ID.
   7.783 -            iCurrentClientSessionId = aSessionId;
   7.784 -            //Set the time we last switched to that client
   7.785 -            iClients[aSessionId].LastSwitchTime = DateTime.Now;
   7.786 -            //Fetch and set current client data.
   7.787 -            iCurrentClientData = requestedClientData;
   7.788 -            //Apply layout and set data fields.
   7.789 -            UpdateTableLayoutPanel(iCurrentClientData);
   7.790 -        }
   7.791 -
   7.792 -        private void buttonFont_Click(object sender, EventArgs e)
   7.793 -        {
   7.794 -            //fontDialog.ShowColor = true;
   7.795 -            //fontDialog.ShowApply = true;
   7.796 -            fontDialog.ShowEffects = true;
   7.797 -            fontDialog.Font = cds.Font;
   7.798 -
   7.799 -            fontDialog.FixedPitchOnly = checkBoxFixedPitchFontOnly.Checked;
   7.800 -
   7.801 -            //fontDialog.ShowHelp = true;
   7.802 -
   7.803 -            //fontDlg.MaxSize = 40;
   7.804 -            //fontDlg.MinSize = 22;
   7.805 -
   7.806 -            //fontDialog.Parent = this;
   7.807 -            //fontDialog.StartPosition = FormStartPosition.CenterParent;
   7.808 -
   7.809 -            //DlgBox.ShowDialog(fontDialog);
   7.810 -
   7.811 -            //if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
   7.812 -            if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
   7.813 -            {
   7.814 -                //Set the fonts to all our labels in our layout
   7.815 -                foreach (Control ctrl in iTableLayoutPanel.Controls)
   7.816 -                {
   7.817 -                    if (ctrl is MarqueeLabel)
   7.818 -                    {
   7.819 -                        ((MarqueeLabel) ctrl).Font = fontDialog.Font;
   7.820 -                    }
   7.821 -                }
   7.822 -
   7.823 -                //Save font settings
   7.824 -                cds.Font = fontDialog.Font;
   7.825 -                Properties.Settings.Default.Save();
   7.826 -                //
   7.827 -                CheckFontHeight();
   7.828 -            }
   7.829 -        }
   7.830 -
   7.831 -        /// <summary>
   7.832 -        ///
   7.833 -        /// </summary>
   7.834 -        void CheckFontHeight()
   7.835 -        {
   7.836 -            //Show font height and width
   7.837 -            labelFontHeight.Text = "Font height: " + cds.Font.Height;
   7.838 -            float charWidth = IsFixedWidth(cds.Font);
   7.839 -            if (charWidth == 0.0f)
   7.840 -            {
   7.841 -                labelFontWidth.Visible = false;
   7.842 -            }
   7.843 -            else
   7.844 -            {
   7.845 -                labelFontWidth.Visible = true;
   7.846 -                labelFontWidth.Text = "Font width: " + charWidth;
   7.847 -            }
   7.848 -
   7.849 -            MarqueeLabel label = null;
   7.850 -            //Get the first label control we can find
   7.851 -            foreach (Control ctrl in iTableLayoutPanel.Controls)
   7.852 -            {
   7.853 -                if (ctrl is MarqueeLabel)
   7.854 -                {
   7.855 -                    label = (MarqueeLabel) ctrl;
   7.856 -                    break;
   7.857 -                }
   7.858 -            }
   7.859 -
   7.860 -            //Now check font height and show a warning if needed.
   7.861 -            if (label != null && label.Font.Height > label.Height)
   7.862 -            {
   7.863 -                labelWarning.Text = "WARNING: Selected font is too height by " + (label.Font.Height - label.Height) +
   7.864 -                                    " pixels!";
   7.865 -                labelWarning.Visible = true;
   7.866 -            }
   7.867 -            else
   7.868 -            {
   7.869 -                labelWarning.Visible = false;
   7.870 -            }
   7.871 -
   7.872 -        }
   7.873 -
   7.874 -        private void buttonCapture_Click(object sender, EventArgs e)
   7.875 -        {
   7.876 -            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height);
   7.877 -            iTableLayoutPanel.DrawToBitmap(bmp, iTableLayoutPanel.ClientRectangle);
   7.878 -            //Bitmap bmpToSave = new Bitmap(bmp);
   7.879 -            bmp.Save("D:\\capture.png");
   7.880 -
   7.881 -            ((MarqueeLabel) iTableLayoutPanel.Controls[0]).Text = "Captured";
   7.882 -
   7.883 -            /*
   7.884 -            string outputFileName = "d:\\capture.png";
   7.885 -            using (MemoryStream memory = new MemoryStream())
   7.886 -            {
   7.887 -                using (FileStream fs = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
   7.888 -                {
   7.889 -                    bmp.Save(memory, System.Drawing.Imaging.ImageFormat.Png);
   7.890 -                    byte[] bytes = memory.ToArray();
   7.891 -                    fs.Write(bytes, 0, bytes.Length);
   7.892 -                }
   7.893 -            }
   7.894 -             */
   7.895 -
   7.896 -        }
   7.897 -
   7.898 -        private void CheckForRequestResults()
   7.899 -        {
   7.900 -            if (iDisplay.IsRequestPending())
   7.901 -            {
   7.902 -                switch (iDisplay.AttemptRequestCompletion())
   7.903 -                {
   7.904 -                    case MiniDisplay.Request.FirmwareRevision:
   7.905 -                        toolStripStatusLabelConnect.Text += " v" + iDisplay.FirmwareRevision();
   7.906 -                        //Issue next request then
   7.907 -                        iDisplay.RequestPowerSupplyStatus();
   7.908 -                        break;
   7.909 -
   7.910 -                    case MiniDisplay.Request.PowerSupplyStatus:
   7.911 -                        if (iDisplay.PowerSupplyStatus())
   7.912 -                        {
   7.913 -                            toolStripStatusLabelPower.Text = "ON";
   7.914 -                        }
   7.915 -                        else
   7.916 -                        {
   7.917 -                            toolStripStatusLabelPower.Text = "OFF";
   7.918 -                        }
   7.919 -                        //Issue next request then
   7.920 -                        iDisplay.RequestDeviceId();
   7.921 -                        break;
   7.922 -
   7.923 -                    case MiniDisplay.Request.DeviceId:
   7.924 -                        toolStripStatusLabelConnect.Text += " - " + iDisplay.DeviceId();
   7.925 -                        //No more request to issue
   7.926 -                        break;
   7.927 -                }
   7.928 -            }
   7.929 -        }
   7.930 -
   7.931 -        public static uint ColorWhiteIsOn(int aX, int aY, uint aPixel)
   7.932 -        {
   7.933 -            if ((aPixel & 0x00FFFFFF) == 0x00FFFFFF)
   7.934 -            {
   7.935 -                return 0xFFFFFFFF;
   7.936 -            }
   7.937 -            return 0x00000000;
   7.938 -        }
   7.939 -
   7.940 -        public static uint ColorUntouched(int aX, int aY, uint aPixel)
   7.941 -        {
   7.942 -            return aPixel;
   7.943 -        }
   7.944 -
   7.945 -        public static uint ColorInversed(int aX, int aY, uint aPixel)
   7.946 -        {
   7.947 -            return ~aPixel;
   7.948 -        }
   7.949 -
   7.950 -        public static uint ColorChessboard(int aX, int aY, uint aPixel)
   7.951 -        {
   7.952 -            if ((aX%2 == 0) && (aY%2 == 0))
   7.953 -            {
   7.954 -                return ~aPixel;
   7.955 -            }
   7.956 -            else if ((aX%2 != 0) && (aY%2 != 0))
   7.957 -            {
   7.958 -                return ~aPixel;
   7.959 -            }
   7.960 -            return 0x00000000;
   7.961 -        }
   7.962 -
   7.963 -
   7.964 -        public static int ScreenReversedX(System.Drawing.Bitmap aBmp, int aX)
   7.965 -        {
   7.966 -            return aBmp.Width - aX - 1;
   7.967 -        }
   7.968 -
   7.969 -        public int ScreenReversedY(System.Drawing.Bitmap aBmp, int aY)
   7.970 -        {
   7.971 -            return iBmp.Height - aY - 1;
   7.972 -        }
   7.973 -
   7.974 -        public int ScreenX(System.Drawing.Bitmap aBmp, int aX)
   7.975 -        {
   7.976 -            return aX;
   7.977 -        }
   7.978 -
   7.979 -        public int ScreenY(System.Drawing.Bitmap aBmp, int aY)
   7.980 -        {
   7.981 -            return aY;
   7.982 -        }
   7.983 -
   7.984 -        /// <summary>
   7.985 -        /// Select proper pixel delegates according to our current settings.
   7.986 -        /// </summary>
   7.987 -        private void SetupPixelDelegates()
   7.988 -        {
   7.989 -            //Select our pixel processing routine
   7.990 -            if (cds.InverseColors)
   7.991 -            {
   7.992 -                //iColorFx = ColorChessboard;
   7.993 -                iColorFx = ColorInversed;
   7.994 -            }
   7.995 -            else
   7.996 -            {
   7.997 -                iColorFx = ColorWhiteIsOn;
   7.998 -            }
   7.999 -
  7.1000 -            //Select proper coordinate translation functions
  7.1001 -            //We used delegate/function pointer to support reverse screen without doing an extra test on each pixels
  7.1002 -            if (cds.ReverseScreen)
  7.1003 -            {
  7.1004 -                iScreenX = ScreenReversedX;
  7.1005 -                iScreenY = ScreenReversedY;
  7.1006 -            }
  7.1007 -            else
  7.1008 -            {
  7.1009 -                iScreenX = ScreenX;
  7.1010 -                iScreenY = ScreenY;
  7.1011 -            }
  7.1012 -
  7.1013 -        }
  7.1014 -
  7.1015 -        //This is our timer tick responsible to perform our render
  7.1016 -        private void timer_Tick(object sender, EventArgs e)
  7.1017 -        {
  7.1018 -            //Not ideal cause this has nothing to do with display render
  7.1019 -            LogsUpdate();
  7.1020 -
  7.1021 -            //Update our animations
  7.1022 -            DateTime NewTickTime = DateTime.Now;
  7.1023 -
  7.1024 -            UpdateNetworkSignal(LastTickTime, NewTickTime);
  7.1025 -
  7.1026 -            //Update animation for all our marquees
  7.1027 -            foreach (Control ctrl in iTableLayoutPanel.Controls)
  7.1028 -            {
  7.1029 -                if (ctrl is MarqueeLabel)
  7.1030 -                {
  7.1031 -                    ((MarqueeLabel) ctrl).UpdateAnimation(LastTickTime, NewTickTime);
  7.1032 -                }
  7.1033 -            }
  7.1034 -
  7.1035 -            //Update our display
  7.1036 -            if (iDisplay.IsOpen())
  7.1037 -            {
  7.1038 -                CheckForRequestResults();
  7.1039 -
  7.1040 -                //Check if frame rendering is needed
  7.1041 -                //Typically used when showing clock
  7.1042 -                if (!iSkipFrameRendering)
  7.1043 -                {
  7.1044 -                    //Draw to bitmap
  7.1045 -                    if (iCreateBitmap)
  7.1046 -                    {
  7.1047 -                        iBmp = new System.Drawing.Bitmap(iTableLayoutPanel.Width, iTableLayoutPanel.Height,
  7.1048 -                            PixelFormat.Format32bppArgb);
  7.1049 -                        iCreateBitmap = false;
  7.1050 -                    }
  7.1051 -                    iTableLayoutPanel.DrawToBitmap(iBmp, iTableLayoutPanel.ClientRectangle);
  7.1052 -                    //iBmp.Save("D:\\capture.png");
  7.1053 -
  7.1054 -                    //Send it to our display
  7.1055 -                    for (int i = 0; i < iBmp.Width; i++)
  7.1056 -                    {
  7.1057 -                        for (int j = 0; j < iBmp.Height; j++)
  7.1058 -                        {
  7.1059 -                            unchecked
  7.1060 -                            {
  7.1061 -                                //Get our processed pixel coordinates
  7.1062 -                                int x = iScreenX(iBmp, i);
  7.1063 -                                int y = iScreenY(iBmp, j);
  7.1064 -                                //Get pixel color
  7.1065 -                                uint color = (uint) iBmp.GetPixel(i, j).ToArgb();
  7.1066 -                                //Apply color effects
  7.1067 -                                color = iColorFx(x, y, color);
  7.1068 -                                //Now set our pixel
  7.1069 -                                iDisplay.SetPixel(x, y, color);
  7.1070 -                            }
  7.1071 -                        }
  7.1072 -                    }
  7.1073 -
  7.1074 -                    iDisplay.SwapBuffers();
  7.1075 -                }
  7.1076 -            }
  7.1077 -
  7.1078 -            //Compute instant FPS
  7.1079 -            toolStripStatusLabelFps.Text = (1.0/NewTickTime.Subtract(LastTickTime).TotalSeconds).ToString("F0") + " / " +
  7.1080 -                                           (1000/timer.Interval).ToString() + " FPS";
  7.1081 -
  7.1082 -            LastTickTime = NewTickTime;
  7.1083 -
  7.1084 -        }
  7.1085 -
  7.1086 -        /// <summary>
  7.1087 -        /// Attempt to establish connection with our display hardware.
  7.1088 -        /// </summary>
  7.1089 -        private void OpenDisplayConnection()
  7.1090 -        {
  7.1091 -            CloseDisplayConnection();
  7.1092 -
  7.1093 -            if (!iDisplay.Open((MiniDisplay.Type) cds.DisplayType))
  7.1094 -            {
  7.1095 -                UpdateStatus();
  7.1096 -                toolStripStatusLabelConnect.Text = "Connection error";
  7.1097 -            }
  7.1098 -        }
  7.1099 -
  7.1100 -        private void CloseDisplayConnection()
  7.1101 -        {
  7.1102 -            //Status will be updated upon receiving the closed event
  7.1103 -
  7.1104 -            if (iDisplay == null || !iDisplay.IsOpen())
  7.1105 -            {
  7.1106 -                return;
  7.1107 -            }
  7.1108 -
  7.1109 -            //Do not clear if we gave up on rendering already.
  7.1110 -            //This means we will keep on displaying clock on MDM166AA for instance.
  7.1111 -            if (!iSkipFrameRendering)
  7.1112 -            {
  7.1113 -                iDisplay.Clear();
  7.1114 -                iDisplay.SwapBuffers();
  7.1115 -            }
  7.1116 -
  7.1117 -            iDisplay.SetAllIconsStatus(0); //Turn off all icons
  7.1118 -            iDisplay.Close();
  7.1119 -        }
  7.1120 -
  7.1121 -        private void buttonOpen_Click(object sender, EventArgs e)
  7.1122 -        {
  7.1123 -            OpenDisplayConnection();
  7.1124 -        }
  7.1125 -
  7.1126 -        private void buttonClose_Click(object sender, EventArgs e)
  7.1127 -        {
  7.1128 -            CloseDisplayConnection();
  7.1129 -        }
  7.1130 -
  7.1131 -        private void buttonClear_Click(object sender, EventArgs e)
  7.1132 -        {
  7.1133 -            iDisplay.Clear();
  7.1134 -            iDisplay.SwapBuffers();
  7.1135 -        }
  7.1136 -
  7.1137 -        private void buttonFill_Click(object sender, EventArgs e)
  7.1138 -        {
  7.1139 -            iDisplay.Fill();
  7.1140 -            iDisplay.SwapBuffers();
  7.1141 -        }
  7.1142 -
  7.1143 -        private void trackBarBrightness_Scroll(object sender, EventArgs e)
  7.1144 -        {
  7.1145 -            cds.Brightness = trackBarBrightness.Value;
  7.1146 -            Properties.Settings.Default.Save();
  7.1147 -            iDisplay.SetBrightness(trackBarBrightness.Value);
  7.1148 -
  7.1149 -        }
  7.1150 -
  7.1151 -
  7.1152 -        /// <summary>
  7.1153 -        /// CDS stands for Current Display Settings
  7.1154 -        /// </summary>
  7.1155 -        private DisplaySettings cds
  7.1156 -        {
  7.1157 -            get
  7.1158 -            {
  7.1159 -                DisplaysSettings settings = Properties.Settings.Default.DisplaysSettings;
  7.1160 -                if (settings == null)
  7.1161 -                {
  7.1162 -                    settings = new DisplaysSettings();
  7.1163 -                    settings.Init();
  7.1164 -                    Properties.Settings.Default.DisplaysSettings = settings;
  7.1165 -                }
  7.1166 -
  7.1167 -                //Make sure all our settings have been created
  7.1168 -                while (settings.Displays.Count <= Properties.Settings.Default.CurrentDisplayIndex)
  7.1169 -                {
  7.1170 -                    settings.Displays.Add(new DisplaySettings());
  7.1171 -                }
  7.1172 -
  7.1173 -                DisplaySettings displaySettings = settings.Displays[Properties.Settings.Default.CurrentDisplayIndex];
  7.1174 -                return displaySettings;
  7.1175 -            }
  7.1176 -        }
  7.1177 -
  7.1178 -        /// <summary>
  7.1179 -        /// Check if the given font has a fixed character pitch.
  7.1180 -        /// </summary>
  7.1181 -        /// <param name="ft"></param>
  7.1182 -        /// <returns>0.0f if this is not a monospace font, otherwise returns the character width.</returns>
  7.1183 -        public float IsFixedWidth(Font ft)
  7.1184 -        {
  7.1185 -            Graphics g = CreateGraphics();
  7.1186 -            char[] charSizes = new char[] {'i', 'a', 'Z', '%', '#', 'a', 'B', 'l', 'm', ',', '.'};
  7.1187 -            float charWidth = g.MeasureString("I", ft, Int32.MaxValue, StringFormat.GenericTypographic).Width;
  7.1188 -
  7.1189 -            bool fixedWidth = true;
  7.1190 -
  7.1191 -            foreach (char c in charSizes)
  7.1192 -                if (g.MeasureString(c.ToString(), ft, Int32.MaxValue, StringFormat.GenericTypographic).Width !=
  7.1193 -                    charWidth)
  7.1194 -                    fixedWidth = false;
  7.1195 -
  7.1196 -            if (fixedWidth)
  7.1197 -            {
  7.1198 -                return charWidth;
  7.1199 -            }
  7.1200 -
  7.1201 -            return 0.0f;
  7.1202 -        }
  7.1203 -
  7.1204 -        /// <summary>
  7.1205 -        /// Synchronize UI with settings
  7.1206 -        /// </summary>
  7.1207 -        private void UpdateStatus()
  7.1208 -        {
  7.1209 -            //Load settings
  7.1210 -            checkBoxShowBorders.Checked = cds.ShowBorders;
  7.1211 -            iTableLayoutPanel.CellBorderStyle = (cds.ShowBorders
  7.1212 -                ? TableLayoutPanelCellBorderStyle.Single
  7.1213 -                : TableLayoutPanelCellBorderStyle.None);
  7.1214 -
  7.1215 -            //Set the proper font to each of our labels
  7.1216 -            foreach (MarqueeLabel ctrl in iTableLayoutPanel.Controls)
  7.1217 -            {
  7.1218 -                ctrl.Font = cds.Font;
  7.1219 -            }
  7.1220 -
  7.1221 -            CheckFontHeight();
  7.1222 -            //Check if "run on Windows startup" is enabled
  7.1223 -            checkBoxAutoStart.Checked = iStartupManager.Startup;
  7.1224 -            //
  7.1225 -            checkBoxConnectOnStartup.Checked = Properties.Settings.Default.DisplayConnectOnStartup;
  7.1226 -            checkBoxMinimizeToTray.Checked = Properties.Settings.Default.MinimizeToTray;
  7.1227 -            checkBoxStartMinimized.Checked = Properties.Settings.Default.StartMinimized;
  7.1228 -            iCheckBoxStartIdleClient.Checked = Properties.Settings.Default.StartIdleClient;
  7.1229 -            labelStartFileName.Text = Properties.Settings.Default.StartFileName;
  7.1230 -
  7.1231 -
  7.1232 -            //Try find our drive in our drive list
  7.1233 -            int opticalDriveItemIndex = 0;
  7.1234 -            bool driveNotFound = true;
  7.1235 -            string opticalDriveToEject = Properties.Settings.Default.OpticalDriveToEject;
  7.1236 -            foreach (object item in comboBoxOpticalDrives.Items)
  7.1237 -            {
  7.1238 -                if (opticalDriveToEject == item.ToString())
  7.1239 -                {
  7.1240 -                    comboBoxOpticalDrives.SelectedIndex = opticalDriveItemIndex;
  7.1241 -                    driveNotFound = false;
  7.1242 -                    break;
  7.1243 -                }
  7.1244 -                opticalDriveItemIndex++;
  7.1245 -            }
  7.1246 -
  7.1247 -            if (driveNotFound)
  7.1248 -            {
  7.1249 -                //We could not find the drive we had saved.
  7.1250 -                //Select "None" then.
  7.1251 -                comboBoxOpticalDrives.SelectedIndex = 0;
  7.1252 -            }
  7.1253 -
  7.1254 -            //CEC settings
  7.1255 -            checkBoxCecEnabled.Checked = Properties.Settings.Default.CecEnabled;
  7.1256 -            comboBoxHdmiPort.SelectedIndex = Properties.Settings.Default.CecHdmiPort - 1;
  7.1257 -
  7.1258 -            //Mini Display settings
  7.1259 -            checkBoxReverseScreen.Checked = cds.ReverseScreen;
  7.1260 -            checkBoxInverseColors.Checked = cds.InverseColors;
  7.1261 -            checkBoxShowVolumeLabel.Checked = cds.ShowVolumeLabel;
  7.1262 -            checkBoxScaleToFit.Checked = cds.ScaleToFit;
  7.1263 -            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
  7.1264 -            labelMinFontSize.Enabled = cds.ScaleToFit;
  7.1265 -            maskedTextBoxMinFontSize.Text = cds.MinFontSize.ToString();
  7.1266 -            maskedTextBoxScrollingSpeed.Text = cds.ScrollingSpeedInPixelsPerSecond.ToString();
  7.1267 -            comboBoxDisplayType.SelectedIndex = cds.DisplayType;
  7.1268 -            timer.Interval = cds.TimerInterval;
  7.1269 -            maskedTextBoxTimerInterval.Text = cds.TimerInterval.ToString();
  7.1270 -            textBoxScrollLoopSeparator.Text = cds.Separator;
  7.1271 -            //
  7.1272 -            SetupPixelDelegates();
  7.1273 -
  7.1274 -            if (iDisplay.IsOpen())
  7.1275 -            {
  7.1276 -                //We have a display connection
  7.1277 -                //Reflect that in our UI
  7.1278 -                StartTimer();
  7.1279 -
  7.1280 -                iTableLayoutPanel.Enabled = true;
  7.1281 -                panelDisplay.Enabled = true;
  7.1282 -
  7.1283 -                //Only setup brightness if display is open
  7.1284 -                trackBarBrightness.Minimum = iDisplay.MinBrightness();
  7.1285 -                trackBarBrightness.Maximum = iDisplay.MaxBrightness();
  7.1286 -                if (cds.Brightness < iDisplay.MinBrightness() || cds.Brightness > iDisplay.MaxBrightness())
  7.1287 -                {
  7.1288 -                    //Brightness out of range, this can occur when using auto-detect
  7.1289 -                    //Use max brightness instead
  7.1290 -                    trackBarBrightness.Value = iDisplay.MaxBrightness();
  7.1291 -                    iDisplay.SetBrightness(iDisplay.MaxBrightness());
  7.1292 -                }
  7.1293 -                else
  7.1294 -                {
  7.1295 -                    trackBarBrightness.Value = cds.Brightness;
  7.1296 -                    iDisplay.SetBrightness(cds.Brightness);
  7.1297 -                }
  7.1298 -
  7.1299 -                //Try compute the steps to something that makes sense
  7.1300 -                trackBarBrightness.LargeChange = Math.Max(1, (iDisplay.MaxBrightness() - iDisplay.MinBrightness())/5);
  7.1301 -                trackBarBrightness.SmallChange = 1;
  7.1302 -
  7.1303 -                //
  7.1304 -                buttonFill.Enabled = true;
  7.1305 -                buttonClear.Enabled = true;
  7.1306 -                buttonOpen.Enabled = false;
  7.1307 -                buttonClose.Enabled = true;
  7.1308 -                trackBarBrightness.Enabled = true;
  7.1309 -                toolStripStatusLabelConnect.Text = "Connected - " + iDisplay.Vendor() + " - " + iDisplay.Product();
  7.1310 -                //+ " - " + iDisplay.SerialNumber();
  7.1311 -
  7.1312 -                if (iDisplay.SupportPowerOnOff())
  7.1313 -                {
  7.1314 -                    buttonPowerOn.Enabled = true;
  7.1315 -                    buttonPowerOff.Enabled = true;
  7.1316 -                }
  7.1317 -                else
  7.1318 -                {
  7.1319 -                    buttonPowerOn.Enabled = false;
  7.1320 -                    buttonPowerOff.Enabled = false;
  7.1321 -                }
  7.1322 -
  7.1323 -                if (iDisplay.SupportClock())
  7.1324 -                {
  7.1325 -                    buttonShowClock.Enabled = true;
  7.1326 -                    buttonHideClock.Enabled = true;
  7.1327 -                }
  7.1328 -                else
  7.1329 -                {
  7.1330 -                    buttonShowClock.Enabled = false;
  7.1331 -                    buttonHideClock.Enabled = false;
  7.1332 -                }
  7.1333 -
  7.1334 -
  7.1335 -                //Check if Volume Label is supported. To date only MDM166AA supports that crap :)
  7.1336 -                checkBoxShowVolumeLabel.Enabled = iDisplay.IconCount(MiniDisplay.IconType.VolumeLabel) > 0;
  7.1337 -
  7.1338 -                if (cds.ShowVolumeLabel)
  7.1339 -                {
  7.1340 -                    iDisplay.SetIconOn(MiniDisplay.IconType.VolumeLabel);
  7.1341 -                }
  7.1342 -                else
  7.1343 -                {
  7.1344 -                    iDisplay.SetIconOff(MiniDisplay.IconType.VolumeLabel);
  7.1345 -                }
  7.1346 -            }
  7.1347 -            else
  7.1348 -            {
  7.1349 -                //Display connection not available
  7.1350 -                //Reflect that in our UI
  7.1351 -#if DEBUG
  7.1352 -                //In debug start our timer even if we don't have a display connection
  7.1353 -                StartTimer();
  7.1354 -#else
  7.1355 -    //In production environment we don't need our timer if no display connection
  7.1356 -                StopTimer();
  7.1357 -#endif
  7.1358 -                checkBoxShowVolumeLabel.Enabled = false;
  7.1359 -                iTableLayoutPanel.Enabled = false;
  7.1360 -                panelDisplay.Enabled = false;
  7.1361 -                buttonFill.Enabled = false;
  7.1362 -                buttonClear.Enabled = false;
  7.1363 -                buttonOpen.Enabled = true;
  7.1364 -                buttonClose.Enabled = false;
  7.1365 -                trackBarBrightness.Enabled = false;
  7.1366 -                buttonPowerOn.Enabled = false;
  7.1367 -                buttonPowerOff.Enabled = false;
  7.1368 -                buttonShowClock.Enabled = false;
  7.1369 -                buttonHideClock.Enabled = false;
  7.1370 -                toolStripStatusLabelConnect.Text = "Disconnected";
  7.1371 -                toolStripStatusLabelPower.Text = "N/A";
  7.1372 -            }
  7.1373 -
  7.1374 -        }
  7.1375 -
  7.1376 -
  7.1377 -        /// <summary>
  7.1378 -        /// 
  7.1379 -        /// </summary>
  7.1380 -        /// <param name="sender"></param>
  7.1381 -        /// <param name="e"></param>
  7.1382 -        private void checkBoxShowVolumeLabel_CheckedChanged(object sender, EventArgs e)
  7.1383 -        {
  7.1384 -            cds.ShowVolumeLabel = checkBoxShowVolumeLabel.Checked;
  7.1385 -            Properties.Settings.Default.Save();
  7.1386 -            UpdateStatus();
  7.1387 -        }
  7.1388 -
  7.1389 -        private void checkBoxShowBorders_CheckedChanged(object sender, EventArgs e)
  7.1390 -        {
  7.1391 -            //Save our show borders setting
  7.1392 -            iTableLayoutPanel.CellBorderStyle = (checkBoxShowBorders.Checked
  7.1393 -                ? TableLayoutPanelCellBorderStyle.Single
  7.1394 -                : TableLayoutPanelCellBorderStyle.None);
  7.1395 -            cds.ShowBorders = checkBoxShowBorders.Checked;
  7.1396 -            Properties.Settings.Default.Save();
  7.1397 -            CheckFontHeight();
  7.1398 -        }
  7.1399 -
  7.1400 -        private void checkBoxConnectOnStartup_CheckedChanged(object sender, EventArgs e)
  7.1401 -        {
  7.1402 -            //Save our connect on startup setting
  7.1403 -            Properties.Settings.Default.DisplayConnectOnStartup = checkBoxConnectOnStartup.Checked;
  7.1404 -            Properties.Settings.Default.Save();
  7.1405 -        }
  7.1406 -
  7.1407 -        private void checkBoxMinimizeToTray_CheckedChanged(object sender, EventArgs e)
  7.1408 -        {
  7.1409 -            //Save our "Minimize to tray" setting
  7.1410 -            Properties.Settings.Default.MinimizeToTray = checkBoxMinimizeToTray.Checked;
  7.1411 -            Properties.Settings.Default.Save();
  7.1412 -
  7.1413 -        }
  7.1414 -
  7.1415 -        private void checkBoxStartMinimized_CheckedChanged(object sender, EventArgs e)
  7.1416 -        {
  7.1417 -            //Save our "Start minimized" setting
  7.1418 -            Properties.Settings.Default.StartMinimized = checkBoxStartMinimized.Checked;
  7.1419 -            Properties.Settings.Default.Save();
  7.1420 -        }
  7.1421 -
  7.1422 -        private void checkBoxStartIdleClient_CheckedChanged(object sender, EventArgs e)
  7.1423 -        {
  7.1424 -            Properties.Settings.Default.StartIdleClient = iCheckBoxStartIdleClient.Checked;
  7.1425 -            Properties.Settings.Default.Save();
  7.1426 -        }
  7.1427 -
  7.1428 -        private void checkBoxAutoStart_CheckedChanged(object sender, EventArgs e)
  7.1429 -        {
  7.1430 -            iStartupManager.Startup = checkBoxAutoStart.Checked;
  7.1431 -        }
  7.1432 -
  7.1433 -
  7.1434 -        private void checkBoxReverseScreen_CheckedChanged(object sender, EventArgs e)
  7.1435 -        {
  7.1436 -            //Save our reverse screen setting
  7.1437 -            cds.ReverseScreen = checkBoxReverseScreen.Checked;
  7.1438 -            Properties.Settings.Default.Save();
  7.1439 -            SetupPixelDelegates();
  7.1440 -        }
  7.1441 -
  7.1442 -        private void checkBoxInverseColors_CheckedChanged(object sender, EventArgs e)
  7.1443 -        {
  7.1444 -            //Save our inverse colors setting
  7.1445 -            cds.InverseColors = checkBoxInverseColors.Checked;
  7.1446 -            Properties.Settings.Default.Save();
  7.1447 -            SetupPixelDelegates();
  7.1448 -        }
  7.1449 -
  7.1450 -        private void checkBoxScaleToFit_CheckedChanged(object sender, EventArgs e)
  7.1451 -        {
  7.1452 -            //Save our scale to fit setting
  7.1453 -            cds.ScaleToFit = checkBoxScaleToFit.Checked;
  7.1454 -            Properties.Settings.Default.Save();
  7.1455 -            //
  7.1456 -            labelMinFontSize.Enabled = cds.ScaleToFit;
  7.1457 -            maskedTextBoxMinFontSize.Enabled = cds.ScaleToFit;
  7.1458 -        }
  7.1459 -
  7.1460 -        private void MainForm_Resize(object sender, EventArgs e)
  7.1461 -        {
  7.1462 -            if (WindowState == FormWindowState.Minimized)
  7.1463 -            {
  7.1464 -                // To workaround our empty bitmap bug on Windows 7 we need to recreate our bitmap when the application is minimized
  7.1465 -                // That's apparently not needed on Windows 10 but we better leave it in place.
  7.1466 -                iCreateBitmap = true;
  7.1467 -            }
  7.1468 -        }
  7.1469 -
  7.1470 -        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
  7.1471 -        {
  7.1472 -            iCecManager.Stop();
  7.1473 -            iNetworkManager.Dispose();
  7.1474 -            CloseDisplayConnection();
  7.1475 -            StopServer();
  7.1476 -            e.Cancel = iClosing;
  7.1477 -        }
  7.1478 -
  7.1479 -        public void StartServer()
  7.1480 -        {
  7.1481 -            iServiceHost = new ServiceHost
  7.1482 -                (
  7.1483 -                typeof(Session),
  7.1484 -                new Uri[] {new Uri("net.tcp://localhost:8001/")}
  7.1485 -                );
  7.1486 -
  7.1487 -            iServiceHost.AddServiceEndpoint(typeof(IService), new NetTcpBinding(SecurityMode.None, true),
  7.1488 -                "DisplayService");
  7.1489 -            iServiceHost.Open();
  7.1490 -        }
  7.1491 -
  7.1492 -        public void StopServer()
  7.1493 -        {
  7.1494 -            if (iClients.Count > 0 && !iClosing)
  7.1495 -            {
  7.1496 -                //Tell our clients
  7.1497 -                iClosing = true;
  7.1498 -                BroadcastCloseEvent();
  7.1499 -            }
  7.1500 -            else if (iClosing)
  7.1501 -            {
  7.1502 -                if (
  7.1503 -                    MessageBox.Show("Force exit?", "Waiting for clients...", MessageBoxButtons.YesNo,
  7.1504 -                        MessageBoxIcon.Warning) == DialogResult.Yes)
  7.1505 -                {
  7.1506 -                    iClosing = false; //We make sure we force close if asked twice
  7.1507 -                }
  7.1508 -            }
  7.1509 -            else
  7.1510 -            {
  7.1511 -                //We removed that as it often lags for some reason
  7.1512 -                //iServiceHost.Close();
  7.1513 -            }
  7.1514 -        }
  7.1515 -
  7.1516 -        public void BroadcastCloseEvent()
  7.1517 -        {
  7.1518 -            Trace.TraceInformation("BroadcastCloseEvent - start");
  7.1519 -
  7.1520 -            var inactiveClients = new List<string>();
  7.1521 -            foreach (var client in iClients)
  7.1522 -            {
  7.1523 -                //if (client.Key != eventData.ClientName)
  7.1524 -                {
  7.1525 -                    try
  7.1526 -                    {
  7.1527 -                        Trace.TraceInformation("BroadcastCloseEvent - " + client.Key);
  7.1528 -                        client.Value.Callback.OnCloseOrder( /*eventData*/);
  7.1529 -                    }
  7.1530 -                    catch (Exception ex)
  7.1531 -                    {
  7.1532 -                        inactiveClients.Add(client.Key);
  7.1533 -                    }
  7.1534 -                }
  7.1535 -            }
  7.1536 -
  7.1537 -            if (inactiveClients.Count > 0)
  7.1538 -            {
  7.1539 -                foreach (var client in inactiveClients)
  7.1540 -                {
  7.1541 -                    iClients.Remove(client);
  7.1542 -                    Program.iMainForm.iTreeViewClients.Nodes.Remove(
  7.1543 -                        Program.iMainForm.iTreeViewClients.Nodes.Find(client, false)[0]);
  7.1544 -                }
  7.1545 -            }
  7.1546 -
  7.1547 -            if (iClients.Count == 0)
  7.1548 -            {
  7.1549 -                ClearLayout();
  7.1550 -            }
  7.1551 -        }
  7.1552 -
  7.1553 -        /// <summary>
  7.1554 -        /// Just remove all our fields.
  7.1555 -        /// </summary>
  7.1556 -        private void ClearLayout()
  7.1557 -        {
  7.1558 -            iTableLayoutPanel.Controls.Clear();
  7.1559 -            iTableLayoutPanel.RowStyles.Clear();
  7.1560 -            iTableLayoutPanel.ColumnStyles.Clear();
  7.1561 -            iCurrentClientData = null;
  7.1562 -        }
  7.1563 -
  7.1564 -        /// <summary>
  7.1565 -        /// Just launch a demo client.
  7.1566 -        /// </summary>
  7.1567 -        private void StartNewClient(string aTopText = "", string aBottomText = "")
  7.1568 -        {
  7.1569 -            Thread clientThread = new Thread(SharpDisplayClient.Program.MainWithParams);
  7.1570 -            SharpDisplayClient.StartParams myParams = new SharpDisplayClient.StartParams(
  7.1571 -                new Point(this.Right, this.Top), aTopText, aBottomText);
  7.1572 -            clientThread.Start(myParams);
  7.1573 -            BringToFront();
  7.1574 -        }
  7.1575 -
  7.1576 -        /// <summary>
  7.1577 -        /// Just launch our idle client.
  7.1578 -        /// </summary>
  7.1579 -        private void StartIdleClient(string aTopText = "", string aBottomText = "")
  7.1580 -        {
  7.1581 -            Thread clientThread = new Thread(SharpDisplayClientIdle.Program.MainWithParams);
  7.1582 -            SharpDisplayClientIdle.StartParams myParams =
  7.1583 -                new SharpDisplayClientIdle.StartParams(new Point(this.Right, this.Top), aTopText, aBottomText);
  7.1584 -            clientThread.Start(myParams);
  7.1585 -            BringToFront();
  7.1586 -        }
  7.1587 -
  7.1588 -
  7.1589 -        private void buttonStartClient_Click(object sender, EventArgs e)
  7.1590 -        {
  7.1591 -            StartNewClient();
  7.1592 -        }
  7.1593 -
  7.1594 -        private void buttonSuspend_Click(object sender, EventArgs e)
  7.1595 -        {
  7.1596 -            ToggleTimer();
  7.1597 -        }
  7.1598 -
  7.1599 -        private void StartTimer()
  7.1600 -        {
  7.1601 -            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  7.1602 -            timer.Enabled = true;
  7.1603 -            UpdateSuspendButton();
  7.1604 -        }
  7.1605 -
  7.1606 -        private void StopTimer()
  7.1607 -        {
  7.1608 -            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  7.1609 -            timer.Enabled = false;
  7.1610 -            UpdateSuspendButton();
  7.1611 -        }
  7.1612 -
  7.1613 -        private void ToggleTimer()
  7.1614 -        {
  7.1615 -            LastTickTime = DateTime.Now; //Reset timer to prevent jump
  7.1616 -            timer.Enabled = !timer.Enabled;
  7.1617 -            UpdateSuspendButton();
  7.1618 -        }
  7.1619 -
  7.1620 -        private void UpdateSuspendButton()
  7.1621 -        {
  7.1622 -            if (!timer.Enabled)
  7.1623 -            {
  7.1624 -                buttonSuspend.Text = "Run";
  7.1625 -            }
  7.1626 -            else
  7.1627 -            {
  7.1628 -                buttonSuspend.Text = "Pause";
  7.1629 -            }
  7.1630 -        }
  7.1631 -
  7.1632 -
  7.1633 -        private void buttonCloseClients_Click(object sender, EventArgs e)
  7.1634 -        {
  7.1635 -            BroadcastCloseEvent();
  7.1636 -        }
  7.1637 -
  7.1638 -        private void treeViewClients_AfterSelect(object sender, TreeViewEventArgs e)
  7.1639 -        {
  7.1640 -            //Root node must have at least one child
  7.1641 -            if (e.Node.Nodes.Count == 0)
  7.1642 -            {
  7.1643 -                return;
  7.1644 -            }
  7.1645 -
  7.1646 -            //If the selected node is the root node of a client then switch to it
  7.1647 -            string sessionId = e.Node.Nodes[0].Text; //First child of a root node is the sessionId
  7.1648 -            if (iClients.ContainsKey(sessionId)) //Check that's actually what we are looking at
  7.1649 -            {
  7.1650 -                //We have a valid session just switch to that client
  7.1651 -                SetCurrentClient(sessionId, true);
  7.1652 -            }
  7.1653 -
  7.1654 -        }
  7.1655 -
  7.1656 -
  7.1657 -        /// <summary>
  7.1658 -        ///
  7.1659 -        /// </summary>
  7.1660 -        /// <param name="aSessionId"></param>
  7.1661 -        /// <param name="aCallback"></param>
  7.1662 -        public void AddClientThreadSafe(string aSessionId, ICallback aCallback)
  7.1663 -        {
  7.1664 -            if (this.InvokeRequired)
  7.1665 -            {
  7.1666 -                //Not in the proper thread, invoke ourselves
  7.1667 -                AddClientDelegate d = new AddClientDelegate(AddClientThreadSafe);
  7.1668 -                this.Invoke(d, new object[] {aSessionId, aCallback});
  7.1669 -            }
  7.1670 -            else
  7.1671 -            {
  7.1672 -                //We are in the proper thread
  7.1673 -                //Add this session to our collection of clients
  7.1674 -                ClientData newClient = new ClientData(aSessionId, aCallback);
  7.1675 -                Program.iMainForm.iClients.Add(aSessionId, newClient);
  7.1676 -                //Add this session to our UI
  7.1677 -                UpdateClientTreeViewNode(newClient);
  7.1678 -            }
  7.1679 -        }
  7.1680 -
  7.1681 -
  7.1682 -        /// <summary>
  7.1683 -        /// Find the client with the highest priority if any.
  7.1684 -        /// </summary>
  7.1685 -        /// <returns>Our highest priority client or null if not a single client is connected.</returns>
  7.1686 -        public ClientData FindHighestPriorityClient()
  7.1687 -        {
  7.1688 -            ClientData highestPriorityClient = null;
  7.1689 -            foreach (var client in iClients)
  7.1690 -            {
  7.1691 -                if (highestPriorityClient == null || client.Value.Priority > highestPriorityClient.Priority)
  7.1692 -                {
  7.1693 -                    highestPriorityClient = client.Value;
  7.1694 -                }
  7.1695 -            }
  7.1696 -
  7.1697 -            return highestPriorityClient;
  7.1698 -        }
  7.1699 -
  7.1700 -        /// <summary>
  7.1701 -        ///
  7.1702 -        /// </summary>
  7.1703 -        /// <param name="aSessionId"></param>
  7.1704 -        public void RemoveClientThreadSafe(string aSessionId)
  7.1705 -        {
  7.1706 -            if (this.InvokeRequired)
  7.1707 -            {
  7.1708 -                //Not in the proper thread, invoke ourselves
  7.1709 -                RemoveClientDelegate d = new RemoveClientDelegate(RemoveClientThreadSafe);
  7.1710 -                this.Invoke(d, new object[] {aSessionId});
  7.1711 -            }
  7.1712 -            else
  7.1713 -            {
  7.1714 -                //We are in the proper thread
  7.1715 -                //Remove this session from both client collection and UI tree view
  7.1716 -                if (Program.iMainForm.iClients.Keys.Contains(aSessionId))
  7.1717 -                {
  7.1718 -                    Program.iMainForm.iClients.Remove(aSessionId);
  7.1719 -                    Program.iMainForm.iTreeViewClients.Nodes.Remove(
  7.1720 -                        Program.iMainForm.iTreeViewClients.Nodes.Find(aSessionId, false)[0]);
  7.1721 -                    //Update recording status too whenever a client is removed
  7.1722 -                    UpdateRecordingNotification();
  7.1723 -                }
  7.1724 -
  7.1725 -                if (iCurrentClientSessionId == aSessionId)
  7.1726 -                {
  7.1727 -                    //The current client is closing
  7.1728 -                    iCurrentClientData = null;
  7.1729 -                    //Find the client with the highest priority and set it as current
  7.1730 -                    ClientData newCurrentClient = FindHighestPriorityClient();
  7.1731 -                    if (newCurrentClient != null)
  7.1732 -                    {
  7.1733 -                        SetCurrentClient(newCurrentClient.SessionId, true);
  7.1734 -                    }
  7.1735 -                }
  7.1736 -
  7.1737 -                if (iClients.Count == 0)
  7.1738 -                {
  7.1739 -                    //Clear our screen when last client disconnects
  7.1740 -                    ClearLayout();
  7.1741 -
  7.1742 -                    if (iClosing)
  7.1743 -                    {
  7.1744 -                        //We were closing our form
  7.1745 -                        //All clients are now closed
  7.1746 -                        //Just resume our close operation
  7.1747 -                        iClosing = false;
  7.1748 -                        Close();
  7.1749 -                    }
  7.1750 -                }
  7.1751 -            }
  7.1752 -        }
  7.1753 -
  7.1754 -        /// <summary>
  7.1755 -        ///
  7.1756 -        /// </summary>
  7.1757 -        /// <param name="aSessionId"></param>
  7.1758 -        /// <param name="aLayout"></param>
  7.1759 -        public void SetClientLayoutThreadSafe(string aSessionId, TableLayout aLayout)
  7.1760 -        {
  7.1761 -            if (this.InvokeRequired)
  7.1762 -            {
  7.1763 -                //Not in the proper thread, invoke ourselves
  7.1764 -                SetLayoutDelegate d = new SetLayoutDelegate(SetClientLayoutThreadSafe);
  7.1765 -                this.Invoke(d, new object[] {aSessionId, aLayout});
  7.1766 -            }
  7.1767 -            else
  7.1768 -            {
  7.1769 -                ClientData client = iClients[aSessionId];
  7.1770 -                if (client != null)
  7.1771 -                {
  7.1772 -                    //Don't change a thing if the layout is the same
  7.1773 -                    if (!client.Layout.IsSameAs(aLayout))
  7.1774 -                    {
  7.1775 -                        Debug.Print("SetClientLayoutThreadSafe: Layout updated.");
  7.1776 -                        //Set our client layout then
  7.1777 -                        client.Layout = aLayout;
  7.1778 -                        //So that next time we update all our fields at ones
  7.1779 -                        client.HasNewLayout = true;
  7.1780 -                        //Layout has changed clear our fields then
  7.1781 -                        client.Fields.Clear();
  7.1782 -                        //
  7.1783 -                        UpdateClientTreeViewNode(client);
  7.1784 -                    }
  7.1785 -                    else
  7.1786 -                    {
  7.1787 -                        Debug.Print("SetClientLayoutThreadSafe: Layout has not changed.");
  7.1788 -                    }
  7.1789 -                }
  7.1790 -            }
  7.1791 -        }
  7.1792 -
  7.1793 -        /// <summary>
  7.1794 -        ///
  7.1795 -        /// </summary>
  7.1796 -        /// <param name="aSessionId"></param>
  7.1797 -        /// <param name="aField"></param>
  7.1798 -        public void SetClientFieldThreadSafe(string aSessionId, DataField aField)
  7.1799 -        {
  7.1800 -            if (this.InvokeRequired)
  7.1801 -            {
  7.1802 -                //Not in the proper thread, invoke ourselves
  7.1803 -                SetFieldDelegate d = new SetFieldDelegate(SetClientFieldThreadSafe);
  7.1804 -                this.Invoke(d, new object[] {aSessionId, aField});
  7.1805 -            }
  7.1806 -            else
  7.1807 -            {
  7.1808 -                //We are in the proper thread
  7.1809 -                //Call the non-thread-safe variant
  7.1810 -                SetClientField(aSessionId, aField);
  7.1811 -            }
  7.1812 -        }
  7.1813 -
  7.1814 -
  7.1815 -
  7.1816 -
  7.1817 -        /// <summary>
  7.1818 -        /// Set a data field in the given client.
  7.1819 -        /// </summary>
  7.1820 -        /// <param name="aSessionId"></param>
  7.1821 -        /// <param name="aField"></param>
  7.1822 -        private void SetClientField(string aSessionId, DataField aField)
  7.1823 -        {
  7.1824 -            //TODO: should check if the field actually changed?
  7.1825 -
  7.1826 -            ClientData client = iClients[aSessionId];
  7.1827 -            bool layoutChanged = false;
  7.1828 -            bool contentChanged = true;
  7.1829 -
  7.1830 -            //Fetch our field index
  7.1831 -            int fieldIndex = client.FindSameFieldIndex(aField);
  7.1832 -
  7.1833 -            if (fieldIndex < 0)
  7.1834 -            {
  7.1835 -                //No corresponding field, just bail out
  7.1836 -                return;
  7.1837 -            }
  7.1838 -
  7.1839 -            //Keep our previous field in there
  7.1840 -            DataField previousField = client.Fields[fieldIndex];
  7.1841 -            //Just update that field then 
  7.1842 -            client.Fields[fieldIndex] = aField;
  7.1843 -
  7.1844 -            if (!aField.IsTableField)
  7.1845 -            {
  7.1846 -                //We are done then if that field is not in our table layout
  7.1847 -                return;
  7.1848 -            }
  7.1849 -
  7.1850 -            TableField tableField = (TableField) aField;
  7.1851 -
  7.1852 -            if (previousField.IsSameLayout(aField))
  7.1853 -            {
  7.1854 -                //If we are updating a field in our current client we need to update it in our panel
  7.1855 -                if (aSessionId == iCurrentClientSessionId)
  7.1856 -                {
  7.1857 -                    Control ctrl = iTableLayoutPanel.GetControlFromPosition(tableField.Column, tableField.Row);
  7.1858 -                    if (aField.IsTextField && ctrl is MarqueeLabel)
  7.1859 -                    {
  7.1860 -                        TextField textField = (TextField) aField;
  7.1861 -                        //Text field control already in place, just change the text
  7.1862 -                        MarqueeLabel label = (MarqueeLabel) ctrl;
  7.1863 -                        contentChanged = (label.Text != textField.Text || label.TextAlign != textField.Alignment);
  7.1864 -                        label.Text = textField.Text;
  7.1865 -                        label.TextAlign = textField.Alignment;
  7.1866 -                    }
  7.1867 -                    else if (aField.IsBitmapField && ctrl is PictureBox)
  7.1868 -                    {
  7.1869 -                        BitmapField bitmapField = (BitmapField) aField;
  7.1870 -                        contentChanged = true; //TODO: Bitmap comp or should we leave that to clients?
  7.1871 -                        //Bitmap field control already in place just change the bitmap
  7.1872 -                        PictureBox pictureBox = (PictureBox) ctrl;
  7.1873 -                        pictureBox.Image = bitmapField.Bitmap;
  7.1874 -                    }
  7.1875 -                    else
  7.1876 -                    {
  7.1877 -                        layoutChanged = true;
  7.1878 -                    }
  7.1879 -                }
  7.1880 -            }
  7.1881 -            else
  7.1882 -            {
  7.1883 -                layoutChanged = true;
  7.1884 -            }
  7.1885 -
  7.1886 -            //If either content or layout changed we need to update our tree view to reflect the changes
  7.1887 -            if (contentChanged || layoutChanged)
  7.1888 -            {
  7.1889 -                UpdateClientTreeViewNode(client);
  7.1890 -                //
  7.1891 -                if (layoutChanged)
  7.1892 -                {
  7.1893 -                    Debug.Print("Layout changed");
  7.1894 -                    //Our layout has changed, if we are already the current client we need to update our panel
  7.1895 -                    if (aSessionId == iCurrentClientSessionId)
  7.1896 -                    {
  7.1897 -                        //Apply layout and set data fields.
  7.1898 -                        UpdateTableLayoutPanel(iCurrentClientData);
  7.1899 -                    }
  7.1900 -                }
  7.1901 -                else
  7.1902 -                {
  7.1903 -                    Debug.Print("Layout has not changed.");
  7.1904 -                }
  7.1905 -            }
  7.1906 -            else
  7.1907 -            {
  7.1908 -                Debug.Print("WARNING: content and layout have not changed!");
  7.1909 -            }
  7.1910 -
  7.1911 -            //When a client field is set we try switching to this client to present the new information to our user
  7.1912 -            SetCurrentClient(aSessionId);
  7.1913 -        }
  7.1914 -
  7.1915 -        /// <summary>
  7.1916 -        ///
  7.1917 -        /// </summary>
  7.1918 -        /// <param name="aTexts"></param>
  7.1919 -        public void SetClientFieldsThreadSafe(string aSessionId, System.Collections.Generic.IList<DataField> aFields)
  7.1920 -        {
  7.1921 -            if (this.InvokeRequired)
  7.1922 -            {
  7.1923 -                //Not in the proper thread, invoke ourselves
  7.1924 -                SetFieldsDelegate d = new SetFieldsDelegate(SetClientFieldsThreadSafe);
  7.1925 -                this.Invoke(d, new object[] {aSessionId, aFields});
  7.1926 -            }
  7.1927 -            else
  7.1928 -            {
  7.1929 -                ClientData client = iClients[aSessionId];
  7.1930 -
  7.1931 -                if (client.HasNewLayout)
  7.1932 -                {
  7.1933 -                    //TODO: Assert client.Count == 0
  7.1934 -                    //Our layout was just changed
  7.1935 -                    //Do some special handling to avoid re-creating our panel N times, once for each fields
  7.1936 -                    client.HasNewLayout = false;
  7.1937 -                    //Just set all our fields then
  7.1938 -                    client.Fields.AddRange(aFields);
  7.1939 -                    //Try switch to that client
  7.1940 -                    SetCurrentClient(aSessionId);
  7.1941 -
  7.1942 -                    //If we are updating the current client update our panel
  7.1943 -                    if (aSessionId == iCurrentClientSessionId)
  7.1944 -                    {
  7.1945 -                        //Apply layout and set data fields.
  7.1946 -                        UpdateTableLayoutPanel(iCurrentClientData);
  7.1947 -                    }
  7.1948 -
  7.1949 -                    UpdateClientTreeViewNode(client);
  7.1950 -                }
  7.1951 -                else
  7.1952 -                {
  7.1953 -                    //Put each our text fields in a label control
  7.1954 -                    foreach (DataField field in aFields)
  7.1955 -                    {
  7.1956 -                        SetClientField(aSessionId, field);
  7.1957 -                    }
  7.1958 -                }
  7.1959 -            }
  7.1960 -        }
  7.1961 -
  7.1962 -        /// <summary>
  7.1963 -        ///
  7.1964 -        /// </summary>
  7.1965 -        /// <param name="aSessionId"></param>
  7.1966 -        /// <param name="aName"></param>
  7.1967 -        public void SetClientNameThreadSafe(string aSessionId, string aName)
  7.1968 -        {
  7.1969 -            if (this.InvokeRequired)
  7.1970 -            {
  7.1971 -                //Not in the proper thread, invoke ourselves
  7.1972 -                SetClientNameDelegate d = new SetClientNameDelegate(SetClientNameThreadSafe);
  7.1973 -                this.Invoke(d, new object[] {aSessionId, aName});
  7.1974 -            }
  7.1975 -            else
  7.1976 -            {
  7.1977 -                //We are in the proper thread
  7.1978 -                //Get our client
  7.1979 -                ClientData client = iClients[aSessionId];
  7.1980 -                if (client != null)
  7.1981 -                {
  7.1982 -                    //Set its name
  7.1983 -                    client.Name = aName;
  7.1984 -                    //Update our tree-view
  7.1985 -                    UpdateClientTreeViewNode(client);
  7.1986 -                }
  7.1987 -            }
  7.1988 -        }
  7.1989 -
  7.1990 -        ///
  7.1991 -        public void SetClientPriorityThreadSafe(string aSessionId, uint aPriority)
  7.1992 -        {
  7.1993 -            if (this.InvokeRequired)
  7.1994 -            {
  7.1995 -                //Not in the proper thread, invoke ourselves
  7.1996 -                SetClientPriorityDelegate d = new SetClientPriorityDelegate(SetClientPriorityThreadSafe);
  7.1997 -                this.Invoke(d, new object[] {aSessionId, aPriority});
  7.1998 -            }
  7.1999 -            else
  7.2000 -            {
  7.2001 -                //We are in the proper thread
  7.2002 -                //Get our client
  7.2003 -                ClientData client = iClients[aSessionId];
  7.2004 -                if (client != null)
  7.2005 -                {
  7.2006 -                    //Set its name
  7.2007 -                    client.Priority = aPriority;
  7.2008 -                    //Update our tree-view
  7.2009 -                    UpdateClientTreeViewNode(client);
  7.2010 -                    //Change our current client as per new priority
  7.2011 -                    ClientData newCurrentClient = FindHighestPriorityClient();
  7.2012 -                    if (newCurrentClient != null)
  7.2013 -                    {
  7.2014 -                        SetCurrentClient(newCurrentClient.SessionId);
  7.2015 -                    }
  7.2016 -                }
  7.2017 -            }
  7.2018 -        }
  7.2019 -
  7.2020 -        /// <summary>
  7.2021 -        /// 
  7.2022 -        /// </summary>
  7.2023 -        /// <param name="value"></param>
  7.2024 -        /// <param name="maxChars"></param>
  7.2025 -        /// <returns></returns>
  7.2026 -        public static string Truncate(string value, int maxChars)
  7.2027 -        {
  7.2028 -            return value.Length <= maxChars ? value : value.Substring(0, maxChars - 3) + "...";
  7.2029 -        }
  7.2030 -
  7.2031 -        /// <summary>
  7.2032 -        /// Update our recording notification.
  7.2033 -        /// </summary>
  7.2034 -        private void UpdateRecordingNotification()
  7.2035 -        {
  7.2036 -            //Go through each 
  7.2037 -            bool activeRecording = false;
  7.2038 -            string text = "";
  7.2039 -            RecordingField recField = new RecordingField();
  7.2040 -            foreach (var client in iClients)
  7.2041 -            {
  7.2042 -                RecordingField rec = (RecordingField) client.Value.FindSameFieldAs(recField);
  7.2043 -                if (rec != null && rec.IsActive)
  7.2044 -                {
  7.2045 -                    activeRecording = true;
  7.2046 -                    //Don't break cause we are collecting the names/texts.
  7.2047 -                    if (!String.IsNullOrEmpty(rec.Text))
  7.2048 -                    {
  7.2049 -                        text += (rec.Text + "\n");
  7.2050 -                    }
  7.2051 -                    else
  7.2052 -                    {
  7.2053 -                        //Not text for that recording, use client name instead
  7.2054 -                        text += client.Value.Name + " recording\n";
  7.2055 -                    }
  7.2056 -
  7.2057 -                }
  7.2058 -            }
  7.2059 -
  7.2060 -            //Update our text no matter what, can't have more than 63 characters otherwise it throws an exception.
  7.2061 -            iRecordingNotification.Text = Truncate(text, 63);
  7.2062 -
  7.2063 -            //Change visibility of notification if needed
  7.2064 -            if (iRecordingNotification.Visible != activeRecording)
  7.2065 -            {
  7.2066 -                iRecordingNotification.Visible = activeRecording;
  7.2067 -                //Assuming the notification icon is in sync with our display icon
  7.2068 -                //Take care of our REC icon
  7.2069 -                if (iDisplay.IsOpen())
  7.2070 -                {
  7.2071 -                    iDisplay.SetIconOnOff(MiniDisplay.IconType.Recording, activeRecording);
  7.2072 -                }
  7.2073 -            }
  7.2074 -        }
  7.2075 -
  7.2076 -        /// <summary>
  7.2077 -        ///
  7.2078 -        /// </summary>
  7.2079 -        /// <param name="aClient"></param>
  7.2080 -        private void UpdateClientTreeViewNode(ClientData aClient)
  7.2081 -        {
  7.2082 -            Debug.Print("UpdateClientTreeViewNode");
  7.2083 -
  7.2084 -            if (aClient == null)
  7.2085 -            {
  7.2086 -                return;
  7.2087 -            }
  7.2088 -
  7.2089 -            //Hook in record icon update too
  7.2090 -            UpdateRecordingNotification();
  7.2091 -
  7.2092 -            TreeNode node = null;
  7.2093 -            //Check that our client node already exists
  7.2094 -            //Get our client root node using its key which is our session ID
  7.2095 -            TreeNode[] nodes = iTreeViewClients.Nodes.Find(aClient.SessionId, false);
  7.2096 -            if (nodes.Count() > 0)
  7.2097 -            {
  7.2098 -                //We already have a node for that client
  7.2099 -                node = nodes[0];
  7.2100 -                //Clear children as we are going to recreate them below
  7.2101 -                node.Nodes.Clear();
  7.2102 -            }
  7.2103 -            else
  7.2104 -            {
  7.2105 -                //Client node does not exists create a new one
  7.2106 -                iTreeViewClients.Nodes.Add(aClient.SessionId, aClient.SessionId);
  7.2107 -                node = iTreeViewClients.Nodes.Find(aClient.SessionId, false)[0];
  7.2108 -            }
  7.2109 -
  7.2110 -            if (node != null)
  7.2111 -            {
  7.2112 -                //Change its name
  7.2113 -                if (!String.IsNullOrEmpty(aClient.Name))
  7.2114 -                {
  7.2115 -                    //We have a name, use it as text for our root node
  7.2116 -                    node.Text = aClient.Name;
  7.2117 -                    //Add a child with SessionId
  7.2118 -                    node.Nodes.Add(new TreeNode(aClient.SessionId));
  7.2119 -                }
  7.2120 -                else
  7.2121 -                {
  7.2122 -                    //No name, use session ID instead
  7.2123 -                    node.Text = aClient.SessionId;
  7.2124 -                }
  7.2125 -
  7.2126 -                //Display client priority
  7.2127 -                node.Nodes.Add(new TreeNode("Priority: " + aClient.Priority));
  7.2128 -
  7.2129 -                if (aClient.Fields.Count > 0)
  7.2130 -                {
  7.2131 -                    //Create root node for our texts
  7.2132 -                    TreeNode textsRoot = new TreeNode("Fields");
  7.2133 -                    node.Nodes.Add(textsRoot);
  7.2134 -                    //For each text add a new entry
  7.2135 -                    foreach (DataField field in aClient.Fields)
  7.2136 -                    {
  7.2137 -                        if (field.IsTextField)
  7.2138 -                        {
  7.2139 -                            TextField textField = (TextField) field;
  7.2140 -                            textsRoot.Nodes.Add(new TreeNode("[Text]" + textField.Text));
  7.2141 -                        }
  7.2142 -                        else if (field.IsBitmapField)
  7.2143 -                        {
  7.2144 -                            textsRoot.Nodes.Add(new TreeNode("[Bitmap]"));
  7.2145 -                        }
  7.2146 -                        else if (field.IsRecordingField)
  7.2147 -                        {
  7.2148 -                            RecordingField recordingField = (RecordingField) field;
  7.2149 -                            textsRoot.Nodes.Add(new TreeNode("[Recording]" + recordingField.IsActive));
  7.2150 -                        }
  7.2151 -                    }
  7.2152 -                }
  7.2153 -
  7.2154 -                node.ExpandAll();
  7.2155 -            }
  7.2156 -        }
  7.2157 -
  7.2158 -        /// <summary>
  7.2159 -        /// Update our table layout row styles to make sure each rows have similar height
  7.2160 -        /// </summary>
  7.2161 -        private void UpdateTableLayoutRowStyles()
  7.2162 -        {
  7.2163 -            foreach (RowStyle rowStyle in iTableLayoutPanel.RowStyles)
  7.2164 -            {
  7.2165 -                rowStyle.SizeType = SizeType.Percent;
  7.2166 -                rowStyle.Height = 100/iTableLayoutPanel.RowCount;
  7.2167 -            }
  7.2168 -        }
  7.2169 -
  7.2170 -        /// <summary>
  7.2171 -        /// Update our display table layout.
  7.2172 -        /// Will instanciated every field control as defined by our client.
  7.2173 -        /// Fields must be specified by rows from the left.
  7.2174 -        /// </summary>
  7.2175 -        /// <param name="aLayout"></param>
  7.2176 -        private void UpdateTableLayoutPanel(ClientData aClient)
  7.2177 -        {
  7.2178 -            Debug.Print("UpdateTableLayoutPanel");
  7.2179 -
  7.2180 -            if (aClient == null)
  7.2181 -            {
  7.2182 -                //Just drop it
  7.2183 -                return;
  7.2184 -            }
  7.2185 -
  7.2186 -
  7.2187 -            TableLayout layout = aClient.Layout;
  7.2188 -
  7.2189 -            //First clean our current panel
  7.2190 -            iTableLayoutPanel.Controls.Clear();
  7.2191 -            iTableLayoutPanel.RowStyles.Clear();
  7.2192 -            iTableLayoutPanel.ColumnStyles.Clear();
  7.2193 -            iTableLayoutPanel.RowCount = 0;
  7.2194 -            iTableLayoutPanel.ColumnCount = 0;
  7.2195 -
  7.2196 -            //Then recreate our rows...
  7.2197 -            while (iTableLayoutPanel.RowCount < layout.Rows.Count)
  7.2198 -            {
  7.2199 -                iTableLayoutPanel.RowCount++;
  7.2200 -            }
  7.2201 -
  7.2202 -            // ...and columns 
  7.2203 -            while (iTableLayoutPanel.ColumnCount < layout.Columns.Count)
  7.2204 -            {
  7.2205 -                iTableLayoutPanel.ColumnCount++;
  7.2206 -            }
  7.2207 -
  7.2208 -            //For each column
  7.2209 -            for (int i = 0; i < iTableLayoutPanel.ColumnCount; i++)
  7.2210 -            {
  7.2211 -                //Create our column styles
  7.2212 -                this.iTableLayoutPanel.ColumnStyles.Add(layout.Columns[i]);
  7.2213 -
  7.2214 -                //For each rows
  7.2215 -                for (int j = 0; j < iTableLayoutPanel.RowCount; j++)
  7.2216 -                {
  7.2217 -                    if (i == 0)
  7.2218 -                    {
  7.2219 -                        //Create our row styles
  7.2220 -                        this.iTableLayoutPanel.RowStyles.Add(layout.Rows[j]);
  7.2221 -                    }
  7.2222 -                    else
  7.2223 -                    {
  7.2224 -                        continue;
  7.2225 -                    }
  7.2226 -                }
  7.2227 -            }
  7.2228 -
  7.2229 -            //For each field
  7.2230 -            foreach (DataField field in aClient.Fields)
  7.2231 -            {
  7.2232 -                if (!field.IsTableField)
  7.2233 -                {
  7.2234 -                    //That field is not taking part in our table layout skip it
  7.2235 -                    continue;
  7.2236 -                }
  7.2237 -
  7.2238 -                TableField tableField = (TableField) field;
  7.2239 -
  7.2240 -                //Create a control corresponding to the field specified for that cell
  7.2241 -                Control control = CreateControlForDataField(tableField);
  7.2242 -
  7.2243 -                //Add newly created control to our table layout at the specified row and column
  7.2244 -                iTableLayoutPanel.Controls.Add(control, tableField.Column, tableField.Row);
  7.2245 -                //Make sure we specify column and row span for that new control
  7.2246 -                iTableLayoutPanel.SetColumnSpan(control, tableField.ColumnSpan);
  7.2247 -                iTableLayoutPanel.SetRowSpan(control, tableField.RowSpan);
  7.2248 -            }
  7.2249 -
  7.2250 -
  7.2251 -            CheckFontHeight();
  7.2252 -        }
  7.2253 -
  7.2254 -        /// <summary>
  7.2255 -        /// Check our type of data field and create corresponding control
  7.2256 -        /// </summary>
  7.2257 -        /// <param name="aField"></param>
  7.2258 -        private Control CreateControlForDataField(DataField aField)
  7.2259 -        {
  7.2260 -            Control control = null;
  7.2261 -            if (aField.IsTextField)
  7.2262 -            {
  7.2263 -                MarqueeLabel label = new SharpDisplayManager.MarqueeLabel();
  7.2264 -                label.AutoEllipsis = true;
  7.2265 -                label.AutoSize = true;
  7.2266 -                label.BackColor = System.Drawing.Color.Transparent;
  7.2267 -                label.Dock = System.Windows.Forms.DockStyle.Fill;
  7.2268 -                label.Location = new System.Drawing.Point(1, 1);
  7.2269 -                label.Margin = new System.Windows.Forms.Padding(0);
  7.2270 -                label.Name = "marqueeLabel" + aField;
  7.2271 -                label.OwnTimer = false;
  7.2272 -                label.PixelsPerSecond = cds.ScrollingSpeedInPixelsPerSecond;
  7.2273 -                label.Separator = cds.Separator;
  7.2274 -                label.MinFontSize = cds.MinFontSize;
  7.2275 -                label.ScaleToFit = cds.ScaleToFit;
  7.2276 -                //control.Size = new System.Drawing.Size(254, 30);
  7.2277 -                //control.TabIndex = 2;
  7.2278 -                label.Font = cds.Font;
  7.2279 -
  7.2280 -                TextField field = (TextField) aField;
  7.2281 -                label.TextAlign = field.Alignment;
  7.2282 -                label.UseCompatibleTextRendering = true;
  7.2283 -                label.Text = field.Text;
  7.2284 -                //
  7.2285 -                control = label;
  7.2286 -            }
  7.2287 -            else if (aField.IsBitmapField)
  7.2288 -            {
  7.2289 -                //Create picture box
  7.2290 -                PictureBox picture = new PictureBox();
  7.2291 -                picture.AutoSize = true;
  7.2292 -                picture.BackColor = System.Drawing.Color.Transparent;
  7.2293 -                picture.Dock = System.Windows.Forms.DockStyle.Fill;
  7.2294 -                picture.Location = new System.Drawing.Point(1, 1);
  7.2295 -                picture.Margin = new System.Windows.Forms.Padding(0);
  7.2296 -                picture.Name = "pictureBox" + aField;
  7.2297 -                //Set our image
  7.2298 -                BitmapField field = (BitmapField) aField;
  7.2299 -                picture.Image = field.Bitmap;
  7.2300 -                //
  7.2301 -                control = picture;
  7.2302 -            }
  7.2303 -            //TODO: Handle recording field?
  7.2304 -
  7.2305 -            return control;
  7.2306 -        }
  7.2307 -
  7.2308 -        /// <summary>
  7.2309 -        /// Called when the user selected a new display type.
  7.2310 -        /// </summary>
  7.2311 -        /// <param name="sender"></param>
  7.2312 -        /// <param name="e"></param>
  7.2313 -        private void comboBoxDisplayType_SelectedIndexChanged(object sender, EventArgs e)
  7.2314 -        {
  7.2315 -            //Store the selected display type in our settings
  7.2316 -            Properties.Settings.Default.CurrentDisplayIndex = comboBoxDisplayType.SelectedIndex;
  7.2317 -            cds.DisplayType = comboBoxDisplayType.SelectedIndex;
  7.2318 -            Properties.Settings.Default.Save();
  7.2319 -
  7.2320 -            //Try re-opening the display connection if we were already connected.
  7.2321 -            //Otherwise just update our status to reflect display type change.
  7.2322 -            if (iDisplay.IsOpen())
  7.2323 -            {
  7.2324 -                OpenDisplayConnection();
  7.2325 -            }
  7.2326 -            else
  7.2327 -            {
  7.2328 -                UpdateStatus();
  7.2329 -            }
  7.2330 -        }
  7.2331 -
  7.2332 -        private void maskedTextBoxTimerInterval_TextChanged(object sender, EventArgs e)
  7.2333 -        {
  7.2334 -            if (maskedTextBoxTimerInterval.Text != "")
  7.2335 -            {
  7.2336 -                int interval = Convert.ToInt32(maskedTextBoxTimerInterval.Text);
  7.2337 -
  7.2338 -                if (interval > 0)
  7.2339 -                {
  7.2340 -                    timer.Interval = interval;
  7.2341 -                    cds.TimerInterval = timer.Interval;
  7.2342 -                    Properties.Settings.Default.Save();
  7.2343 -                }
  7.2344 -            }
  7.2345 -        }
  7.2346 -
  7.2347 -        private void maskedTextBoxMinFontSize_TextChanged(object sender, EventArgs e)
  7.2348 -        {
  7.2349 -            if (maskedTextBoxMinFontSize.Text != "")
  7.2350 -            {
  7.2351 -                int minFontSize = Convert.ToInt32(maskedTextBoxMinFontSize.Text);
  7.2352 -
  7.2353 -                if (minFontSize > 0)
  7.2354 -                {
  7.2355 -                    cds.MinFontSize = minFontSize;
  7.2356 -                    Properties.Settings.Default.Save();
  7.2357 -                    //We need to recreate our layout for that change to take effect
  7.2358 -                    UpdateTableLayoutPanel(iCurrentClientData);
  7.2359 -                }
  7.2360 -            }
  7.2361 -        }
  7.2362 -
  7.2363 -
  7.2364 -        private void maskedTextBoxScrollingSpeed_TextChanged(object sender, EventArgs e)
  7.2365 -        {
  7.2366 -            if (maskedTextBoxScrollingSpeed.Text != "")
  7.2367 -            {
  7.2368 -                int scrollingSpeed = Convert.ToInt32(maskedTextBoxScrollingSpeed.Text);
  7.2369 -
  7.2370 -                if (scrollingSpeed > 0)
  7.2371 -                {
  7.2372 -                    cds.ScrollingSpeedInPixelsPerSecond = scrollingSpeed;
  7.2373 -                    Properties.Settings.Default.Save();
  7.2374 -                    //We need to recreate our layout for that change to take effect
  7.2375 -                    UpdateTableLayoutPanel(iCurrentClientData);
  7.2376 -                }
  7.2377 -            }
  7.2378 -        }
  7.2379 -
  7.2380 -        private void textBoxScrollLoopSeparator_TextChanged(object sender, EventArgs e)
  7.2381 -        {
  7.2382 -            cds.Separator = textBoxScrollLoopSeparator.Text;
  7.2383 -            Properties.Settings.Default.Save();
  7.2384 -
  7.2385 -            //Update our text fields
  7.2386 -            foreach (MarqueeLabel ctrl in iTableLayoutPanel.Controls)
  7.2387 -            {
  7.2388 -                ctrl.Separator = cds.Separator;
  7.2389 -            }
  7.2390 -
  7.2391 -        }
  7.2392 -
  7.2393 -        private void buttonPowerOn_Click(object sender, EventArgs e)
  7.2394 -        {
  7.2395 -            iDisplay.PowerOn();
  7.2396 -        }
  7.2397 -
  7.2398 -        private void buttonPowerOff_Click(object sender, EventArgs e)
  7.2399 -        {
  7.2400 -            iDisplay.PowerOff();
  7.2401 -        }
  7.2402 -
  7.2403 -        private void buttonShowClock_Click(object sender, EventArgs e)
  7.2404 -        {
  7.2405 -            ShowClock();
  7.2406 -        }
  7.2407 -
  7.2408 -        private void buttonHideClock_Click(object sender, EventArgs e)
  7.2409 -        {
  7.2410 -            HideClock();
  7.2411 -        }
  7.2412 -
  7.2413 -        private void buttonUpdate_Click(object sender, EventArgs e)
  7.2414 -        {
  7.2415 -            InstallUpdateSyncWithInfo();
  7.2416 -        }
  7.2417 -
  7.2418 -        /// <summary>
  7.2419 -        /// 
  7.2420 -        /// </summary>
  7.2421 -        void ShowClock()
  7.2422 -        {
  7.2423 -            if (!iDisplay.IsOpen())
  7.2424 -            {
  7.2425 -                return;
  7.2426 -            }
  7.2427 -
  7.2428 -            //Devices like MDM166AA don't support windowing and frame rendering must be stopped while showing our clock
  7.2429 -            iSkipFrameRendering = true;
  7.2430 -            //Clear our screen 
  7.2431 -            iDisplay.Clear();
  7.2432 -            iDisplay.SwapBuffers();
  7.2433 -            //Then show our clock
  7.2434 -            iDisplay.ShowClock();
  7.2435 -        }
  7.2436 -
  7.2437 -        /// <summary>
  7.2438 -        /// 
  7.2439 -        /// </summary>
  7.2440 -        void HideClock()
  7.2441 -        {
  7.2442 -            if (!iDisplay.IsOpen())
  7.2443 -            {
  7.2444 -                return;
  7.2445 -            }
  7.2446 -
  7.2447 -            //Devices like MDM166AA don't support windowing and frame rendering must be stopped while showing our clock
  7.2448 -            iSkipFrameRendering = false;
  7.2449 -            iDisplay.HideClock();
  7.2450 -        }
  7.2451 -
  7.2452 -        private void InstallUpdateSyncWithInfo()
  7.2453 -        {
  7.2454 -            UpdateCheckInfo info = null;
  7.2455 -
  7.2456 -            if (ApplicationDeployment.IsNetworkDeployed)
  7.2457 -            {
  7.2458 -                ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
  7.2459 -
  7.2460 -                try
  7.2461 -                {
  7.2462 -                    info = ad.CheckForDetailedUpdate();
  7.2463 -
  7.2464 -                }
  7.2465 -                catch (DeploymentDownloadException dde)
  7.2466 -                {
  7.2467 -                    MessageBox.Show(
  7.2468 -                        "The new version of the application cannot be downloaded at this time. \n\nPlease check your network connection, or try again later. Error: " +
  7.2469 -                        dde.Message);
  7.2470 -                    return;
  7.2471 -                }
  7.2472 -                catch (InvalidDeploymentException ide)
  7.2473 -                {
  7.2474 -                    MessageBox.Show(
  7.2475 -                        "Cannot check for a new version of the application. The ClickOnce deployment is corrupt. Please redeploy the application and try again. Error: " +
  7.2476 -                        ide.Message);
  7.2477 -                    return;
  7.2478 -                }
  7.2479 -                catch (InvalidOperationException ioe)
  7.2480 -                {
  7.2481 -                    MessageBox.Show(
  7.2482 -                        "This application cannot be updated. It is likely not a ClickOnce application. Error: " +
  7.2483 -                        ioe.Message);
  7.2484 -                    return;
  7.2485 -                }
  7.2486 -
  7.2487 -                if (info.UpdateAvailable)
  7.2488 -                {
  7.2489 -                    Boolean doUpdate = true;
  7.2490 -
  7.2491 -                    if (!info.IsUpdateRequired)
  7.2492 -                    {
  7.2493 -                        DialogResult dr =
  7.2494 -                            MessageBox.Show("An update is available. Would you like to update the application now?",
  7.2495 -                                "Update Available", MessageBoxButtons.OKCancel);
  7.2496 -                        if (!(DialogResult.OK == dr))
  7.2497 -                        {
  7.2498 -                            doUpdate = false;
  7.2499 -                        }
  7.2500 -                    }
  7.2501 -                    else
  7.2502 -                    {
  7.2503 -                        // Display a message that the application MUST reboot. Display the minimum required version.
  7.2504 -                        MessageBox.Show("This application has detected a mandatory update from your current " +
  7.2505 -                                        "version to version " + info.MinimumRequiredVersion.ToString() +
  7.2506 -                                        ". The application will now install the update and restart.",
  7.2507 -                            "Update Available", MessageBoxButtons.OK,
  7.2508 -                            MessageBoxIcon.Information);
  7.2509 -                    }
  7.2510 -
  7.2511 -                    if (doUpdate)
  7.2512 -                    {
  7.2513 -                        try
  7.2514 -                        {
  7.2515 -                            ad.Update();
  7.2516 -                            MessageBox.Show("The application has been upgraded, and will now restart.");
  7.2517 -                            Application.Restart();
  7.2518 -                        }
  7.2519 -                        catch (DeploymentDownloadException dde)
  7.2520 -                        {
  7.2521 -                            MessageBox.Show(
  7.2522 -                                "Cannot install the latest version of the application. \n\nPlease check your network connection, or try again later. Error: " +
  7.2523 -                                dde);
  7.2524 -                            return;
  7.2525 -                        }
  7.2526 -                    }
  7.2527 -                }
  7.2528 -                else
  7.2529 -                {
  7.2530 -                    MessageBox.Show("You are already running the latest version.", "Application up-to-date");
  7.2531 -                }
  7.2532 -            }
  7.2533 -        }
  7.2534 -
  7.2535 -
  7.2536 -        /// <summary>
  7.2537 -        /// Used to
  7.2538 -        /// </summary>
  7.2539 -        private void SysTrayHideShow()
  7.2540 -        {
  7.2541 -            Visible = !Visible;
  7.2542 -            if (Visible)
  7.2543 -            {
  7.2544 -                Activate();
  7.2545 -                WindowState = FormWindowState.Normal;
  7.2546 -            }
  7.2547 -        }
  7.2548 -
  7.2549 -        /// <summary>
  7.2550 -        /// Use to handle minimize events.
  7.2551 -        /// </summary>
  7.2552 -        /// <param name="sender"></param>
  7.2553 -        /// <param name="e"></param>
  7.2554 -        private void MainForm_SizeChanged(object sender, EventArgs e)
  7.2555 -        {
  7.2556 -            if (WindowState == FormWindowState.Minimized && Properties.Settings.Default.MinimizeToTray)
  7.2557 -            {
  7.2558 -                if (Visible)
  7.2559 -                {
  7.2560 -                    SysTrayHideShow();
  7.2561 -                }
  7.2562 -            }
  7.2563 -        }
  7.2564 -
  7.2565 -        /// <summary>
  7.2566 -        /// 
  7.2567 -        /// </summary>
  7.2568 -        /// <param name="sender"></param>
  7.2569 -        /// <param name="e"></param>
  7.2570 -        private void tableLayoutPanel_SizeChanged(object sender, EventArgs e)
  7.2571 -        {
  7.2572 -            //Our table layout size has changed which means our display size has changed.
  7.2573 -            //We need to re-create our bitmap.
  7.2574 -            iCreateBitmap = true;
  7.2575 -        }
  7.2576 -
  7.2577 -        /// <summary>
  7.2578 -        /// 
  7.2579 -        /// </summary>
  7.2580 -        /// <param name="sender"></param>
  7.2581 -        /// <param name="e"></param>
  7.2582 -        private void buttonSelectFile_Click(object sender, EventArgs e)
  7.2583 -        {
  7.2584 -            //openFileDialog1.InitialDirectory = "c:\\";
  7.2585 -            //openFileDialog.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*";
  7.2586 -            //openFileDialog.FilterIndex = 1;
  7.2587 -            openFileDialog.RestoreDirectory = true;
  7.2588 -
  7.2589 -            if (DlgBox.ShowDialog(openFileDialog) == DialogResult.OK)
  7.2590 -            {
  7.2591 -                labelStartFileName.Text = openFileDialog.FileName;
  7.2592 -                Properties.Settings.Default.StartFileName = openFileDialog.FileName;
  7.2593 -                Properties.Settings.Default.Save();
  7.2594 -            }
  7.2595 -        }
  7.2596 -
  7.2597 -        /// <summary>
  7.2598 -        /// 
  7.2599 -        /// </summary>
  7.2600 -        /// <param name="sender"></param>
  7.2601 -        /// <param name="e"></param>
  7.2602 -        private void comboBoxOpticalDrives_SelectedIndexChanged(object sender, EventArgs e)
  7.2603 -        {
  7.2604 -            //Save the optical drive the user selected for ejection
  7.2605 -            Properties.Settings.Default.OpticalDriveToEject = comboBoxOpticalDrives.SelectedItem.ToString();
  7.2606 -            Properties.Settings.Default.Save();
  7.2607 -        }
  7.2608 -
  7.2609 -
  7.2610 -        /// <summary>
  7.2611 -        /// 
  7.2612 -        /// </summary>
  7.2613 -        private void LogsUpdate()
  7.2614 -        {
  7.2615 -            if (iWriter != null)
  7.2616 -            {
  7.2617 -                iWriter.Flush();
  7.2618 -            }
  7.2619 -
  7.2620 -        }
  7.2621 -
  7.2622 -        /// <summary>
  7.2623 -        /// Broadcast messages to subscribers.
  7.2624 -        /// </summary>
  7.2625 -        /// <param name="message"></param>
  7.2626 -        protected override void WndProc(ref Message aMessage)
  7.2627 -        {
  7.2628 -            LogsUpdate();
  7.2629 -
  7.2630 -            if (OnWndProc != null)
  7.2631 -            {
  7.2632 -                OnWndProc(ref aMessage);
  7.2633 -            }
  7.2634 -
  7.2635 -            base.WndProc(ref aMessage);
  7.2636 -        }
  7.2637 -
  7.2638 -        private void checkBoxCecEnabled_CheckedChanged(object sender, EventArgs e)
  7.2639 -        {
  7.2640 -            //Save CEC enabled status
  7.2641 -            Properties.Settings.Default.CecEnabled = checkBoxCecEnabled.Checked;
  7.2642 -            Properties.Settings.Default.Save();
  7.2643 -            //
  7.2644 -            ResetCec();
  7.2645 -        }
  7.2646 -
  7.2647 -        private void comboBoxHdmiPort_SelectedIndexChanged(object sender, EventArgs e)
  7.2648 -        {
  7.2649 -            //Save CEC HDMI port
  7.2650 -            Properties.Settings.Default.CecHdmiPort = Convert.ToByte(comboBoxHdmiPort.SelectedIndex);
  7.2651 -            Properties.Settings.Default.CecHdmiPort++;
  7.2652 -            Properties.Settings.Default.Save();
  7.2653 -            //
  7.2654 -            ResetCec();
  7.2655 -        }
  7.2656 -
  7.2657 -        /// <summary>
  7.2658 -        /// 
  7.2659 -        /// </summary>
  7.2660 -        private void ResetCec()
  7.2661 -        {
  7.2662 -            if (iCecManager == null)
  7.2663 -            {
  7.2664 -                //Thus skipping initial UI setup
  7.2665 -                return;
  7.2666 -            }
  7.2667 -
  7.2668 -            iCecManager.Stop();
  7.2669 -            //
  7.2670 -            if (Properties.Settings.Default.CecEnabled)
  7.2671 -            {
  7.2672 -                iCecManager.Start(Handle, "CEC",
  7.2673 -                    Properties.Settings.Default.CecHdmiPort);
  7.2674 -
  7.2675 -                SetupCecLogLevel();
  7.2676 -            }
  7.2677 -        }
  7.2678 -
  7.2679 -        /// <summary>
  7.2680 -        /// 
  7.2681 -        /// </summary>
  7.2682 -        private void SetupCecLogLevel()
  7.2683 -        {
  7.2684 -            //Setup log level
  7.2685 -            iCecManager.Client.LogLevel = 0;
  7.2686 -
  7.2687 -            if (checkBoxCecLogError.Checked)
  7.2688 -                iCecManager.Client.LogLevel |= (int) CecLogLevel.Error;
  7.2689 -
  7.2690 -            if (checkBoxCecLogWarning.Checked)
  7.2691 -                iCecManager.Client.LogLevel |= (int) CecLogLevel.Warning;
  7.2692 -
  7.2693 -            if (checkBoxCecLogNotice.Checked)
  7.2694 -                iCecManager.Client.LogLevel |= (int) CecLogLevel.Notice;
  7.2695 -
  7.2696 -            if (checkBoxCecLogTraffic.Checked)
  7.2697 -                iCecManager.Client.LogLevel |= (int) CecLogLevel.Traffic;
  7.2698 -
  7.2699 -            if (checkBoxCecLogDebug.Checked)
  7.2700 -                iCecManager.Client.LogLevel |= (int) CecLogLevel.Debug;
  7.2701 -
  7.2702 -            iCecManager.Client.FilterOutPollLogs = checkBoxCecLogNoPoll.Checked;
  7.2703 -
  7.2704 -        }
  7.2705 -
  7.2706 -        private void ButtonStartIdleClient_Click(object sender, EventArgs e)
  7.2707 -        {
  7.2708 -            StartIdleClient();
  7.2709 -        }
  7.2710 -
  7.2711 -        private void buttonClearLogs_Click(object sender, EventArgs e)
  7.2712 -        {
  7.2713 -            richTextBoxLogs.Clear();
  7.2714 -        }
  7.2715 -
  7.2716 -        private void checkBoxCecLogs_CheckedChanged(object sender, EventArgs e)
  7.2717 -        {
  7.2718 -            SetupCecLogLevel();
  7.2719 -        }
  7.2720 -
  7.2721 -
  7.2722 -        /// <summary>
  7.2723 -        /// 
  7.2724 -        /// </summary>
  7.2725 -        /// <param name="aEvent"></param>
  7.2726 -        private void SelectEvent(Event aEvent)
  7.2727 -        {
  7.2728 -            if (aEvent == null)
  7.2729 -            {
  7.2730 -                return;
  7.2731 -            }
  7.2732 -
  7.2733 -            string key = aEvent.GetType().Name;
  7.2734 -            TreeNode[] res = iTreeViewEvents.Nodes.Find(key, false);
  7.2735 -            if (res.Length > 0)
  7.2736 -            {
  7.2737 -                iTreeViewEvents.SelectedNode = res[0];
  7.2738 -                iTreeViewEvents.Focus();
  7.2739 -            }
  7.2740 -        }
  7.2741 -
  7.2742 -
  7.2743 -
  7.2744 -        /// <summary>
  7.2745 -        /// Get the current event based on event tree view selection.
  7.2746 -        /// </summary>
  7.2747 -        /// <returns></returns>
  7.2748 -        private Event CurrentEvent()
  7.2749 -        {
  7.2750 -            //Walk up the tree from the selected node to find our event
  7.2751 -            TreeNode node = iTreeViewEvents.SelectedNode;
  7.2752 -            Event selectedEvent = null;
  7.2753 -            while (node != null)
  7.2754 -            {
  7.2755 -                if (node.Tag is Event)
  7.2756 -                {
  7.2757 -                    selectedEvent = (Event) node.Tag;
  7.2758 -                    break;
  7.2759 -                }
  7.2760 -                node = node.Parent;
  7.2761 -            }
  7.2762 -
  7.2763 -            return selectedEvent;
  7.2764 -        }
  7.2765 -
  7.2766 -        /// <summary>
  7.2767 -        /// Get the current action based on event tree view selection
  7.2768 -        /// </summary>
  7.2769 -        /// <returns></returns>
  7.2770 -        private SharpLib.Ear.Action CurrentAction()
  7.2771 -        {
  7.2772 -            TreeNode node = iTreeViewEvents.SelectedNode;
  7.2773 -            if (node != null && node.Tag is SharpLib.Ear.Action)
  7.2774 -            {
  7.2775 -                return (SharpLib.Ear.Action) node.Tag;
  7.2776 -            }
  7.2777 -
  7.2778 -            return null;
  7.2779 -        }
  7.2780 -
  7.2781 -        /// <summary>
  7.2782 -        /// 
  7.2783 -        /// </summary>
  7.2784 -        /// <param name="sender"></param>
  7.2785 -        /// <param name="e"></param>
  7.2786 -        private void buttonAddAction_Click(object sender, EventArgs e)
  7.2787 -        {
  7.2788 -            Event selectedEvent = CurrentEvent();
  7.2789 -            if (selectedEvent == null)
  7.2790 -            {
  7.2791 -                //We did not find a corresponding event
  7.2792 -                return;
  7.2793 -            }
  7.2794 -
  7.2795 -            FormEditAction ea = new FormEditAction();
  7.2796 -            DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
  7.2797 -            if (res == DialogResult.OK)
  7.2798 -            {
  7.2799 -                selectedEvent.Actions.Add(ea.Action);
  7.2800 -                Properties.Settings.Default.Actions = ManagerEventAction.Current;
  7.2801 -                Properties.Settings.Default.Save();
  7.2802 -                PopulateEventsTreeView();
  7.2803 -            }
  7.2804 -        }
  7.2805 -
  7.2806 -        /// <summary>
  7.2807 -        /// 
  7.2808 -        /// </summary>
  7.2809 -        /// <param name="sender"></param>
  7.2810 -        /// <param name="e"></param>
  7.2811 -        private void buttonDeleteAction_Click(object sender, EventArgs e)
  7.2812 -        {
  7.2813 -
  7.2814 -            SharpLib.Ear.Action action = CurrentAction();
  7.2815 -            if (action == null)
  7.2816 -            {
  7.2817 -                //Must select action node
  7.2818 -                return;
  7.2819 -            }
  7.2820 -
  7.2821 -            ManagerEventAction.Current.RemoveAction(action);
  7.2822 -            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  7.2823 -            Properties.Settings.Default.Save();
  7.2824 -            PopulateEventsTreeView();
  7.2825 -        }
  7.2826 -
  7.2827 -        private void iTreeViewEvents_AfterSelect(object sender, TreeViewEventArgs e)
  7.2828 -        {
  7.2829 -            //Enable buttons according to selected item
  7.2830 -            buttonAddAction.Enabled = CurrentEvent() != null;
  7.2831 -
  7.2832 -            SharpLib.Ear.Action currentAction = CurrentAction();
  7.2833 -            //If an action is selected enable the following buttons
  7.2834 -            buttonTestAction.Enabled =
  7.2835 -            buttonDeleteAction.Enabled =
  7.2836 -            buttonActionMoveUp.Enabled =
  7.2837 -            buttonActionMoveDown.Enabled =
  7.2838 -                    currentAction != null;
  7.2839 -    
  7.2840 -            if (currentAction != null)
  7.2841 -            {
  7.2842 -                //If an action is selected enable move buttons if needed
  7.2843 -                buttonActionMoveUp.Enabled = iTreeViewEvents.SelectedNode.Index != 0;
  7.2844 -                buttonActionMoveDown.Enabled = iTreeViewEvents.SelectedNode.Index <
  7.2845 -                                               iTreeViewEvents.SelectedNode.Parent.Nodes.Count - 1;
  7.2846 -            }
  7.2847 -
  7.2848 -        }
  7.2849 -
  7.2850 -        /// <summary>
  7.2851 -        /// 
  7.2852 -        /// </summary>
  7.2853 -        /// <param name="sender"></param>
  7.2854 -        /// <param name="e"></param>
  7.2855 -        private void buttonTestAction_Click(object sender, EventArgs e)
  7.2856 -        {
  7.2857 -            SharpLib.Ear.Action a = CurrentAction();
  7.2858 -            if (a != null)
  7.2859 -            {
  7.2860 -                Console.WriteLine("Action test run");
  7.2861 -                a.Execute();
  7.2862 -            }
  7.2863 -            iTreeViewEvents.Focus();
  7.2864 -        }
  7.2865 -
  7.2866 -        /// <summary>
  7.2867 -        /// 
  7.2868 -        /// </summary>
  7.2869 -        /// <param name="sender"></param>
  7.2870 -        /// <param name="e"></param>
  7.2871 -        private void buttonActionMoveUp_Click(object sender, EventArgs e)
  7.2872 -        {
  7.2873 -            SharpLib.Ear.Action a = CurrentAction();
  7.2874 -            if (a == null || 
  7.2875 -                //Action already at the top of the list
  7.2876 -                iTreeViewEvents.SelectedNode.Index == 0)
  7.2877 -            {
  7.2878 -                return;
  7.2879 -            }
  7.2880 -
  7.2881 -            //Swap actions in event's action list
  7.2882 -            Event currentEvent = CurrentEvent();
  7.2883 -            int currentIndex = iTreeViewEvents.SelectedNode.Index;
  7.2884 -            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex];
  7.2885 -            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex-1];
  7.2886 -            currentEvent.Actions[currentIndex] = movingDown;
  7.2887 -            currentEvent.Actions[currentIndex-1] = movingUp;
  7.2888 -
  7.2889 -            //Save and populate our tree again
  7.2890 -            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  7.2891 -            Properties.Settings.Default.Save();
  7.2892 -            PopulateEventsTreeView();
  7.2893 -
  7.2894 -        }
  7.2895 -
  7.2896 -        /// <summary>
  7.2897 -        /// 
  7.2898 -        /// </summary>
  7.2899 -        /// <param name="sender"></param>
  7.2900 -        /// <param name="e"></param>
  7.2901 -        private void buttonActionMoveDown_Click(object sender, EventArgs e)
  7.2902 -        {
  7.2903 -            SharpLib.Ear.Action a = CurrentAction();
  7.2904 -            if (a == null ||
  7.2905 -                //Action already at the bottom of the list
  7.2906 -                iTreeViewEvents.SelectedNode.Index == iTreeViewEvents.SelectedNode.Parent.Nodes.Count - 1)
  7.2907 -            {
  7.2908 -                return;
  7.2909 -            }
  7.2910 -
  7.2911 -            //Swap actions in event's action list
  7.2912 -            Event currentEvent = CurrentEvent();
  7.2913 -            int currentIndex = iTreeViewEvents.SelectedNode.Index;
  7.2914 -            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex];
  7.2915 -            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex + 1];
  7.2916 -            currentEvent.Actions[currentIndex] = movingUp;
  7.2917 -            currentEvent.Actions[currentIndex + 1] = movingDown;
  7.2918 -
  7.2919 -            //Save and populate our tree again
  7.2920 -            Properties.Settings.Default.Actions = ManagerEventAction.Current;
  7.2921 -            Properties.Settings.Default.Save();
  7.2922 -            PopulateEventsTreeView();
  7.2923 -        }
  7.2924 -    }
  7.2925 -}
     8.1 --- a/Server/MainForm.resx	Thu Jul 28 19:32:40 2016 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,418 +0,0 @@
     8.4 -<?xml version="1.0" encoding="utf-8"?>
     8.5 -<root>
     8.6 -  <!-- 
     8.7 -    Microsoft ResX Schema 
     8.8 -    
     8.9 -    Version 2.0
    8.10 -    
    8.11 -    The primary goals of this format is to allow a simple XML format 
    8.12 -    that is mostly human readable. The generation and parsing of the 
    8.13 -    various data types are done through the TypeConverter classes 
    8.14 -    associated with the data types.
    8.15 -    
    8.16 -    Example:
    8.17 -    
    8.18 -    ... ado.net/XML headers & schema ...
    8.19 -    <resheader name="resmimetype">text/microsoft-resx</resheader>
    8.20 -    <resheader name="version">2.0</resheader>
    8.21 -    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    8.22 -    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    8.23 -    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    8.24 -    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    8.25 -    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    8.26 -        <value>[base64 mime encoded serialized .NET Framework object]</value>
    8.27 -    </data>
    8.28 -    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    8.29 -        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    8.30 -        <comment>This is a comment</comment>
    8.31 -    </data>
    8.32 -                
    8.33 -    There are any number of "resheader" rows that contain simple 
    8.34 -    name/value pairs.
    8.35 -    
    8.36 -    Each data row contains a name, and value. The row also contains a 
    8.37 -    type or mimetype. Type corresponds to a .NET class that support 
    8.38 -    text/value conversion through the TypeConverter architecture. 
    8.39 -    Classes that don't support this are serialized and stored with the 
    8.40 -    mimetype set.
    8.41 -    
    8.42 -    The mimetype is used for serialized objects, and tells the 
    8.43 -    ResXResourceReader how to depersist the object. This is currently not 
    8.44 -    extensible. For a given mimetype the value must be set accordingly:
    8.45 -    
    8.46 -    Note - application/x-microsoft.net.object.binary.base64 is the format 
    8.47 -    that the ResXResourceWriter will generate, however the reader can 
    8.48 -    read any of the formats listed below.
    8.49 -    
    8.50 -    mimetype: application/x-microsoft.net.object.binary.base64
    8.51 -    value   : The object must be serialized with 
    8.52 -            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    8.53 -            : and then encoded with base64 encoding.
    8.54 -    
    8.55 -    mimetype: application/x-microsoft.net.object.soap.base64
    8.56 -    value   : The object must be serialized with 
    8.57 -            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
    8.58 -            : and then encoded with base64 encoding.
    8.59 -
    8.60 -    mimetype: application/x-microsoft.net.object.bytearray.base64
    8.61 -    value   : The object must be serialized into a byte array 
    8.62 -            : using a System.ComponentModel.TypeConverter
    8.63 -            : and then encoded with base64 encoding.
    8.64 -    -->
    8.65 -  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    8.66 -    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    8.67 -    <xsd:element name="root" msdata:IsDataSet="true">
    8.68 -      <xsd:complexType>
    8.69 -        <xsd:choice maxOccurs="unbounded">
    8.70 -          <xsd:element name="metadata">
    8.71 -            <xsd:complexType>
    8.72 -              <xsd:sequence>
    8.73 -                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    8.74 -              </xsd:sequence>
    8.75 -              <xsd:attribute name="name" use="required" type="xsd:string" />
    8.76 -              <xsd:attribute name="type" type="xsd:string" />
    8.77 -              <xsd:attribute name="mimetype" type="xsd:string" />
    8.78 -              <xsd:attribute ref="xml:space" />
    8.79 -            </xsd:complexType>
    8.80 -          </xsd:element>
    8.81 -          <xsd:element name="assembly">
    8.82 -            <xsd:complexType>
    8.83 -              <xsd:attribute name="alias" type="xsd:string" />
    8.84 -              <xsd:attribute name="name" type="xsd:string" />
    8.85 -            </xsd:complexType>
    8.86 -          </xsd:element>
    8.87 -          <xsd:element name="data">
    8.88 -            <xsd:complexType>
    8.89 -              <xsd:sequence>
    8.90 -                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    8.91 -                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    8.92 -              </xsd:sequence>
    8.93 -              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    8.94 -              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    8.95 -              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    8.96 -              <xsd:attribute ref="xml:space" />
    8.97 -            </xsd:complexType>
    8.98 -          </xsd:element>
    8.99 -          <xsd:element name="resheader">
   8.100 -            <xsd:complexType>
   8.101 -              <xsd:sequence>
   8.102 -                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   8.103 -              </xsd:sequence>
   8.104 -              <xsd:attribute name="name" type="xsd:string" use="required" />
   8.105 -            </xsd:complexType>
   8.106 -          </xsd:element>
   8.107 -        </xsd:choice>
   8.108 -      </xsd:complexType>
   8.109 -    </xsd:element>
   8.110 -  </xsd:schema>
   8.111 -  <resheader name="resmimetype">
   8.112 -    <value>text/microsoft-resx</value>
   8.113 -  </resheader>
   8.114 -  <resheader name="version">
   8.115 -    <value>2.0</value>
   8.116 -  </resheader>
   8.117 -  <resheader name="reader">
   8.118 -    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   8.119 -  </resheader>
   8.120 -  <resheader name="writer">
   8.121 -    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   8.122 -  </resheader>
   8.123 -  <metadata name="fontDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   8.124 -    <value>17, 17</value>
   8.125 -  </metadata>
   8.126 -  <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   8.127 -    <value>126, 17</value>
   8.128 -  </metadata>
   8.129 -  <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   8.130 -    <value>206, 17</value>
   8.131 -  </metadata>
   8.132 -  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   8.133 -    <value>315, 17</value>
   8.134 -  </metadata>
   8.135 -  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   8.136 -  <data name="pictureBoxGreenStart.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   8.137 -    <value>
   8.138 -        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAC45JREFUWEd9
   8.139 -        lgdYVUcaho8l+Ohq1FWwETR2TSJIiRpsQEQEgiDVRkeqgoj0cvEiICASuYgKdhGJ2BAJKmKLLUaxoy4W
   8.140 -        0ICiWFcwbrLvzsGymrB7nue9d+7cmf/75p9yRuJ1yH+B/0kfG0ld4CEoFjQK6GunRl97NeSy4HfBfkGw
   8.141 -        QKulGO/5QPOjHy01FsGGCzK17NowYHpHBjh3QS+gP45KM2xijZpxEuVRcwczYHYXBszoJIx9IhtaJ/i6
   8.142 -        pZgfan70488NRYAkWXiIWxeMQ3RYmO1N7p4Mth/aRP6BXPL3v0WUC8s3sqZ4OcEqd3Tm9GGwaxf62Tcb
   8.143 -        WSro/FHsDzTfF/79238NiA5afayllUOcO2EUOoLU/Gi2la//WLQFtrz93vhjNnMzZqLvq8kwYV7E2vBh
   8.144 -        NvQ92n1sQBZvrnwj/pUsPsKrK25LvmPTjytYv1fFuuLMj9n7J/7yv4r1JarmGCO8uvGZbWvZiOU7A+9M
   8.145 -        NH/83rTgvYHeU6VVej7qeKVZs2pXKqptiW8oTHrD9iSydrSAqH/fRrTPfNsve2cKXqnW6PtpoDmtlTwl
   8.146 -        n39kQB79y2eBzRXC4XIdz66YhX5J6pYokjaEvWFTGMmbw1lZsIg9u1Qc2LOSwp1LUW2NIyU/gpQtb1iS
   8.147 -        F96M3DZpYxiJoq/Mkk2RmIfqoC8GJg/wnQFZW/pXU7B0v9ZXFrccNqsDhvN64p/uSES2TzORq3yIzvHj
   8.148 -        eGEWz0u287RwLc+25fCiaAMvDmzjzLZ00tfNI3adLzFrBWt8icr1IWq16L/Sh/AsGW98U20Z5aeOttun
   8.149 -        sgl/2cDrxmBJanweKFVccZVTXzpxfm8MvLrjl+qAT6q9MOLA3O8dUap8qE+P40GcD/cX2lEfacejODse
   8.150 -        p7jwSGlHTpojqqKFhOc6Mz/LiSDBvEwnApY54pvmIMQd8UmxQ9+jOyYhfd5NRZt/Pg2UpIZ6f6m3lWQ0
   8.151 -        wrUTE+f3Eo00cE6YgmviFNxTLfBMsyQrxYP6Rb48CDLnYagpj2NNeZZkypNlltRmOxGYZkV5pZIj1zJZ
   8.152 -        XRpO3EZ3woSZmHVzyNwRR95BFc7x5hi492BsgAajvLshNF3r6/wkqabaWx59oVmYJqN8uqLj2h372PHM
   8.153 -        UE5kdrIRLikmHFjixUPFbOqDxvEkxpAXKYY0qgx5st6MEzkWhOaasuuyFdsv2FB8MYD9lxdz4OJyyi6s
   8.154 -        ofhMNvOWz8Q2fLyIrY6+Z2csIvvK03Dy5k0vSd52alpii9gp+qPn8SnDZv6NqVEG2MaPwil5DI6JY6hS
   8.155 -        uvMwwpLHYiG9SNahMUuHpvW6PNrxLdmZE0jfa8y+Kkt+uKTDhjM6ZB/VI/OAMbnlXuSdzsBRMQWLBfoM
   8.156 -        FaektsvfsI7+nAGOn9D7O6mbnH5DPc9PsYnui657RwbOUMM0dChTFdrYJY3ESzmeu5H2VC6y4mrubKq2
   8.157 -        TKN2mxGPi8ZQV27CnAQ9dlc6cPCuDbtujGTLhcHknvqCnKMmbD4xj7S90UwJ1sN43hAGOrXjq9kdsAzX
   8.158 -        ZFyA2BFW0kxJuAgwXdBTuNJC16MTw1zbMzpIHcv4YVgnDUeRaEFCpCMhSgdcIybiHTOZmMTZFG7z4/Ax
   8.159 -        O9wzDDn+IJhDdY4U3/6GgqsD2XB2KJtOTWbruQg8ltljHDxEnIo9GDyrPV+4dBRbsg9WkVpyBlKlXpZS
   8.160 -        gnWUFrYxWuh7dxanVkcMgjpjquiLVdJA7JaYEZC7lNDtpcQdvk50aRmBG5VMjR6Jb/LXxOy259jzJRxu
   8.161 -        8KO0xojCa4PYXDGY/Ipp5F9OZFLEaMaFaKLj15nhYguOcO/Cd2GfMX3RANlAntTLQvreKb4/TvGfMzqg
   8.162 -        G7oBXTEME9tF2QOL5H54rz7JjLW3GL26Du28F0zb/5pll/7NussNzFg2AZulX+Jf7kzGg6Xk3I8kq9qZ
   8.163 -        lBtexF1ahMsOT4wiBjEmTJ2vF2ig7dMN+ZS1ie6Ha9IQxOB3Sj2nSIsd4/rhsWQ440N6MSqkJ0YKTcxS
   8.164 -        BPGm6Icfp3PQWdTi7qD2/VM0N7/CfP8fRPzSiEumPsfPf4+/aiJjg3tirBzCpOUjGa8YxDdBPXCKG4ZR
   8.165 -        nIin1MRQZFkvSFPUf8asxcNwSxYGLEQGek6W/KeKRRGUpceU2AGiQ3/MUwdildEfs5hoRgYforXXCaSw
   8.166 -        G0gpD+mQ08jIon9hs30/SfkTePF4DfW1q7helcnOQ3NZX+RM6ZFwqi6pUC0bheWyz7FYNhjjxUMZGzUE
   8.167 -        k8ihBGSOEefMEMTgl0saRpLJOP+/k5Bnwow0PSxStZm2YiR2WV8yIbCAvu4lSLPLkQIvIsXfQxJZ6Jn/
   8.168 -        CqPsCEqPWvD6YTivH3jSVOvCizuzefoPL17eWMijqwkEJw3GdtVwbFfrYp5hwKQkfaYlGaDYZI6VGHSP
   8.169 -        SZKHpNZN6vSZbStUu60I32zN9OyxzFg3jpmZDox03UZ7yy1IdnuRvE4ihV6ndVId7XKe4aAyorbSilf3
   8.170 -        nHhVbU7TTWOaro2j6YoVjZVBVJbNZ/rSoczabMCsvInYr5mEjepb5q61JqvYUZwJ7ej8ldRPEk8bkYrd
   8.171 -        MWsnsGKfD76bzfEqMMdCqWTQnB8YGLkHneSj9Es4Sff4C7RffBON9OOkF+jyonIyTZXf0HR1FI0X9Wg8
   8.172 -        a8Crs1N5eimcPbk2uGzQxb/oW7x3W+O61R63jbYsKwkgtcBCnv8zQltN+uPVAqnbGMnSOLAXO88sJKnU
   8.173 -        g7m77ES6YhmX4Mbk5MlYpY3FLM0ew4wEhqw4zVhVGvt2fkHjL2NpPDWMxpNDaTw6mMbD4oT8yYaGszGk
   8.174 -        pYwmsMiEsKOOzD/kztySOUQX+1BwOhrH2MGoT5T8hYFWb97JktRJZOFUdvEstp9ToChzI3iPHcG7LYgs
   8.175 -        MUNROgVliSmxO40J3WpGaKEDx8r0qDxiTPXBr2n4cRDPi/rytFiX2iMenD+ySLyOJxB7zIH4c77E/ryA
   8.176 -        2MPzyTujJO+wf/PtqG1HqXuzdvOtRJJadx8neY72VudkVQYF5xWkn/Yh84Ifa675knfDmx+q5lB43ZPt
   8.177 -        lZ78cNGN7HJrVpZZsvWEM3tP+PLjT+IgOhHJun0ixYU2KPZNI/2yPxnXoki9EM3GC4s5cTMb84X95dEr
   8.178 -        hGbb91eytyY69vhWKpip1OXCvTUUVcaT948QCmvC2FsXRnl9OMcbIvnlWTRnHkdz8M58CircWHnYjtQS
   8.179 -        C5Q7TVEIFhVbsPTYdFZdnsva29HkVCnIv5bIzzVrCFkxCQ0TabfQ6vL+SvaBgVYCDQ1jqTRWrNSrdesp
   8.180 -        uymuYLdCKBMn3MnHcZx/qaTyVSJVvyVxU3Dl+SJ+eRjFsV9DOSAMldwOouhOMLuE6cKaKLbeiqb4ZiIV
   8.181 -        tetZXewrix9p110aKHTa/MWAXCGeth36StoiRWVxa+2pbtjGz9UpHLodwnGRhYoncVx7mcCt35Kp+T2F
   8.182 -        u3+kUiO4LcqVTYmcf67k+KM4yn6NoORWGMfuLKHqYQGqHb7Ir/y/G0i2QuMTWatFA29NqLXvLWmLA+qA
   8.183 -        Q6weV6sLuFW/iYoaJafvBnOubiGXH0VS+TSG60/juP4sjitPYql4GMHp2lB+qg7m1B0FN+5v4Ob9IvzS
   8.184 -        TeU5PyT2vKWI3e6dzl8M/NmEQEsszPX97NuKFe3E3fpS6p+VcOtBDlfuJXJBpLmiJpBz1fOoqA7l0j0l
   8.185 -        VfdXU/ekmNqGMtLyfRk0vT3q46VCEat/S+J/MfAh4mkj6NqmvWQgjOyUUzgj/htWF4Xxc+UW7j44yD+b
   8.186 -        zjVzv+Eop0Xd5v0KXBZPELeddog+JR20JHMRQ13QvOJbosXKDxGPnA2N1p9IOl20pRj1CVJ5TzPpnrjN
   8.187 -        vBTXOfl2K99sXom6X8W0neiiIyW07SSNEX16CeR0tmop7jtarGwJ8bQVdBL0EQwSfCEYIdAWfPm2TlPQ
   8.188 -        WSC3/b/CbwiR/gNzbuWksIMBOAAAAABJRU5ErkJggg==
   8.189 -</value>
   8.190 -  </data>
   8.191 -  <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   8.192 -    <value>405, 17</value>
   8.193 -  </metadata>
   8.194 -  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   8.195 -    <value>
   8.196 -        AAABAAEAgIAAAAEAIAADNAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAACAAAAAgAgGAAAAwz5hywAAIABJ
   8.197 -        REFUeJztvXmUHGd99/upvXqv7hntGo1GsrxhW5sxGO82JixeMAbCEogTkjcJCbz38uYcbnKTc+V7wj2H
   8.198 -        vCE3yTnk5YQkhBvekIVgMAFDvMjyvkiyJMuyjSWNpNHMaLbuqurq7tqf+0dN98xINrGxcIC3v+f06e7p
   8.199 -        qurq5/t7fvvzDPTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx99
   8.200 -        9NFHH3300UcfZwt/8Od/Ij7wmU+JN+r7pDfqi/p4ZWy66WZhN1zoJEgiQFETNq1awUN33/MT56cvAG8g
   8.201 -        /vDL/yge2HcQAh/n1BxTE2OkYQyA1FYAH13ykXAY2nApv/yBm/mt//LRnyhHfQH4CeIP/vrrot30+Pp3
   8.202 -        H0B4LmrTwe8IQpEiBQKRzFFQQCosh9QH2SRMQJd8SprMslUWj+y8ty8APyt4+2/+H+LkXAPJdnDr0wjb
   8.203 -        QXRc0qjZO0bWSrQSSEspAJXERMjmGdeKQpnBlQNcedklfPmLf/wT46kvAD8mfu3OPxYAxybrPL9nP2Hb
   8.204 -        RfN9pNQnDcIzSM8p0Emy95GZovly9pmhU1JiXGkQKbYBegIRhTJWxeLKW6/nK5/7vZ8IV30BeA0YuuYq
   8.205 -        EbdbiDBGcRNibw5ZK5FGTWSttORYOScwQolOAjkFAlUnDUIqeZlmolI08kixi1wZACBpRQB4Qbt3DSGb
   8.206 -        RIbPslyFX/7wh/js7376rPOlnu0L/jzgc1/6onhy/zMAjP9wlFPHjpN2JMJDL/WOieEVyQcwwoyrSj6b
   8.207 -        6Tox5GVKZoES4Ga+HwXAbUVIsQtASYFmktEipT4087TkhG8+/dxP5Lf+L68B/vvffVmEfojb8vjK176B
   8.208 -        CNoI30dptnrHnE50ToGW36RaVnA6+SXqvavSAYRapqwmSIYPgIcFQOrMUaoM0AKENIuwJYRaRiloQKYN
   8.209 -        uppAyCaRgMGBZXz8fVfye7/3B2eVs/8lBeCW3/o1MTU1RbM+g3O8SSTXkdyXz710yS+YJVr+ghCcLhBa
   8.210 -        wUIpaBSAFix5BpCNIqWcwoTtkDpzyJWB3mddUUtaEXJpgFQpgz1KM0pBNiH1KeRqvP/Wq/nw7e/mkm3b
   8.211 -        zxpvP/cm4LNf+LwAeOnFWR7e/TgEgsd/8Ayqn6ncNGoiwRlqPMl5SK4gJ3t0tIz8LjK1XiGvgaIUaPot
   8.212 -        SvOzl8AHI3PiVlsV/DSm7rYo5ZukXkoBBSoDJO05WvkBVlsVqnoJx7GRajVEq46dAtYIzByB1CcS0OrU
   8.213 -        ufexJxleUzur4/NzqQEu3P420ZB9aHvQOHNmS4XlRH6IZuq9+Js0U9NRmNlsNbHPcNhKZjZnk6SFohRw
   8.214 -        Y4VyQUM2iqSBh2wUqVQsHCfz5hNDp/3mqyg1xkj37qViVTAthY5bx61nM79WLrB80xaUlsPYtItjZ+em
   8.215 -        Shk5cZk9NYeutnuRwUXnbuQzn/wY77z55rPC3c+0AHzuS18ULxw+TOj7HBs9xpHnf4jmy0tCsNPxcg6b
   8.216 -        bOgI1UJRTZBMioXMoHdJAChrKc3AW6LSASqVzK7X/TZC7qDJy7B/5Q4q374LJfaY+9XfobxrF9qRZym2
   8.217 -        IxQTIrdJs5OQBh4A1eFLqKxYiXPsEG4sE3VivDgTxObMkcwZBMI4j2bq3PH+q7j6bVecFSH4mROAz37h
   8.218 -        8+Ir//BVRBCjd1Ji13tV53Vtefc1LHjorihSyNVQcwqQEd87ryRTmX8ddWK0nAoDQ4SFlM6JcRQjR/yR
   8.219 -        XwRAGj0OgBgZRp6eRD1+lLkPfJi8ECjHx5D37Wf1ngfRyiUit4ljO3hymbKWUlmzhYIuaDoOY7M2cuIS
   8.220 -        qcMookFzbhyAcN7RXDZQ4o5ffPdZCQt/qgXgA5/5lPBGp5juzDIxdpLEb/actdDPRsMsWT2H7HSCF6N7
   8.221 -        TE4B3ciIF2qZguTSEpm3jmHSAkrzDpufKkRBSKVi4cYyolXHLdTgt/8LqZZDchyk0eOkWy6BiRnSCzfS
   8.222 -        OTRK4bLz4eQMtCJwbFi9rHfssie/hd6CZjdsANxIpmJZrFo+RCuUcJo2smoxM+egliu06zbtuSOAD5hI
   8.223 -        kcvG8zfyu594L+//0IdeF4c/NQLwuS99UQAcOHiQnY/vQqtLxN7cjzynS7TvRejzodbiz9KoiVouYoTS
   8.224 -        EtKBnscOCx66nyoEbh3ZKCIVaohaBbfuUKyfoGJVeteeuPmDJJvOxy+a5ManaCWCdOMwxecOQ8Wi5bgU
   8.225 -        VmcJHv7tfspxm1a1gnzoBZKpSfJGES+WkUvZPVUAB6gMDGFZQ0RNh/HZJu26ja5KIBdp2SeIOhOASRpn
   8.226 -        wnP7zZfx6x+5lcuuuOLH5vE/VQAuueVmQQtie47ZRhPF93+k/V6M02Pzxa8reblHNEBZTXoOGywQLs97
   8.227 -        383AozRv0xNDRwlClFXLCH79d5AOj6J++26KqYNpKSRpHkfWqN/+sYWbsR2wKpQffopgZZ7g4EtUZJjz
   8.228 -        YgYaY7iRTFlLcSOZvFFEy6k43XtTynixRuzNoBaXsXLFSqS8SmuygZuWCOYdSlKPllsnaM70vrZQLPBL
   8.229 -        t731dYWGb1gY+Dt3/l9iyqmza+cTiFCHjs/kwYnsw0gGTNoUQBtAVxLCRCHPUg3QSqCgLLxfHIfr+coC
   8.230 -        6fNZte4sd1tg1apUKhZtv82cFwMJqX0So1ygREZ+bYWFu/pcGpdtI/23H5CUyqhrV7K+mBK5kKR5yjok
   8.231 -        bkRj5y7iO34Jv9GkuHMXwq7TtB3YbSMBaeqiA00AObuvspYynwCkrJQpqSDrMrQj5swBklbMqalTrBpZ
   8.232 -        S75Swm0AqUcYC3RVQstXiUMPkYTZeHgt/n3X/tcVGv7ENMAf/PmfiL/52j8QtwLwsxAm9DV0ZcH2JVKm
   8.233 -        hGU1y4OHIkWXZNJYQ1YXmJYUHZGESIpOEnTI6RJF9eWdv242rcDCTB8bn10y+9333A7HjlGtnyDYfjUt
   8.234 -        yyK/5ynicp7O+z9E5Zn9qN++G3frVpJrrmb4b75K6hwnCRO0YiZEURBm/sB82CalLiWj2IsUus4dgGbo
   8.235 -        vfsrWXkSn8ynUMo9R3RuehYvlkm9BqK0geENa1HCJicyWSb2kiVaQFGbBEJHl2S2XPgmbrhi3Y+VJTwr
   8.236 -        AvDhz3xapGHEsdFjHB09gWpn1bCOXFoyYwFixUJNbGLFetlrJVIBxcgBoOrZzNTy1Z4tJD2TeEU0AKiW
   8.237 -        skF1504A9AjoQjMEwZtvwL3mmuy8XQ+RXHM1xf0H8DZfQuGb34C3vwNp9BjV+7+FnSq03n4z5QN7YWy0
   8.238 -        d51m4CHkMlLq9p5Li3IBQC8f0A0TAdp+m7yZ771f/HnbbzM1EyDHNnJpgIplUbbW4TRtbNvGbQrKJQm3
   8.239 -        KYjdY6iJvWRM1y/XeHrPY2+MAHzuS18UX/r7vyXwO6SNAICw4ZJbNGsXe+Jd1Z2YJiLKtEEQ2hj6gjCE
   8.240 -        iYJmFtBymTrT8tXe+bq6cJtqudKbDUZ1LaWSwLY9FGXeHFy9EW/nPiqSjSMsytvXIR89jn31pYhHn4KP
   8.241 -        vL/nsbf3HaDypnPJPbYbb/MlKLsewpybxh9YTu3ph4mCTNW6UTZLFxMuFqn1LjRD70UNXfRIz9WgU18i
   8.242 -        BKli0bDrDMw7g45jM9FIyAsXuTRAeWAdJRWa9WPYqQX2KF5cJAw81MTujWv3+abbbnvNvQOv6uC33f5R
   8.243 -        AWAfG2UmmEW0kyXFksUI/QSkAmZRozWv7bs3aehWj3gAzdQJE5OcAaYin3EtuVhd8r42uJ40tvFijaAV
   8.244 -        Y1TXEq8fQG40SW+7HPmuxxHb15BzJWpHjjKR6hSu3wyActE6xFfvZ+KGLRTsRuatL7Mo/MsjtEbyGHUJ
   8.245 -        8+mniL0FJ6ubBALOIF0q1CirKY6wkBKXajElkWqkznE8uZK99zMBiNUiRSM71wtcxLz9BxifOkGqlBka
   8.246 -        tJATm+ePzSHkgEISUBwcZmD5IG7TZm5yjnZrgqKRpy2ViZ0TSwRA6USYRY1Pf+qXX5MpOMMJ/OwXPi8m
   8.247 -        Jk/xg8d3IRoBqhTx0otPE4xnana+0IViLtXt3bg8FlAsafhNm0LJ6gmBoVsITadkrKWoepmEayn1+bhe
   8.248 -        LlaRE7eXhJETl7yaohZrxF6d6XoHOEZRTTEB8hWaFTA+eg35Jw7TLmi0Lj2PlS+NUf/g1Whxg1JdIN/3
   8.249 -        FI23b6E0OgdXb8HYe5TOYIUUl8KDB1GPzVE5NkeSNEmUAlIl80tiLyEx2xCkGPmYorYOWbUQRYGwHdJt
   8.250 -        l2A36sRXvwXu+3eiqSayDrJeImrGJGom0HkzjxuDnNiQq1GkzPFjo1SGqlRqFmOzZVKvQVO2KdXWUyy6
   8.251 -        xB0ZCHBtBy2nUjTKiHIdNTdE2pzDVGRaheUUWtO98Y/TFmCxb98Bdt1/v7jmhhtelRD0Dlr/rhvE3PQp
   8.252 -        hOMjz2WSX8hZ+M3M1uimQugnJGomBLEAVcqeAYrl7NhYgCpnGiBWLDR9XkXKJhUrU9PxfBLET3WKhaSX
   8.253 -        cs0bRapWjYZdpx14vZAp6sSoxQVPV7IquBvXIfI6zXMvzO5VCNI1A8hfu4vStkuhUIATY3g798Gt2+Hb
   8.254 -        e5b88NhLUIunOSiLUNWgce0lFCuDqPffD6JE4/ZrSdcMUPzBPoKkTn79JsRQBeXb9yKNnqRSyjRbswNp
   8.255 -        bGdefs5ibvIoTjLAhrUV0o7N2Gw2pkODFl7g0mhmY1QtyZTVlLlmimtngaKaU3qmYGzWJvUavXu0HXuJ
   8.256 -        L9BKoFgs86lfu4333Xwr51108X8oBArA8u0XiqjloTQC0rqLiEAV4Ac+KSBLkMwzLYsCiRqhzhMvS5AC
   8.257 -        aeijmwqaJqPlclTyMnk1QNdMDEXCkBNE2Mke84WNFastTNPEjBu0WikFPWS6BbosyJfyuD6Y+QriHe+i
   8.258 -        efU2fLdFtG6Q9i3vRNSWQatDcOAZcts2U33saSJDRdJ08o8+jjN9iuTA86T2OPLRFxFuAwK795CFSxJK
   8.259 -        SP4pCGwSSWEgZ2CWi5imjhSFSLWVuNs2Yh6xcUNB8vYtyONzBFs3IP/gOfJHTtB4y8WseW6KQOiE7RC1
   8.260 -        UEIzDY6fdDGLFoYGiVql3QloYmIVTRTdwutIKDqUdINK3kTWTZANzNJK8qUqbUVHSDJCNogVjUq5hiRD
   8.261 -        kEqkxmpagUAdqBGGGkGsEiYdALQkYHLa5U0XjPD1f/znO1+VAKxbU92Rl1LygUIchUSxQJbAzCmIRKCb
   8.262 -        Sk8AIMLUFRRV7j2MfAXVMMnrBrpqoMmQJIIkEahyiJQGIBtYtSq1Yg7ZnyPyZ+l4bcx5I5QzJOquoLpp
   8.263 -        Nc2bb8K//K0QJuSA8Q++C+PYCawn92FOHMd8+nlWHD5B6fCLxJMNpGKe3MEJosf2Ir90mPbMNJyaQnQy
   8.264 -        P0WESyuCaqEEZkw1Z5BbuYJlQxvwwyna115O6/3XE6xdQUiHwuEX0RMFccl55F84TGimkC/RNg301QX8
   8.265 -        J1/E8h2Mk2P47jSzjYCBgoSchGiKz2wjQKkalBUJWfJpuQGy5FOUfaw81IOEkibTwqIo+0SRix8J9DTr
   8.266 -        CnbbWXYzjUIkGWTVQgnrpNEMcZiQiz1EkkAaYOKjy5kW6Lg2jXbCn/4/O3Z87etf/5FCoADcdtsndpwY
   8.267 -        fwERVwhjgSpHJLHokR5EAjOXCYE+b/tlrYSkGEiKQU720GSdlt8kkQxiAfmSRbVaIldZTtByQDbwOz5S
   8.268 -        2ALDxDDzBFFKbnAN7jvejbZiFfHJE4RbtpEuWwVPPgM33UDwzJMYuQJFrUL1hcfxmw0kVSbwHQJ3knYo
   8.269 -        w6EX8Z1p0rAN/ixCNno/MFkxgJGTkcwqYnWN4lVvZkV9Gin0kWrLsW+5AWfTRkp1h7Cgk65fR+HQBOHW
   8.270 -        TfjPPcfy6Q6d85Yj1q6h8G+PodcnKE1Ms+yFAzjHR8k1HEzDJAh9Qt9Gkum97wQSmjeBqUoYMqiKiyQC
   8.271 -        dDW7v5Im4wUuxXl1GmAQe3VyZo5mDL4/LwBegyCVGMxDrObohALN0On4KZKiUcxptEVKJwgoKFlWdHxq
   8.272 -        lnVDy7j//gd+pAD0nMCiGKQZZ5m30E96tr2LrncPPgVzUYjnN+loJcpli3XLl0Hgc7I+n84NfNzaOkrm
   8.273 -        LE3fpbJ8GIZG8C/cRNRKkHfuJL7hFsS6GvoDL1GxLJyGjVTQkUsaCSBZNcq7HsCuDdGePpk1T9YzO5iq
   8.274 -        FnI8SqpmtleObWLVAhrUyhInr78FafNm1KhFsV5HfeQZ4nKJdGCYYpgypqTQCmF1Bee6a/EefpCi7dJZ
   8.275 -        ZVB6dhRlrkkrGWfwm02KVcFzs8dhFoaH1mfCJVVxE4dSB8TIWpTaxTi7x6CZ2f/KKgm3ueBnL44Euq+j
   8.276 -        TkxTgZIKUuJmZWC73vMBupATl7FZsCyLaknGsW3SMCBvqrQ6dYjkXs5F1kqkQcg3v/E9vvSXXxS/+cnf
   8.277 -        fkVfQAbYtnkz1eVrASiXLZAKqHIB9bTTzKLWI1835F6BJaeAXBrAk8tZzv26W3DXnoOXW07uvE3I5UFK
   8.278 -        lQHcQg3n1tsINl2UXfC9tzExewJsh0grY//KHXBsFPHwbtL162nu3AX7nsHevxd2frvXOdu7+fk2as1o
   8.279 -        Zc5SQaNsVRhekQ16RQiKUQvr7vsR54zglFTkiTont26gs3IZ1elxeHAXAO28zuqcDv/wDUo7H2Lk2QeR
   8.280 -        Epe5yTmcpo0328SyMkFz7SzRpGwZIl2+hpORhXPTjUTvvh7x6dtwhwaQdZk0TCkaZRp2PbtfXe6Rvhi2
   8.281 -        nTmGc5NzpF6D9nyfgJ/qvVA47iTIiUvs1RHzkVLeVGkt6iI+HScnZ/j2vbt45MEHXnGtoQLw3e988851
   8.282 -        q9bsaPoC17Wzyth8C5QsF5DJBl41TDTJA0K8UENORabOhEdHKaL/0q9SmjyGef4FeG96E+ZzT6Lf+B6S
   8.283 -        OKHqN2k6Ps01a8iNHqP8zDP4111L8PTT5ITAP+8c5BdeRDr0FOKHh+DJxzB++Dxuq4WhnCnASkFDMqtU
   8.284 -        iiZmZSWKUFEUQbWcQ1IMdDnCnZiGrVsojI8T+z7h1s2E370bLn8r0ob1aEeeJag7sGo1A/v3UX12L86h
   8.285 -        /UQNB0MSGLLAdn2iqEkpVyYqV/AHyvinHLwtG2n+4nvRV6/DswSG72PteQ7/mjcjn5qFIxPkTBkpbBAr
   8.286 -        CqbUgbiDJHwi3yHs2JyaahD4ASL0EeFCNTOdV7+qlKAoEVYeOgHgN/BDCU0WBJh4zgSIGNFxkUVWSBNp
   8.287 -        uOQxeeI4pUqJL3z+8zu+/Ld/e4Y56MVB73zPjTuOHZvEVEJks0IUNed9gIhYZN6+LEfoWgndiLEknVxB
   8.288 -        ppArMus0kZQcxq03EysGwfK16Os3wuQUkdMkueqtNNUy2DbG6Cji8stRD+4mPDFOfPgQ6sH9NB/bjX9o
   8.289 -        P76f9AhvRiklbWmCyKpVyQ2uQdEUciJG3XoZ0ZVXwnvfjbf7AKXYRVKMrHbQbuMHGp1rLyfU8ki6QuXR
   8.290 -        Byjt30PJa2PMzmEfP4r10vNYTmZWmolC2pzDqlZxylWiczaC71NXVIId/xsMr4dN59As5SkFIYP3PUCy
   8.291 -        5WLib/8As5Ynsj3E+ecSTo5RqU+Qhk2CdpupyUkc28axbWbcNiIMkFL/ZR8VuYVpCEw1opbTiAQErUzb
   8.292 -        yeE0oe+DbyP7DkFrtkd26Cf4YZsoConjzIFPYsGJ8Qbr16/k3777vVcWgN27d9+5YeXKHV4rII18Esno
   8.293 -        hYGwEArmTJNSzkDSMpLkXBmZFCn0ackFtHe9A5bVSColWkJg7HwAqVAmZ1lE+/aRzowjH3qRYG4Gb+wI
   8.294 -        umej6CaBN0cscljmwmzPWYNw3gVYsY8uJ+RKFdStl2F/6P3oa0fwjp5AWbcO5fpr4J5/xzxyCL/VxJi/
   8.295 -        N0OT8RouzYEBTK/JuQfvY/z5Y7S9FpWoiUhC3GabGbeNocqYpglRB7/j00wU/Dt+BbFlM1xwAV4cYQws
   8.296 -        Y/Cuf6Vz3ibCmVn0detQpyeJOgHyRecTWlXE8DpSq4z04IPYLz6P22wTNKeR0qD3MKQQFjmqXcHWoxY5
   8.297 -        a4CyVSISGiIJieWskKRHLYJUxvU6mEpI1OnQSUBSDIJ2hzjuIKEiSwmCHPncQqTmd1waHvzZn/zfO04P
   8.298 -        DZdkArdfdRkP3ruTMEjnVVD291gsJH4QHlBGUebbKQKfklngZLuJ+thTKB97f5ZbH5tBFFTS5hzc/Q0m
   8.299 -        3EyCK3kZd7ZNGoS9fno9dimXrV52ELKCS2lgHfHWbdTiBpGr4NgO9Ruvx12+knjZCtT9zxLseZRwyxZK
   8.300 -        QCmn4Lg+SVhE0efbu8aOIP5mjKFz1tBVslHLptnJysPVoQpK/QR2vUEaeBTzRUprBhl3BdLocaxnD2Pf
   8.301 -        cgOlVkzr0IsUN2yitPMhWldfhfLYbsSWK0grKsquhxA7dyJZFp7tUGzOAiDF7pLehMUoFzQ8uUzh9o8j
   8.302 -        3DrG49/v1R9KOQUngNSdBcNELg9SdmeJFHDa2Ri9XO+EhHmG7wZw4oePMj5xzRl/PyMV7IoiJi45BShZ
   8.303 -        ePPEKVLWjtQKBEgpA5WF7lgMk0q+RdM/ReOP/gSnMUWx1UQK2kRx2Lt2Tpm/fuzCfC+9BlRqVezUwv3Y
   8.304 -        bZQfepB0eIRCw8Xdtxdh3cDMW97Lsie/hdsqIU3MwPKVKMfHKFYrtOw5pJ27oJp17DT9Fu6MwvDICHkd
   8.305 -        YBbTn6YxLaguX8uyVRYzk2DXG7hv2o60fDWlwxXSw89mv3NecMpaivutu3DeexsA1YYD+xp4114D51xA
   8.306 -        vqCR3P8wE0deQGr6SMdeJA0FpeYcxUXELyZfKWgkrQirVoWhEdLhEcToKO23noej5xh6+hFczwYS8goU
   8.307 -        80W6tc808HBjZQnx7UVtZaq0sMC0m7XthuxrBivUVm+gYGhnRAVLcqG7d+++c+Wai3a4ARj4xALCIJs3
   8.308 -        AnWJGcibBvK8epILFrqq4thNZHeWUuhkqoqETpLlBOTYRytYGIqEopsouolVq2KeeyHpJduIjr5IsPEc
   8.309 -        0ne8g7BaJdhyCWJiFmv0RewP3kocqeR9m/CZfZjtGLF8AOPUKfyDBxEnjrIy9CkYMTN2jOva6HKCapbR
   8.310 -        cwbtpISZNPGDNgKDZbUibrONJSQ6F20mePN28i+OIuwpzGJWzjU0mWYA7lvfgl4awL/0IpqzM+QeuBd3
   8.311 -        dpboX+6hOTOONXMCvTFFEEaU1JRmlGY+zGkqfnhkBOXci8ivW099KsD/xK9RX7OOcM0w2j9+HSNXwL/g
   8.312 -        AkpVC/HSs+iaTjshM1OtiLBj43odPNcmiAQiyZJ13YduLqh8gHJBoVhQyJlllg8P4OGz56WX2LVvNxvO
   8.313 -        GdoxfvTknWcIAMBv/Pqv7Diw90nyJQvDMOk07d6XdKVLVyIMTUaWdZKkhRTFyAULx7YxSUgSQb5k0RlY
   8.314 -        S2XdCElboKpQHBxmxeoNyEOr8acmMc+9EPvjdxCsX0++Pkvr0GH0N29j8J77UKcnCS+5iHDng5SDEJYv
   8.315 -        R9l3gM7YEaSTJ7m4PoE6NUpj1l4gPDdIQZMIEwiiFEmWSFevI3r7DUQvPYdpFEmvvJ6Za96N1fZwJ6ew
   8.316 -        xk8QvudGVK9N68QRUj/IfAFASlMcp0XYdAm+dTfxoYNEp8bh2BFo17H0hVJw13HtPlu1KstqRSrlPB45
   8.317 -        nF/8CLNveRvx6tW01q4izulw4QhFu4H0xJOoo8dJN51DNHoc//BhPHeaoOUw02jR8Wao223S0CdRIW8s
   8.318 -        JOUWJ+eqZYWcIZMzZBRVok6K7/rMpgktVWXGbtAOA5SgxQ3v++CO557afecZJuCyy67kiYceZmKmQVlN
   8.319 -        sOfVSdcHyKp+CuAyYBWWnFsuW3hBO1sbd/E2SrfdRrMVs3r0GM43v4o4b5ixX7gVKW4j1x1stYh0/ARi
   8.320 -        eB3tG26kvHMXzUMvUq6VqD67lxYSSXMO+ZEHWDeyHkdNsWMXe9zmhJZSqViZOiVbYMn0yXnp12g6c6SB
   8.321 -        BsMjiJFhykYRN5IRW7ZQOXiYWtjAWT9MNDlH/uCLiHXrqJVrzExOQTDVU7el+lM0n36CWEBNl2lCLzLx
   8.322 -        gmzBRkmTUQoatXKNWC0SrltDcvRFZD2r+w8U24xOzMCWixn41ncQt92E9/gein4EBR1hVYie3Qt/cZBm
   8.323 -        0Cb25nrqfbE9T1QQEaBmE1GIFrpZQIhuab5M2ar0kkg1ZChD3VSpahol32AWm5NCQ3p8f3b90wXgtluv
   8.324 -        ky7bfqGQ4gSXMgWzRLtjLzkm9BMKRnZq1xlM3Vms2iDRmI0TgLz9Uir79rPm+NHeeZ0N5yLfew9i6xa4
   8.325 -        9jrkb90FeR1v2WoKlQoSUPrnf8SzLDbUoP30fRxxbaTY5QRZl02pMoCYbyFzHJs08CgXNNxWRDG/4PyV
   8.326 -        tISm56M8s4/C9dcQXXAx5eef5WSjgVTQaF56A9KbNtH+3B8jnRhDPPMM3thLuO2UbheAbOhZ4Uo2qSnh
   8.327 -        GWHp2lVrkAo15LLC3HhE58Yb6LRCclddSusLf44aQ7J1S0bNk48gLjyHsFaicM/3kIMY73v/Qr7dxgva
   8.328 -        uDPTSPOry5QY8jmlV2LXTQUdEKKFpC5MOknKyJekAtWywlU3XMfW9efw13//ddqhR50UrCodJGabLgNS
   8.329 -        zABgd+BEMJV91+kCADA+OXNnOa/vUPQyaeQTLqoKxiIrEkUJyEobQyv2zitqEe0wwNQkdK2G9M5rWf7Y
   8.330 -        I5iBjzu0AbcdUNuwnrBUBV1FtCNoOZhtj7XP7kM6uJepsaPoQQc5ldBVlSBMiTodCpUqQeAjqTq6nODW
   8.331 -        JzELFurQGqL1F5BufTPy8VGMeYIkPceM41MqCNJQRlxxJS3bxnh6D1K1irtyOf73fkD40gH8F17EnzhG
   8.332 -        EGUJmEpeJpK1bGVupYq8ajVxq8XagQqaVaE0vIbAtDDOHcK57hdon7cFpaQx13DQt11CqJvkG3XcY7NE
   8.333 -        H76VYGAZ1r59BPv2EZ46RbjvaZyDe4kbEzSaDYL55hpVQJqpu/R9AAATvklEQVRk1dVuEa5r0zPCdQqG
   8.334 -        RNRttDEkBq0ilUIRTdHpOG2eOvgMXltQt3IYVo1qLk85apGXFszV8mUDjO4+IMGP6ArWzTJhy0YrWJgJ
   8.335 -        eK7dqw+02h6anCM0JBJ9IRJoRlCqDHBycgZl35MU33MjjYu30Vw/QjFNkL76/9Fy65RHRpAPHMU+9gyO
   8.336 -        a7Nxdhx5vk1KNnSk2MUVw5RDN5vdWNj1RtbZu3ID9orVSLsfA1Lqt3+MeOUq9O9/H7veoGDJyIWsd2D1
   8.337 -        sioTkw2G9uxivOEgWj6MPsPsC0fQ1TZlJSaMU3QjW7sfBim6ka0HFLJJumwlA5/+FKJSIfnLv8bJq8g3
   8.338 -        /QKTm85HPnIc96mnkdcNU3Bt0i2bEXd/h7wkIY+OwvkXIE1Nwxf/CgkYO/wsTXs6U+FkM3ypF7/w99NR
   8.339 -        LSu90Fw3y+iGR8PNzpXnvX81r+DNRwflioJcKlNSJZLEodt+9JEP/BKf+eTvLwkSX1EANm/fzP7dj0J8
   8.340 -        ZqtWdiMKSAuzn/loQS4PUsnPUe84SF/5O9LrrkMO23iPPoEzfoRKY5QNcoOGBF3DMjM5xfDICJVKRrQA
   8.341 -        vNnjqLUqFauCUqtkffRKmeOf+GVSq4xy8Xm4d91F4dhxOquXsfbZPTQKGk3Pp1KAJEzw2h5S7DI2Dt7R
   8.342 -        u3u5hxJ2tsODIhOoOszH3lrBQgBrl1ezPsCLL8G5+AIKrof2tsuwn/8hqpxDrrukG4cR+/eTb4fIz70E
   8.343 -        URvpnAvoPPAgHBsF28YZP0JrkfkUEQiR1e3bndwS8jXDR5IW1HvByBazhEFKGKRYpTLt0MNUffwIAj9b
   8.344 -        fD64QiFuJ0uKR2WrQkmVWDe0HFUd4utf/mcJYPfO3z+Dx1cUgH/6p3+Wzt+4RkCmEtNoQWIlKUe7kxD6
   8.345 -        NmAxUIFSUaMZKZRyCs3KAMrkDO7hZxlSUxQTZk+cxCFLYhw46jI0WO45cABjsUz+uuuwnH/NYt5WRHrl
   8.346 -        9ciHj5Gcs55004WMPfE40ny8XxxehwQEjz1BbtslOGuXw/TJLA8wPkvUsnubNuQUGwNg0bKw7owqGnnK
   8.347 -        tQpNZ45SQUM+52LizdsQ64dx9+5DThM6E3XSW96JdPQY+e/fh3TFZbQYplit4vzgHipJm/IPn6fpB9in
   8.348 -        srUOXeK7M16RfBJMNDlHokIqsmbagtbtEs7I7xXb9DZhmEc32uT1Yka+piJLJnkd9OUpVWRmpscx5run
   8.349 -        g9Bj2fI13Hz7bfzh739OevKVyH01AgCgWDKJ011OtbQ8KUQHPVfsDXLTi8DIsnUFoAHE3hyN6ZMU80Vk
   8.350 -        o4hsONlS69SlMe0iG0WsWjbbtDSzg6VLtiEfP0pr+iTNLVvwKlVqE2Owehm0XIqNRfexfoTo4ftIvvDn
   8.351 -        pGNHeqTnFBuER05Z0FC6IdMxLaRclbQ5h05WnlZWLSPaeDGV46O4R48jrrme9NrLUf7f/0Hl2Cg4Dt6t
   8.352 -        t7KelDk/RHnhcSz/FK61Dvv4MTi0GxsYP43w0yFhkjMXz/KF9vDu5hPVsgJk1b28XiSvQzukR74fxdBN
   8.353 -        DTkeQU7G0Ius2TDMhpENfPmvviaNjjk8tefQj6J1Kcc/6sPf+I3f2nFo/24kkSV/kiQkTTookopAQ9Nk
   8.354 -        RBoSJ2BoMXIqQxKDqiKlPmGqU9YV4vlwCNNCvvkDNA8coVw0YWgEse1qondfS/Lw02gXXMDc5i0ohw+S
   8.355 -        T2Umpxyqb9lOvG6YopzArkeQnngStxMQPLGb+MCTaFGEc3KUIPDRZOg56ZKOPh8PK6pEGKSYWy9H3rqN
   8.356 -        dWGHNIlpCpPO+z5E45ItOJaFbttIM5Nw2aVU7rufwdY042NtpGsuxz5wkNLTD1I/ZdMYPQqHD5FOvEir
   8.357 -        1cmSZSmwdBkC+ZxCLAnyRubMSZKOrJUQadgjvphPUFSDgZKJpuhESUheXxDcKAkJg5QgTHBaTWQ5QlV0
   8.358 -        cqbBde/4Bf79vkel0aNjd+7dc+A/bP96zQLw0IOP3rl+y9CO0BUItYzfcQkjpfc7ozjLSKVElPMmQkTI
   8.359 -        st7LDLpemygMiRIoWRVyF1xI6x1vx9cUpLpD+JlP0zp/E8rDT5A+u4e47lB53y3Yooi0fgTlkYcoPP8C
   8.360 -        LSQ6Dz2Ce+ggQaOOdGgv4vAhUq9JEPhU8jJyulDy7hIvVUfIv+VKCnIBM/KIm3Vy296KSBKKvkszgNbV
   8.361 -        1yAGByjrMjz7HNJLR5BkAz2SCU8eJ7Unad5/P/LDD9GaHMdvTGVFstDvRQ1dCDVASlXyuaw3EkCTF3wo
   8.362 -        WSuRkz2KBYWBUhldC4jTlLyu0w49NEUnV8oRhx06kU+r7eO0moRxiK7qLBsyue29n+Cuu++RZhvNH5v0
   8.363 -        Vy0AAG9982U7ZiZPgFIip0s0vc6Sz2UpSzumsoGmgCzrxO0Z5FRGkmLclouZr6Be/04a73wXkuMQn3c+
   8.364 -        /r2PU1s1SDpoMfy9f0GkEp2pCZSWT7R6FdHjj8HoPnz7FO7BZwknTiCJGEnElJSYUC1R0SNMTerZc62Q
   8.365 -        taGVl6+l1Y6R3nIF9V+9A1GtUT42ild3kVYvx7toK/JsjClCGqdmKa9aDjN1ZElCOnoA6fn9BJPTzEyf
   8.366 -        pO2cwndmCVyHdL5m322PS8kcOFkCoYEkqeSNhZa57kzvZuhM3aCUM4hSnSjx0NU8URISpXoWaksRTadD
   8.367 -        vRnT8T00Lea89RewYngle/c9L52aaN758COPvG7SF+NV9Y5fcOm5oruTlT03RruTLKkUFssWOdnDKs0v
   8.368 -        vVYWvNmT9WaWIfzUZyjbLkWnwamrryX/3fuQZscofOIO1K/8HenhZ7NsHuC6NrKR7asHmRPqtNOsW4ms
   8.369 -        T6Aseb2dtbpbrQ1fuJ3WqkE6V15F66GncZsNKu++EYCBB+4jOPICLS+m8Msfx6vVqHz7Luz9e3sbMzVn
   8.370 -        jpC440vCM0nL7Lq6KBXe7iQvG66dvi9BJS/PV085w5FLhT9v0zOH1PMXlrwVcjK/+lu/Q6VQ5dP/9Xf/
   8.371 -        87eKfcvbLxfO6AmQijQcpycA3byAOl+MWDNYWUI+hsnc9ExWt37X+6ncfCM89xLudVchPfoUua/+T7yV
   8.372 -        g5RPHsZdVC7uxbyL1vR3q2teZQPlW66Hb93F0GCZxtpzSEeGCR57gsaVb4Orr6C882FE1cI9Okr5+Cji
   8.373 -        jjsouC7c9++0Hn2I0qoVtNQi6dgR7LkxADrza+4XO3Hd37U4I7eY/NMJ78qEVZRJRaYt/CjOyI8gr2UO
   8.374 -        HUDDTRalcGF4+GKGNlT55r989w1dsv8fmgCA//a7n9yx5/GnKeWqyKpMu9VAQu35AmZOoWCW8EOBocUI
   8.375 -        EWX+gJYnRicIfJS5OQw/xh2okX73XnjiAXLOcaK5Gfz2oj35UkEnyZy5tqQhRTFp5CObFapDG6mdew7a
   8.376 -        7Tcxs+cgwZohZn/lY9CKENs3E+x6COktl7HqsUfRpmy8q67G+O53qJw4Rmtiinj/AcLGJPWZOdoTP8x8
   8.377 -        Gj8hiEQvC9dV6d3M5+L2dwBNk3sd0ZCRvqwsoygSpZxESosoCYnTFFWRiUWeKPEIA5+5pk/H9+gEARAh
   8.378 -        SQVufd+7efjh3dLE5Nidzx966ayq91eDVy1tL2cGYGF1kCL5GGbh5bXA1Gi2kKE4QCiZqL6LPL9kWsgm
   8.379 -        Zuj2kh5awaIZpazJiSypVLGYUArZzhq33YZ7zZXItot37Bhi9DjFX/0ILduj9NhepH/6Gu7tt7MyTdF2
   8.380 -        7sRZP0LzsYcpBjM47ZQ0ar5sx3NXvQt8UtVcssi1C1kr9UxRV7V31Xl3dnfRneVd1d7N2QOsHx5i8/Zt
   8.381 -        fPmvvvZTsTvLq94gYnV1kPHGcaCMWi6i+k6vUwiyOHdxu/hiaMW1yKmd2XRlPiSUA0gNypJHSKbmByrZ
   8.382 -        lmvUG8jlKuLaW6ivrhHXakhf+Tta64dRH3wEqR0iX/5mkr0HkEbHKbYixAUbkSyL8r/+KxOVKvKRZ0mf
   8.383 -        20OrY+NEC4KqSkuXtEFWZctIX1rd7G1AIXvoRhsEVHKQ14pAkVT4tCPm7Xxm48MgRUhtWp2FmLBaqbB2
   8.384 -        eCv33X+PND176DXF6T9pvGoBuP/ex6TzN64RUuxSkhRiU+mt8VuM8VmHdeuyjRABlADKBRN7LtttM1Db
   8.385 -        hOXlaL5PyZARgKbChgtGOL5pO/l1Q/D4HtwfPoe46BzSLRdSvfNzuLaNu3cfpeuuQdn1EGmtjLRpA/KO
   8.386 -        O2HLVhrPHkCZOkazHUJo9xw3sYjoxY4rnJl3X7ztTE7JsnFIRfLa0pauduiR14v4UUwYZLXDujOx5Jii
   8.387 -        WeQjv/ZxVus5Pvn7O6QXDr/4aof6DcVr2iKmbFVwnQShlpG1FDp2bzbFAhq2nTUptOewKlaWHZxHtVLB
   8.388 -        aafEmsnA//mHVL59V+8ze/9ept98A9E1V9K0XaRajea+J1m1bx/axeeRAGvKEux6MGvyWL4G8Td/T/TM
   8.389 -        04yPH6cwfgQRNXEXRSeJBsSc0R/XLa0uxuKZjiFhleQeyZkzZ/bUehft0KPuLFo+LhUYXlejVLO4/97H
   8.390 -        pGma/NGOz7+W4f1PwWsSgCuvfzv37Pw+wsuaP9Ko2fMFuj2DBbOUqUXHRlEKWd9gACWzQMOZAMWilQjE
   8.391 -        299DeuFGlONjNIdGaGkGabmIHCYUnz9CKV8k2PMoydataIBjOwhnDvtrR4BsDZxo2UgadOVM0iCOFlXa
   8.392 -        FoVup6NglnpbuZcLIX5s9mZ6OwJTy4Ym8+KzcxaHa92UbtEscsv73sef/cUXpamZU69lOH8q8JodkQsu
   8.393 -        PVeIRguhrcaeG1uyLwDAMkulFQjWrVgNZEUi27FR8gM0nbmso/X6W5A++2kqd3+f0skpnJtuxP36Nyh/
   8.394 -        ONu9Q4o6SHfdRTp2hJZikDSmlghbF6er9MV/W7yGsYvuHv4ID90sk9cgFX6vpNqOwFSz93ZzYXa3AtFz
   8.395 -        4opmkcEVVdZuGHnDQ7afBF7zLmGy6FA3C5STTK2Pd+pLPp+xY1Qp6xi2Kha2Y8+bA7+nBdJD+6mdmEBy
   8.396 -        bKT6OHLUQTJ0kr/8a1pVC05NwKE9L0s6LHXiuo7d6bO8a88Xm3ldUsgXAeZnethN0mSCgIhxvRQIe6QX
   8.397 -        zWKP/FqlzEc/cQd/+Pufk36aHLnXgx9Lgs8/5zwB9ELCxVpAkXxq1kogS4gsCQmht3BUuvodlK++Gukr
   8.398 -        XwFgtt1EbWQ7XnRb0U/H6ckneHniYSEp000mdcO0rm3vvu4iCD3afq5HtiQVyJsdNm+5kg3nb+RP//tf
   8.399 -        /MzP9pfDj/Wjbrr9JnF43zPI1jD+1CgNZ2GxY28BCTCytoaiFLJeAS+iVNSYmLVx2ilSroxkVUgnx15x
   8.400 -        pp9xs/Mknh6nL94sslpZ2NEzr9EL03qk98I2qDtuz5Z3e+sKhsTgiipvu+I6/uwvvvhzSfpi/FgbRRbU
   8.401 -        PA03wdKirEUpcHpaYPHMtL2U9Wsy8pOkxcRs1hDiuTa4Nky9uu/r5uNzqtJL2cJpcbpZJq9Veja96713
   8.402 -        EzbdGB0WbPriBM3aZav5wMc/xu/93h9IR09O/lTF6j9J/NgS/nJmYPG+QcX5KGHNYAW76dIKRE9Iulh8
   8.403 -        fJfkJTenZR2yL+fQLcm7twVyXspmN/Rm/Omkw8JMB7hoywYq1huff/9pwo/9w3/zt35TPHjvzt77bpHo
   8.404 -        dCz21E/PwL2cFw8v3xgJWZ+cVSqTtgXkgiWFltB3KRf1+eRMRvriCltXvQP8+m//9ln/3zs/q3hdg/Cm
   8.405 -        7UMicfKvqAW6WJyMWfz37gzvagy/aZ+x/XvBkHohWzvKYnGrKGM33UwYhI/rLaw/7M70LoRocfHWi3st
   8.406 -        U6/n9/484nUNyA03vk2Mj871yrUNx3lFNQ+LVrawkKzpbim3mPxuTcEqZhk5My4sqPh5m94lfXFiZrFd
   8.407 -        X5ygeT2/8ecdL9/z/Spx+RVXIVmi9z/vZK2UpVpfJvMGS733MDDJ5xR0wycne1Qtq7fqVTdkdL3dm/G+
   8.408 -        2srsue8SBimTcwGe7/UqbZDN9PXDQ3z0jg8yPduUjp6clPrk/8d43QPULRND5gdA1lyhxK98jm4qvVle
   8.409 -        liV8TaLhOLTa2Wwu5IusGjB69lw35DMaKLr4z2qk+HnB69IAAFu2bkGpLN2oaPFMj9IOschIr1ZUqpbF
   8.410 -        qnwZqyhjFWV8TVpSS4dsNrteSMNN8HzvDPIlqcD//t8+y/RsU3p6z2NSn/wfH2dl4HpaQGQVsjAAw1y6
   8.411 -        yiX7tmKWmVuUmFHz2cqW8VmHVtTuLZQ4nfD1m0dYlavxre/0yT6bOCuDeel1FwrvhEOdtPdPnbqktwLR
   8.412 -        W0s4sjZbs9clvVtwWWLLy9l53et89I4P/tymYX8acFYG9pOf+aTY+dB9BKeavSxbu7M0HMvnJNYuW90j
   8.413 -        fXFipodKkZGR9WzdtJkv/Y8v9Ul/A3DWBvmy7ReK4yfqtDtJbwEkZMRDVkkDljRRQKbeq5UKm7dv5p/+
   8.414 -        6Z/7pL/BOGv/NGrbZVfj2t+hFbWRpRw5VaFaVlAsGV3OMnPj9ey5u6HB+z/2S/zRjs9LUzOn+Gltmfp5
   8.415 -        x1kTgMEVFaRqgQvn28YQ3vzy8YUI4eINI0hphfvuv0eamuFnomXq5x1nVeUu336hGCyVEV6dsjVAMxYU
   8.416 -        m25vufLZ/K4+zg7OKimf+9IXxXe/cxdDI5sY0CX+8k//sk96H3300UcfffTRRx999NFHH3300UcfffTR
   8.417 -        Rx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH3300UcfffTRRx999NFHH328fvz/S2i/
   8.418 -        CYub2lgAAAAASUVORK5CYII=
   8.419 -</value>
   8.420 -  </data>
   8.421 -</root>
   8.422 \ No newline at end of file
     9.1 --- a/Server/Program.cs	Thu Jul 28 19:32:40 2016 +0200
     9.2 +++ b/Server/Program.cs	Fri Jul 29 10:40:15 2016 +0200
     9.3 @@ -32,7 +32,7 @@
     9.4      {
     9.5          //WARNING: This is assuming we have a single instance of our program.
     9.6          //That is what we want but we should enforce it somehow.
     9.7 -        public static MainForm iMainForm;
     9.8 +        public static FormMain iFormMain;
     9.9          /// <summary>
    9.10          /// The main entry point for the application.
    9.11          /// </summary>
    9.12 @@ -70,8 +70,8 @@
    9.13  			//
    9.14              Application.EnableVisualStyles();
    9.15              Application.SetCompatibleTextRenderingDefault(false);
    9.16 -            iMainForm = new MainForm();
    9.17 -            Application.Run(iMainForm);
    9.18 +            iFormMain = new FormMain();
    9.19 +            Application.Run(iFormMain);
    9.20          }
    9.21  
    9.22  
    10.1 --- a/Server/Session.cs	Thu Jul 28 19:32:40 2016 +0200
    10.2 +++ b/Server/Session.cs	Fri Jul 29 10:40:15 2016 +0200
    10.3 @@ -49,27 +49,27 @@
    10.4              SessionId = OperationContext.Current.SessionId;
    10.5              ICallback callback = OperationContext.Current.GetCallbackChannel<ICallback>();
    10.6              //
    10.7 -            SharpDisplayManager.Program.iMainForm.AddClientThreadSafe(SessionId,callback);
    10.8 +            SharpDisplayManager.Program.iFormMain.AddClientThreadSafe(SessionId,callback);
    10.9  
   10.10          }
   10.11  
   10.12          public void Dispose()
   10.13          {
   10.14              Trace.TraceInformation("Server session closing.");
   10.15 -            SharpDisplayManager.Program.iMainForm.RemoveClientThreadSafe(SessionId);
   10.16 +            SharpDisplayManager.Program.iFormMain.RemoveClientThreadSafe(SessionId);
   10.17          }
   10.18  
   10.19          //
   10.20          public void SetName(string aClientName)
   10.21          {
   10.22              Name = aClientName;
   10.23 -            SharpDisplayManager.Program.iMainForm.SetClientNameThreadSafe(SessionId, Name);
   10.24 +            SharpDisplayManager.Program.iFormMain.SetClientNameThreadSafe(SessionId, Name);
   10.25              //Disconnect(aClientName);
   10.26  
   10.27              //Register our client and its callback interface
   10.28              //IDisplayServiceCallback callback = OperationContext.Current.GetCallbackChannel<IDisplayServiceCallback>();
   10.29 -            //Program.iMainForm.iClients.Add(aClientName, callback);
   10.30 -            //Program.iMainForm.treeViewClients.Nodes.Add(aClientName, aClientName);
   10.31 +            //Program.iFormMain.iClients.Add(aClientName, callback);
   10.32 +            //Program.iFormMain.treeViewClients.Nodes.Add(aClientName, aClientName);
   10.33              //For some reason MP still hangs on that one
   10.34              //callback.OnConnected();
   10.35          }
   10.36 @@ -81,30 +81,30 @@
   10.37          public void SetPriority(uint aPriority)
   10.38          {
   10.39              Priority = aPriority;
   10.40 -            SharpDisplayManager.Program.iMainForm.SetClientPriorityThreadSafe(SessionId, Priority);
   10.41 +            SharpDisplayManager.Program.iFormMain.SetClientPriorityThreadSafe(SessionId, Priority);
   10.42          }
   10.43  
   10.44          public void SetLayout(TableLayout aLayout)
   10.45          {
   10.46 -            SharpDisplayManager.Program.iMainForm.SetClientLayoutThreadSafe(SessionId, aLayout);
   10.47 +            SharpDisplayManager.Program.iFormMain.SetClientLayoutThreadSafe(SessionId, aLayout);
   10.48          }
   10.49  
   10.50          //
   10.51          public void SetField(DataField aField)
   10.52          {
   10.53 -            SharpDisplayManager.Program.iMainForm.SetClientFieldThreadSafe(SessionId, aField);
   10.54 +            SharpDisplayManager.Program.iFormMain.SetClientFieldThreadSafe(SessionId, aField);
   10.55          }
   10.56  
   10.57          //From IDisplayService
   10.58          public void SetFields(System.Collections.Generic.IList<DataField> aFields)
   10.59          {
   10.60 -            SharpDisplayManager.Program.iMainForm.SetClientFieldsThreadSafe(SessionId, aFields);
   10.61 +            SharpDisplayManager.Program.iFormMain.SetClientFieldsThreadSafe(SessionId, aFields);
   10.62          }
   10.63  
   10.64          ///
   10.65          public int ClientCount()
   10.66          {
   10.67 -            return SharpDisplayManager.Program.iMainForm.iClients.Count;
   10.68 +            return SharpDisplayManager.Program.iFormMain.iClients.Count;
   10.69          }
   10.70  
   10.71  
    11.1 --- a/Server/SharpDisplayManager.csproj	Thu Jul 28 19:32:40 2016 +0200
    11.2 +++ b/Server/SharpDisplayManager.csproj	Fri Jul 29 10:40:15 2016 +0200
    11.3 @@ -175,6 +175,13 @@
    11.4      <Compile Include="FormEditAction.Designer.cs">
    11.5        <DependentUpon>FormEditAction.cs</DependentUpon>
    11.6      </Compile>
    11.7 +    <Compile Include="FormMain.cs">
    11.8 +      <SubType>Form</SubType>
    11.9 +    </Compile>
   11.10 +    <Compile Include="FormMain.Designer.cs">
   11.11 +      <DependentUpon>FormMain.cs</DependentUpon>
   11.12 +    </Compile>
   11.13 +    <Compile Include="FormMain.Hid.cs" />
   11.14      <Compile Include="FxControl.cs">
   11.15        <SubType>UserControl</SubType>
   11.16      </Compile>
   11.17 @@ -182,19 +189,10 @@
   11.18        <DependentUpon>FxControl.cs</DependentUpon>
   11.19      </Compile>
   11.20      <Compile Include="ItemActionType.cs" />
   11.21 -    <Compile Include="MainForm.Hid.cs">
   11.22 -      <DependentUpon>MainForm.cs</DependentUpon>
   11.23 -    </Compile>
   11.24      <Compile Include="NetworkManager.cs" />
   11.25      <Compile Include="DialogBox.cs" />
   11.26      <Compile Include="Display.cs" />
   11.27      <Compile Include="DisplaySettings.cs" />
   11.28 -    <Compile Include="MainForm.cs">
   11.29 -      <SubType>Form</SubType>
   11.30 -    </Compile>
   11.31 -    <Compile Include="MainForm.Designer.cs">
   11.32 -      <DependentUpon>MainForm.cs</DependentUpon>
   11.33 -    </Compile>
   11.34      <Compile Include="MarqueeLabel.cs" />
   11.35      <Compile Include="Program.cs" />
   11.36      <Compile Include="ProgressForm.cs">
   11.37 @@ -215,12 +213,12 @@
   11.38      <EmbeddedResource Include="FormEditAction.resx">
   11.39        <DependentUpon>FormEditAction.cs</DependentUpon>
   11.40      </EmbeddedResource>
   11.41 +    <EmbeddedResource Include="FormMain.resx">
   11.42 +      <DependentUpon>FormMain.cs</DependentUpon>
   11.43 +    </EmbeddedResource>
   11.44      <EmbeddedResource Include="FxControl.resx">
   11.45        <DependentUpon>FxControl.cs</DependentUpon>
   11.46      </EmbeddedResource>
   11.47 -    <EmbeddedResource Include="MainForm.resx">
   11.48 -      <DependentUpon>MainForm.cs</DependentUpon>
   11.49 -    </EmbeddedResource>
   11.50      <EmbeddedResource Include="ProgressForm.resx">
   11.51        <DependentUpon>ProgressForm.cs</DependentUpon>
   11.52      </EmbeddedResource>