# HG changeset patch # User StephaneLenclud # Date 1469727160 -7200 # Node ID 6ccaa430aa23c1584c85a86808ce945e466eff2b # Parent 471cb4c8a09ad69124ed9256f2daabc3bb8aa6bf Adding support for Display Messages. diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Idle/FormClientIdle.Designer.cs --- a/Clients/Idle/FormClientIdle.Designer.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Clients/Idle/FormClientIdle.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -1,5 +1,5 @@  -namespace SharpDisplayIdleClient +namespace SharpDisplayClientIdle { partial class FormClientIdle { diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Idle/FormClientIdle.cs --- a/Clients/Idle/FormClientIdle.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Clients/Idle/FormClientIdle.cs Thu Jul 28 19:32:40 2016 +0200 @@ -30,7 +30,7 @@ using SharpLib.Display; -namespace SharpDisplayIdleClient +namespace SharpDisplayClientIdle { /// diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Idle/Program.cs --- a/Clients/Idle/Program.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Clients/Idle/Program.cs Thu Jul 28 19:32:40 2016 +0200 @@ -24,9 +24,9 @@ using System.Windows.Forms; using System.Drawing; -namespace SharpDisplayIdleClient +namespace SharpDisplayClientIdle { - static public class Program + public static class Program { /// /// The main entry point for the application. @@ -43,7 +43,7 @@ } [STAThread] - static public void MainWithParams(object aParams) + public static void MainWithParams(object aParams) { //Set high priority to our process to avoid lags when rendering to our screen System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Idle/Properties/Resources.Designer.cs --- a/Clients/Idle/Properties/Resources.Designer.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Clients/Idle/Properties/Resources.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace SharpDisplayIdleClient.Properties { +namespace SharpDisplayClientIdle.Properties { using System; diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Idle/Properties/Settings.Designer.cs --- a/Clients/Idle/Properties/Settings.Designer.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Clients/Idle/Properties/Settings.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace SharpDisplayIdleClient.Properties { +namespace SharpDisplayClientIdle.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/App.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/App.config Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/FormClientMessage.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/FormClientMessage.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,58 @@ +namespace SharpDisplayClientMessage +{ + partial class FormClientMessage + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.iTimer = new System.Windows.Forms.Timer(this.components); + this.SuspendLayout(); + // + // iTimer + // + this.iTimer.Tick += new System.EventHandler(this.iTimer_Tick); + // + // FormClientMessage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 261); + this.Name = "FormClientMessage"; + this.Text = "Form1"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormClientMessage_FormClosing); + this.Load += new System.EventHandler(this.FormClientMessage_Load); + this.Shown += new System.EventHandler(this.FormClientMessage_Shown); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Timer iTimer; + } +} + diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/FormClientMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/FormClientMessage.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,215 @@ +// +// Copyright (C) 2014-2016 Stéphane Lenclud. +// +// This file is part of SharpDisplayManager. +// +// SharpDisplayManager is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// SharpDisplayManager is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SharpDisplayManager. If not, see . +// + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Diagnostics; +using SharpLib.Display; + + +namespace SharpDisplayClientMessage +{ + + /// + /// Sharp Display Client designed to act as an idle client. + /// It should take care of screen saving and other such concerns. + /// + public partial class FormClientMessage : Form + { + public StartParams Params { get; set; } + + Client iClient; + ContentAlignment iAlignment; + TextField iPrimaryTextField; + TextField iSecondaryTextField; + + + public delegate void CloseDelegate(); + public delegate void CloseConnectionDelegate(); + + + public FormClientMessage() + { + InitializeComponent(); + } + + /// + /// + /// + /// + /// + private void FormClientMessage_Load(object sender, EventArgs e) + { + //Prevents showing in the Open Task view (Windows Key + Tab) + Visible = false; + + //Display client + iClient = new Client(); + iClient.CloseOrderEvent += OnCloseOrder; + iClient.Open(); + iClient.SetName("Message"); + iClient.SetPriority(Params.Priority); + SetupDisplayClient(); + + //Timer + iTimer.Interval = Params.DurationInMs; + iTimer.Start(); + } + + + /// + /// + /// + /// + public bool IsClientReady() + { + return (iClient != null && iClient.IsReady()); + } + + /// + /// + /// + public void SetupDisplayClient() + { + //Setup our layout + + //Set one column one line layout + + //Setup our fields + iAlignment = ContentAlignment.MiddleCenter; + iPrimaryTextField = new TextField(Params.PrimaryText, iAlignment, 0, 0); + iSecondaryTextField = new TextField(Params.SecondaryText, iAlignment, 0, 1); + + //Set our fields + if (string.IsNullOrEmpty(Params.SecondaryText)) + { + //One field layout + TableLayout layout = new TableLayout(1, 1); + iClient.SetLayout(layout); + + iClient.CreateFields(new DataField[] + { + iPrimaryTextField + }); + } + else + { + //Two fields layout + TableLayout layout = new TableLayout(1, 2); + iClient.SetLayout(layout); + + iClient.CreateFields(new DataField[] + { + iPrimaryTextField, + iSecondaryTextField + }); + } + } + + public void OnCloseOrder() + { + CloseThreadSafe(); + } + + /// + /// + /// + public void CloseThreadSafe() + { + if (this.InvokeRequired) + { + //Not in the proper thread, invoke ourselves + CloseDelegate d = new CloseDelegate(CloseThreadSafe); + this.Invoke(d, new object[] { }); + } + else + { + //We are in the proper thread + Close(); + } + } + + /// + /// + /// + public void CloseConnectionThreadSafe() + { + if (this.InvokeRequired) + { + //Not in the proper thread, invoke ourselves + CloseConnectionDelegate d = new CloseConnectionDelegate(CloseConnectionThreadSafe); + this.Invoke(d, new object[] { }); + } + else + { + //We are in the proper thread + if (IsClientReady()) + { + string sessionId = iClient.SessionId; + Trace.TraceInformation("Closing client: " + sessionId); + iClient.Close(); + Trace.TraceInformation("Closed client: " + sessionId); + } + + iClient = null; + } + } + + /// + /// + /// + /// + /// + private void FormClientMessage_FormClosing(object sender, FormClosingEventArgs e) + { + CloseConnectionThreadSafe(); + } + + + /// + /// + /// + /// + /// + private void iTimer_Tick(object sender, EventArgs e) + { + Close(); + } + + + /// + /// + /// + /// + /// + private void FormClientMessage_Shown(object sender, EventArgs e) + { + //Visible = false; + } + + } + +} diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/FormClientMessage.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/FormClientMessage.resx Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Program.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,77 @@ +// +// Copyright (C) 2014-2016 Stéphane Lenclud. +// +// This file is part of SharpDisplayManager. +// +// SharpDisplayManager is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// SharpDisplayManager is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SharpDisplayManager. If not, see . +// + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Drawing; + +namespace SharpDisplayClientMessage +{ + static public class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + public static void Main() + { + //Set high priority to our process to avoid lags when rendering to our screen + //System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormClientMessage()); + } + + [STAThread] + public static void MainWithParams(object aParams) + { + //Set high priority to our process to avoid lags when rendering to our screen + //System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal; + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + FormClientMessage form = new FormClientMessage(); + form.Params = (StartParams)aParams; + form.WindowState = FormWindowState.Minimized; + form.ShowInTaskbar = false; + Application.Run(form); + } + + } + + public class StartParams + { + public StartParams(string aPrimaryText, string aSecondaryText ="", int aDurationInMs = 5000, uint aClientPriority = SharpLib.Display.Priorities.Foreground) + { + PrimaryText = aPrimaryText; + SecondaryText = aSecondaryText; + Priority = aClientPriority; + DurationInMs = aDurationInMs; + } + + public string PrimaryText { get; set; } + public string SecondaryText { get; set; } + public uint Priority { get; set; } + public int DurationInMs { get; set; } + } +} diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Properties/AssemblyInfo.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SharpDisplayClientMessage")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SharpDisplayClientMessage")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d9aad299-e97f-47e0-8e92-110f49f2b89c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Properties/Resources.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SharpDisplayClientMessage.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpDisplayClientMessage.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Properties/Resources.resx Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Properties/Settings.Designer.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SharpDisplayClientMessage.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/Properties/Settings.settings Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,7 @@ + + + + + + + diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/SharpDisplayClientMessage.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/SharpDisplayClientMessage.csproj Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C} + WinExe + Properties + SharpDisplayClientMessage + SharpDisplayClientMessage + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\SharpLibDisplay.0.2.5\lib\net40\SharpLibDisplay.dll + True + + + + + + + + + + + + + + + + Form + + + FormClientMessage.cs + + + + + FormClientMessage.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff -r 471cb4c8a09a -r 6ccaa430aa23 Clients/Message/packages.config --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Clients/Message/packages.config Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff -r 471cb4c8a09a -r 6ccaa430aa23 Server/Actions/ActionDisplayMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Server/Actions/ActionDisplayMessage.cs Thu Jul 28 19:32:40 2016 +0200 @@ -0,0 +1,87 @@ +using SharpLib.Ear; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SharpDisplayManager +{ + + + [DataContract] + [AttributeAction(Id = "Display.Message", Name = "Display Message", Description = "Shows a message on your internal display.")] + class ActionDisplayMessage : SharpLib.Ear.Action + { + [DataMember] + [AttributeActionProperty( + Id = "Display.Message.Duration", + Name = "Duration (ms)", + Description = "Specifies the number of milliseconds this message should be displayed.", + Minimum = "1", //Otherwise time throws an exception + Maximum = "30000", + Increment = "1000" + )] + public int DurationInMilliseconds { get; set; } = 5000; + + + [DataMember] + [AttributeActionProperty( + Id = "Display.Message.PrimaryText", + Name = "Primary Text", + Description = "The primary text of this message." + )] + public string PrimaryText { get; set; } = "Your message"; + + [DataMember] + [AttributeActionProperty( + Id = "Display.Message.SecondaryText", + Name = "Secondary Text", + Description = "The secondary text of this message." + )] + public string SecondaryText { get; set; } = ""; + + + /// + /// + /// + /// + public override string Brief() + { + string brief = Name + ": " + PrimaryText; + if (!string.IsNullOrEmpty(SecondaryText)) + { + brief += " - " + SecondaryText; + } + + brief += " ( " + DurationInMilliseconds.ToString() + " ms )"; + + return brief; + } + + /// + /// + /// + public override void DoExecute() + { + StartMessageClient(); + } + + /// + /// Just launch our idle client. + /// + private void StartMessageClient() + { + Thread clientThread = new Thread(SharpDisplayClientMessage.Program.MainWithParams); + SharpDisplayClientMessage.StartParams myParams = + new SharpDisplayClientMessage.StartParams(PrimaryText, SecondaryText, DurationInMilliseconds); + clientThread.Start(myParams); + } + + + } + +} diff -r 471cb4c8a09a -r 6ccaa430aa23 Server/FormEditAction.cs --- a/Server/FormEditAction.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Server/FormEditAction.cs Thu Jul 28 19:32:40 2016 +0200 @@ -112,6 +112,12 @@ CheckBox ctrl = (CheckBox)aControl; aInfo.SetValue(aAction, ctrl.Checked); } + else if (aInfo.PropertyType == typeof(string)) + { + TextBox ctrl = (TextBox)aControl; + aInfo.SetValue(aAction, ctrl.Text); + } + //TODO: add support for other types here } /// @@ -173,6 +179,14 @@ ctrl.Checked = (bool)aInfo.GetValue(aAction); return ctrl; } + else if (aInfo.PropertyType == typeof(string)) + { + TextBox ctrl = new TextBox(); + ctrl.AutoSize = true; + ctrl.Text = (string)aInfo.GetValue(aAction); + return ctrl; + } + //TODO: add support for other control type here return null; } @@ -195,6 +209,11 @@ { return true; } + else if (aInfo.PropertyType == typeof(string)) + { + return true; + } + //TODO: add support for other type here return false; } diff -r 471cb4c8a09a -r 6ccaa430aa23 Server/MainForm.cs --- a/Server/MainForm.cs Wed Jul 27 17:09:10 2016 +0200 +++ b/Server/MainForm.cs Thu Jul 28 19:32:40 2016 +0200 @@ -1575,9 +1575,9 @@ /// private void StartIdleClient(string aTopText = "", string aBottomText = "") { - Thread clientThread = new Thread(SharpDisplayIdleClient.Program.MainWithParams); - SharpDisplayIdleClient.StartParams myParams = - new SharpDisplayIdleClient.StartParams(new Point(this.Right, this.Top), aTopText, aBottomText); + Thread clientThread = new Thread(SharpDisplayClientIdle.Program.MainWithParams); + SharpDisplayClientIdle.StartParams myParams = + new SharpDisplayClientIdle.StartParams(new Point(this.Right, this.Top), aTopText, aBottomText); clientThread.Start(myParams); BringToFront(); } diff -r 471cb4c8a09a -r 6ccaa430aa23 Server/SharpDisplayManager.csproj --- a/Server/SharpDisplayManager.csproj Wed Jul 27 17:09:10 2016 +0200 +++ b/Server/SharpDisplayManager.csproj Thu Jul 28 19:32:40 2016 +0200 @@ -164,6 +164,7 @@ + @@ -255,6 +256,10 @@ {a76579e5-aa8d-45a3-99e1-239a5c030a78} SharpDisplayClientIdle + + {d9aad299-e97f-47e0-8e92-110f49f2b89c} + SharpDisplayClientMessage + {7ee64074-8cdb-4448-b40c-81b75d6b31cd} SharpDisplayClientTest diff -r 471cb4c8a09a -r 6ccaa430aa23 SharpDisplayManager.sln --- a/SharpDisplayManager.sln Wed Jul 27 17:09:10 2016 +0200 +++ b/SharpDisplayManager.sln Thu Jul 28 19:32:40 2016 +0200 @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDisplayManager", "Server\SharpDisplayManager.csproj", "{1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}" EndProject @@ -17,6 +17,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpLibEar", "SharpLibEar\SharpLibEar.csproj", "{84A9ED37-E6EA-4CBD-B995-B713F46EAAB0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDisplayClientMessage", "Clients\Message\SharpDisplayClientMessage.csproj", "{D9AAD299-E97F-47E0-8E92-110F49F2B89C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -103,6 +105,18 @@ {84A9ED37-E6EA-4CBD-B995-B713F46EAAB0}.Release|x64.Build.0 = Release|Any CPU {84A9ED37-E6EA-4CBD-B995-B713F46EAAB0}.Release|x86.ActiveCfg = Release|Any CPU {84A9ED37-E6EA-4CBD-B995-B713F46EAAB0}.Release|x86.Build.0 = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|x64.ActiveCfg = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|x64.Build.0 = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|x86.ActiveCfg = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Debug|x86.Build.0 = Debug|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|Any CPU.Build.0 = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|x64.ActiveCfg = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|x64.Build.0 = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|x86.ActiveCfg = Release|Any CPU + {D9AAD299-E97F-47E0-8E92-110F49F2B89C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE