Client now supports text alignment through our new TextField.
1.1 --- a/Client/App.config Fri Aug 22 10:55:34 2014 +0200
1.2 +++ b/Client/App.config Fri Aug 22 22:48:30 2014 +0200
1.3 @@ -1,6 +1,6 @@
1.4 -<?xml version="1.0" encoding="utf-8" ?>
1.5 +<?xml version="1.0"?>
1.6 <configuration>
1.7 <startup>
1.8 - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
1.9 + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
1.10 </startup>
1.11 -</configuration>
1.12 \ No newline at end of file
1.13 +</configuration>
2.1 --- a/Client/Client.cs Fri Aug 22 10:55:34 2014 +0200
2.2 +++ b/Client/Client.cs Fri Aug 22 22:48:30 2014 +0200
2.3 @@ -70,14 +70,14 @@
2.4 Channel.SetName(aClientName);
2.5 }
2.6
2.7 - public void SetText(int aLineIndex, string aText)
2.8 + public void SetText(TextField aTextField)
2.9 {
2.10 - Channel.SetText(aLineIndex, aText);
2.11 + Channel.SetText(aTextField);
2.12 }
2.13
2.14 - public void SetTexts(System.Collections.Generic.IList<string> aTexts)
2.15 + public void SetTexts(System.Collections.Generic.IList<TextField> aTextFields)
2.16 {
2.17 - Channel.SetTexts(aTexts);
2.18 + Channel.SetTexts(aTextFields);
2.19 }
2.20
2.21 public int ClientCount()
3.1 --- a/Client/MainForm.Designer.cs Fri Aug 22 10:55:34 2014 +0200
3.2 +++ b/Client/MainForm.Designer.cs Fri Aug 22 22:48:30 2014 +0200
3.3 @@ -31,11 +31,15 @@
3.4 this.buttonSetText = new System.Windows.Forms.Button();
3.5 this.textBoxTop = new System.Windows.Forms.TextBox();
3.6 this.textBoxBottom = new System.Windows.Forms.TextBox();
3.7 + this.buttonAlignRight = new System.Windows.Forms.Button();
3.8 + this.buttonAlignCenter = new System.Windows.Forms.Button();
3.9 + this.buttonAlignLeft = new System.Windows.Forms.Button();
3.10 + this.buttonSetTopText = new System.Windows.Forms.Button();
3.11 this.SuspendLayout();
3.12 //
3.13 // buttonSetText
3.14 //
3.15 - this.buttonSetText.Location = new System.Drawing.Point(12, 132);
3.16 + this.buttonSetText.Location = new System.Drawing.Point(13, 132);
3.17 this.buttonSetText.Name = "buttonSetText";
3.18 this.buttonSetText.Size = new System.Drawing.Size(75, 23);
3.19 this.buttonSetText.TabIndex = 0;
3.20 @@ -57,11 +61,55 @@
3.21 this.textBoxBottom.Size = new System.Drawing.Size(419, 20);
3.22 this.textBoxBottom.TabIndex = 2;
3.23 //
3.24 + // buttonAlignRight
3.25 + //
3.26 + this.buttonAlignRight.Location = new System.Drawing.Point(176, 160);
3.27 + this.buttonAlignRight.Name = "buttonAlignRight";
3.28 + this.buttonAlignRight.Size = new System.Drawing.Size(75, 23);
3.29 + this.buttonAlignRight.TabIndex = 23;
3.30 + this.buttonAlignRight.Text = "Align Right";
3.31 + this.buttonAlignRight.UseVisualStyleBackColor = true;
3.32 + this.buttonAlignRight.Click += new System.EventHandler(this.buttonAlignRight_Click);
3.33 + //
3.34 + // buttonAlignCenter
3.35 + //
3.36 + this.buttonAlignCenter.Location = new System.Drawing.Point(94, 161);
3.37 + this.buttonAlignCenter.Name = "buttonAlignCenter";
3.38 + this.buttonAlignCenter.Size = new System.Drawing.Size(75, 23);
3.39 + this.buttonAlignCenter.TabIndex = 22;
3.40 + this.buttonAlignCenter.Text = "Align Center";
3.41 + this.buttonAlignCenter.UseVisualStyleBackColor = true;
3.42 + this.buttonAlignCenter.Click += new System.EventHandler(this.buttonAlignCenter_Click);
3.43 + //
3.44 + // buttonAlignLeft
3.45 + //
3.46 + this.buttonAlignLeft.Location = new System.Drawing.Point(12, 161);
3.47 + this.buttonAlignLeft.Name = "buttonAlignLeft";
3.48 + this.buttonAlignLeft.Size = new System.Drawing.Size(75, 23);
3.49 + this.buttonAlignLeft.TabIndex = 21;
3.50 + this.buttonAlignLeft.Text = "Align Left";
3.51 + this.buttonAlignLeft.UseVisualStyleBackColor = true;
3.52 + this.buttonAlignLeft.Click += new System.EventHandler(this.buttonAlignLeft_Click);
3.53 + //
3.54 + // buttonSetTopText
3.55 + //
3.56 + this.buttonSetTopText.Location = new System.Drawing.Point(94, 132);
3.57 + this.buttonSetTopText.Name = "buttonSetTopText";
3.58 + this.buttonSetTopText.Size = new System.Drawing.Size(75, 23);
3.59 + this.buttonSetTopText.TabIndex = 24;
3.60 + this.buttonSetTopText.Text = "Set Top Text";
3.61 + this.buttonSetTopText.UseVisualStyleBackColor = true;
3.62 + this.buttonSetTopText.Click += new System.EventHandler(this.buttonSetTopText_Click);
3.63 + //
3.64 // MainForm
3.65 //
3.66 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
3.67 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
3.68 this.ClientSize = new System.Drawing.Size(443, 252);
3.69 + this.Controls.Add(this.buttonSetTopText);
3.70 + this.Controls.Add(this.buttonAlignRight);
3.71 + this.Controls.Add(this.buttonAlignCenter);
3.72 + this.Controls.Add(this.buttonAlignLeft);
3.73 this.Controls.Add(this.textBoxBottom);
3.74 this.Controls.Add(this.textBoxTop);
3.75 this.Controls.Add(this.buttonSetText);
3.76 @@ -79,6 +127,10 @@
3.77 private System.Windows.Forms.Button buttonSetText;
3.78 private System.Windows.Forms.TextBox textBoxTop;
3.79 private System.Windows.Forms.TextBox textBoxBottom;
3.80 + private System.Windows.Forms.Button buttonAlignRight;
3.81 + private System.Windows.Forms.Button buttonAlignCenter;
3.82 + private System.Windows.Forms.Button buttonAlignLeft;
3.83 + private System.Windows.Forms.Button buttonSetTopText;
3.84 }
3.85 }
3.86
4.1 --- a/Client/MainForm.cs Fri Aug 22 10:55:34 2014 +0200
4.2 +++ b/Client/MainForm.cs Fri Aug 22 22:48:30 2014 +0200
4.3 @@ -10,6 +10,7 @@
4.4 using System.ServiceModel;
4.5 using System.ServiceModel.Channels;
4.6 using System.Diagnostics;
4.7 +using SharpDisplayInterface;
4.8
4.9
4.10 namespace SharpDisplayClient
4.11 @@ -18,18 +19,16 @@
4.12 {
4.13 Client iClient;
4.14 Callback iCallback;
4.15 + ContentAlignment Alignment;
4.16 + TextField iTextFieldTop;
4.17
4.18 public MainForm()
4.19 {
4.20 InitializeComponent();
4.21 + Alignment = ContentAlignment.MiddleLeft;
4.22 + iTextFieldTop = new TextField(0);
4.23 }
4.24
4.25 - private void buttonSetText_Click(object sender, EventArgs e)
4.26 - {
4.27 - //iClient.SetText(0,"Top");
4.28 - //iClient.SetText(1, "Bottom");
4.29 - iClient.SetTexts(new string[] { textBoxTop.Text, textBoxBottom.Text });
4.30 - }
4.31
4.32 private void MainForm_Load(object sender, EventArgs e)
4.33 {
4.34 @@ -110,5 +109,46 @@
4.35 {
4.36 return (iClient != null && iClient.State == CommunicationState.Opened);
4.37 }
4.38 +
4.39 + private void buttonAlignLeft_Click(object sender, EventArgs e)
4.40 + {
4.41 + Alignment = ContentAlignment.MiddleLeft;
4.42 + textBoxTop.TextAlign = HorizontalAlignment.Left;
4.43 + textBoxBottom.TextAlign = HorizontalAlignment.Left;
4.44 + }
4.45 +
4.46 + private void buttonAlignCenter_Click(object sender, EventArgs e)
4.47 + {
4.48 + Alignment = ContentAlignment.MiddleCenter;
4.49 + textBoxTop.TextAlign = HorizontalAlignment.Center;
4.50 + textBoxBottom.TextAlign = HorizontalAlignment.Center;
4.51 + }
4.52 +
4.53 + private void buttonAlignRight_Click(object sender, EventArgs e)
4.54 + {
4.55 + Alignment = ContentAlignment.MiddleRight;
4.56 + textBoxTop.TextAlign = HorizontalAlignment.Right;
4.57 + textBoxBottom.TextAlign = HorizontalAlignment.Right;
4.58 + }
4.59 +
4.60 + private void buttonSetTopText_Click(object sender, EventArgs e)
4.61 + {
4.62 + //TextField top = new TextField(0, textBoxTop.Text, ContentAlignment.MiddleLeft);
4.63 + iTextFieldTop.Text = textBoxTop.Text;
4.64 + iClient.SetText(iTextFieldTop);
4.65 + }
4.66 +
4.67 + private void buttonSetText_Click(object sender, EventArgs e)
4.68 + {
4.69 + //iClient.SetText(0,"Top");
4.70 + //iClient.SetText(1, "Bottom");
4.71 + //TextField top = new TextField(0, textBoxTop.Text, ContentAlignment.MiddleLeft);
4.72 +
4.73 + iClient.SetTexts(new TextField[]
4.74 + {
4.75 + new TextField(0, textBoxTop.Text, Alignment),
4.76 + new TextField(1, textBoxBottom.Text, Alignment)
4.77 + });
4.78 + }
4.79 }
4.80 }
5.1 --- a/Client/Properties/Resources.Designer.cs Fri Aug 22 10:55:34 2014 +0200
5.2 +++ b/Client/Properties/Resources.Designer.cs Fri Aug 22 22:48:30 2014 +0200
5.3 @@ -8,10 +8,10 @@
5.4 // </auto-generated>
5.5 //------------------------------------------------------------------------------
5.6
5.7 -namespace SharpDisplayClient.Properties
5.8 -{
5.9 -
5.10 -
5.11 +namespace SharpDisplayClient.Properties {
5.12 + using System;
5.13 +
5.14 +
5.15 /// <summary>
5.16 /// A strongly-typed resource class, for looking up localized strings, etc.
5.17 /// </summary>
5.18 @@ -22,48 +22,40 @@
5.19 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
5.20 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
5.21 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
5.22 - internal class Resources
5.23 - {
5.24 -
5.25 + internal class Resources {
5.26 +
5.27 private static global::System.Resources.ResourceManager resourceMan;
5.28 -
5.29 +
5.30 private static global::System.Globalization.CultureInfo resourceCulture;
5.31 -
5.32 +
5.33 [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
5.34 - internal Resources()
5.35 - {
5.36 + internal Resources() {
5.37 }
5.38 -
5.39 +
5.40 /// <summary>
5.41 /// Returns the cached ResourceManager instance used by this class.
5.42 /// </summary>
5.43 [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
5.44 - internal static global::System.Resources.ResourceManager ResourceManager
5.45 - {
5.46 - get
5.47 - {
5.48 - if ((resourceMan == null))
5.49 - {
5.50 + internal static global::System.Resources.ResourceManager ResourceManager {
5.51 + get {
5.52 + if (object.ReferenceEquals(resourceMan, null)) {
5.53 global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpDisplayClient.Properties.Resources", typeof(Resources).Assembly);
5.54 resourceMan = temp;
5.55 }
5.56 return resourceMan;
5.57 }
5.58 }
5.59 -
5.60 +
5.61 /// <summary>
5.62 /// Overrides the current thread's CurrentUICulture property for all
5.63 /// resource lookups using this strongly typed resource class.
5.64 /// </summary>
5.65 [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
5.66 - internal static global::System.Globalization.CultureInfo Culture
5.67 - {
5.68 - get
5.69 - {
5.70 + internal static global::System.Globalization.CultureInfo Culture {
5.71 + get {
5.72 return resourceCulture;
5.73 }
5.74 - set
5.75 - {
5.76 + set {
5.77 resourceCulture = value;
5.78 }
5.79 }
6.1 --- a/Client/Properties/Settings.Designer.cs Fri Aug 22 10:55:34 2014 +0200
6.2 +++ b/Client/Properties/Settings.Designer.cs Fri Aug 22 22:48:30 2014 +0200
6.3 @@ -8,21 +8,17 @@
6.4 // </auto-generated>
6.5 //------------------------------------------------------------------------------
6.6
6.7 -namespace SharpDisplayClient.Properties
6.8 -{
6.9 -
6.10 -
6.11 +namespace SharpDisplayClient.Properties {
6.12 +
6.13 +
6.14 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
6.15 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
6.16 - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
6.17 - {
6.18 -
6.19 + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
6.20 +
6.21 private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
6.22 -
6.23 - public static Settings Default
6.24 - {
6.25 - get
6.26 - {
6.27 +
6.28 + public static Settings Default {
6.29 + get {
6.30 return defaultInstance;
6.31 }
6.32 }
7.1 --- a/Client/SharpDisplayClient.csproj Fri Aug 22 10:55:34 2014 +0200
7.2 +++ b/Client/SharpDisplayClient.csproj Fri Aug 22 22:48:30 2014 +0200
7.3 @@ -11,6 +11,7 @@
7.4 <AssemblyName>SharpDisplayClient</AssemblyName>
7.5 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
7.6 <FileAlignment>512</FileAlignment>
7.7 + <TargetFrameworkProfile />
7.8 </PropertyGroup>
7.9 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
7.10 <PlatformTarget>AnyCPU</PlatformTarget>
7.11 @@ -21,6 +22,7 @@
7.12 <DefineConstants>DEBUG;TRACE</DefineConstants>
7.13 <ErrorReport>prompt</ErrorReport>
7.14 <WarningLevel>4</WarningLevel>
7.15 + <Prefer32Bit>false</Prefer32Bit>
7.16 </PropertyGroup>
7.17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
7.18 <PlatformTarget>AnyCPU</PlatformTarget>
7.19 @@ -30,6 +32,27 @@
7.20 <DefineConstants>TRACE</DefineConstants>
7.21 <ErrorReport>prompt</ErrorReport>
7.22 <WarningLevel>4</WarningLevel>
7.23 + <Prefer32Bit>false</Prefer32Bit>
7.24 + </PropertyGroup>
7.25 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
7.26 + <DebugSymbols>true</DebugSymbols>
7.27 + <OutputPath>..\..\bin\MiniDisplay\Debug\</OutputPath>
7.28 + <DefineConstants>DEBUG;TRACE</DefineConstants>
7.29 + <DebugType>full</DebugType>
7.30 + <PlatformTarget>x86</PlatformTarget>
7.31 + <ErrorReport>prompt</ErrorReport>
7.32 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
7.33 + <Prefer32Bit>false</Prefer32Bit>
7.34 + </PropertyGroup>
7.35 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
7.36 + <OutputPath>bin\x86\Release\</OutputPath>
7.37 + <DefineConstants>TRACE</DefineConstants>
7.38 + <Optimize>true</Optimize>
7.39 + <DebugType>pdbonly</DebugType>
7.40 + <PlatformTarget>x86</PlatformTarget>
7.41 + <ErrorReport>prompt</ErrorReport>
7.42 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
7.43 + <Prefer32Bit>false</Prefer32Bit>
7.44 </PropertyGroup>
7.45 <ItemGroup>
7.46 <Reference Include="System" />
7.47 @@ -65,6 +88,7 @@
7.48 <Compile Include="Properties\Resources.Designer.cs">
7.49 <AutoGen>True</AutoGen>
7.50 <DependentUpon>Resources.resx</DependentUpon>
7.51 + <DesignTime>True</DesignTime>
7.52 </Compile>
7.53 <None Include="Properties\Settings.settings">
7.54 <Generator>SettingsSingleFileGenerator</Generator>
8.1 --- a/Interface/Interface.cs Fri Aug 22 10:55:34 2014 +0200
8.2 +++ b/Interface/Interface.cs Fri Aug 22 22:48:30 2014 +0200
8.3 @@ -5,11 +5,40 @@
8.4 using System.Threading.Tasks;
8.5 using System.ServiceModel;
8.6 using System.Collections;
8.7 +using System.Drawing;
8.8 +using System.Runtime.Serialization;
8.9
8.10
8.11 namespace SharpDisplayInterface
8.12 {
8.13 -
8.14 + [DataContract]
8.15 + public class TextField
8.16 + {
8.17 + public TextField()
8.18 + {
8.19 + Index = 0;
8.20 + Text = "";
8.21 + Alignment = ContentAlignment.MiddleLeft;
8.22 + }
8.23 +
8.24 + public TextField(int aIndex, string aText = "", ContentAlignment aAlignment = ContentAlignment.MiddleLeft)
8.25 + {
8.26 + Index = aIndex;
8.27 + Text = aText;
8.28 + Alignment = aAlignment;
8.29 + }
8.30 +
8.31 + [DataMember]
8.32 + public int Index { get; set; }
8.33 +
8.34 + [DataMember]
8.35 + public string Text { get; set; }
8.36 +
8.37 + [DataMember]
8.38 + public ContentAlignment Alignment { get; set; }
8.39 + }
8.40 +
8.41 +
8.42 [ServiceContract( CallbackContract = typeof(IDisplayServiceCallback),
8.43 SessionMode = SessionMode.Required)]
8.44 public interface IDisplayService
8.45 @@ -28,19 +57,16 @@
8.46 /// Put the given text in the given field on your display.
8.47 /// Fields are often just lines of text.
8.48 /// </summary>
8.49 - /// <param name="aFieldIndex"></param>
8.50 - /// <param name="aText"></param>
8.51 + /// <param name="aTextFieldIndex"></param>
8.52 [OperationContract(IsOneWay = true)]
8.53 - void SetText(int aFieldIndex, string aText);
8.54 + void SetText(TextField aTextField);
8.55
8.56 /// <summary>
8.57 /// Allows a client to set multiple text fields at once.
8.58 - /// First text in the list is set into field index 0.
8.59 - /// Last text in the list is set into field index N-1.
8.60 /// </summary>
8.61 /// <param name="aTexts"></param>
8.62 [OperationContract(IsOneWay = true)]
8.63 - void SetTexts(System.Collections.Generic.IList<string> aTexts);
8.64 + void SetTexts(System.Collections.Generic.IList<TextField> aTextFields);
8.65
8.66 /// <summary>
8.67 /// Provides the number of clients currently connected
9.1 --- a/Interface/SharpDisplayInterface.csproj Fri Aug 22 10:55:34 2014 +0200
9.2 +++ b/Interface/SharpDisplayInterface.csproj Fri Aug 22 22:48:30 2014 +0200
9.3 @@ -11,6 +11,7 @@
9.4 <AssemblyName>SharpDisplayInterface</AssemblyName>
9.5 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
9.6 <FileAlignment>512</FileAlignment>
9.7 + <TargetFrameworkProfile />
9.8 </PropertyGroup>
9.9 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
9.10 <DebugSymbols>true</DebugSymbols>
9.11 @@ -20,6 +21,7 @@
9.12 <DefineConstants>DEBUG;TRACE</DefineConstants>
9.13 <ErrorReport>prompt</ErrorReport>
9.14 <WarningLevel>4</WarningLevel>
9.15 + <Prefer32Bit>false</Prefer32Bit>
9.16 </PropertyGroup>
9.17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
9.18 <DebugType>pdbonly</DebugType>
9.19 @@ -28,10 +30,33 @@
9.20 <DefineConstants>TRACE</DefineConstants>
9.21 <ErrorReport>prompt</ErrorReport>
9.22 <WarningLevel>4</WarningLevel>
9.23 + <Prefer32Bit>false</Prefer32Bit>
9.24 + </PropertyGroup>
9.25 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
9.26 + <DebugSymbols>true</DebugSymbols>
9.27 + <OutputPath>..\..\bin\MiniDisplay\Debug\</OutputPath>
9.28 + <DefineConstants>DEBUG;TRACE</DefineConstants>
9.29 + <DebugType>full</DebugType>
9.30 + <PlatformTarget>x86</PlatformTarget>
9.31 + <ErrorReport>prompt</ErrorReport>
9.32 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
9.33 + <Prefer32Bit>false</Prefer32Bit>
9.34 + </PropertyGroup>
9.35 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
9.36 + <OutputPath>bin\x86\Release\</OutputPath>
9.37 + <DefineConstants>TRACE</DefineConstants>
9.38 + <Optimize>true</Optimize>
9.39 + <DebugType>pdbonly</DebugType>
9.40 + <PlatformTarget>x86</PlatformTarget>
9.41 + <ErrorReport>prompt</ErrorReport>
9.42 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
9.43 + <Prefer32Bit>false</Prefer32Bit>
9.44 </PropertyGroup>
9.45 <ItemGroup>
9.46 <Reference Include="System" />
9.47 <Reference Include="System.Core" />
9.48 + <Reference Include="System.Drawing" />
9.49 + <Reference Include="System.Runtime.Serialization" />
9.50 <Reference Include="System.ServiceModel" />
9.51 <Reference Include="System.Xml.Linq" />
9.52 <Reference Include="System.Data.DataSetExtensions" />
10.1 --- a/Server/App.config Fri Aug 22 10:55:34 2014 +0200
10.2 +++ b/Server/App.config Fri Aug 22 22:48:30 2014 +0200
10.3 @@ -1,12 +1,12 @@
10.4 -<?xml version="1.0" encoding="utf-8" ?>
10.5 +<?xml version="1.0"?>
10.6 <configuration>
10.7 <configSections>
10.8 - <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
10.9 - <section name="SharpDisplayManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
10.10 + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
10.11 + <section name="SharpDisplayManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
10.12 </sectionGroup>
10.13 </configSections>
10.14 <startup>
10.15 - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
10.16 + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
10.17 </startup>
10.18 <userSettings>
10.19 <SharpDisplayManager.Properties.Settings>
10.20 @@ -27,4 +27,4 @@
10.21 </setting>
10.22 </SharpDisplayManager.Properties.Settings>
10.23 </userSettings>
10.24 -</configuration>
10.25 \ No newline at end of file
10.26 +</configuration>
11.1 --- a/Server/MainForm.cs Fri Aug 22 10:55:34 2014 +0200
11.2 +++ b/Server/MainForm.cs Fri Aug 22 22:48:30 2014 +0200
11.3 @@ -479,8 +479,8 @@
11.4 //Delegates are used for our thread safe method
11.5 public delegate void AddClientDelegate(string aSessionId, IDisplayServiceCallback aCallback);
11.6 public delegate void RemoveClientDelegate(string aSessionId);
11.7 - public delegate void SetTextDelegate(string SessionId, int aLineIndex, string aText);
11.8 - public delegate void SetTextsDelegate(string SessionId, System.Collections.Generic.IList<string> aTexts);
11.9 + public delegate void SetTextDelegate(string SessionId, TextField aTextField);
11.10 + public delegate void SetTextsDelegate(string SessionId, System.Collections.Generic.IList<TextField> aTextFields);
11.11 public delegate void SetClientNameDelegate(string aSessionId, string aName);
11.12
11.13
11.14 @@ -546,13 +546,13 @@
11.15 /// </summary>
11.16 /// <param name="aLineIndex"></param>
11.17 /// <param name="aText"></param>
11.18 - public void SetTextThreadSafe(string aSessionId, int aLineIndex, string aText)
11.19 + public void SetTextThreadSafe(string aSessionId, TextField aTextField)
11.20 {
11.21 if (this.InvokeRequired)
11.22 {
11.23 //Not in the proper thread, invoke ourselves
11.24 SetTextDelegate d = new SetTextDelegate(SetTextThreadSafe);
11.25 - this.Invoke(d, new object[] { aSessionId, aLineIndex, aText });
11.26 + this.Invoke(d, new object[] { aSessionId, aTextField });
11.27 }
11.28 else
11.29 {
11.30 @@ -560,21 +560,24 @@
11.31 if (client != null)
11.32 {
11.33 //Make sure all our texts are in place
11.34 - while (client.Texts.Count < (aLineIndex + 1))
11.35 + while (client.Texts.Count < (aTextField.Index + 1))
11.36 {
11.37 - client.Texts.Add("");
11.38 + //Add a text field with proper index
11.39 + client.Texts.Add(new TextField(client.Texts.Count));
11.40 }
11.41 - client.Texts[aLineIndex] = aText;
11.42 + client.Texts[aTextField.Index] = aTextField;
11.43
11.44 //We are in the proper thread
11.45 //Only support two lines for now
11.46 - if (aLineIndex == 0)
11.47 + if (aTextField.Index == 0)
11.48 {
11.49 - marqueeLabelTop.Text = aText;
11.50 + marqueeLabelTop.Text = aTextField.Text;
11.51 + marqueeLabelTop.TextAlign = aTextField.Alignment;
11.52 }
11.53 - else if (aLineIndex == 1)
11.54 + else if (aTextField.Index == 1)
11.55 {
11.56 - marqueeLabelBottom.Text = aText;
11.57 + marqueeLabelBottom.Text = aTextField.Text;
11.58 + marqueeLabelBottom.TextAlign = aTextField.Alignment;
11.59 }
11.60
11.61
11.62 @@ -587,44 +590,46 @@
11.63 ///
11.64 /// </summary>
11.65 /// <param name="aTexts"></param>
11.66 - public void SetTextsThreadSafe(string aSessionId, System.Collections.Generic.IList<string> aTexts)
11.67 + public void SetTextsThreadSafe(string aSessionId, System.Collections.Generic.IList<TextField> aTextFields)
11.68 {
11.69 if (this.InvokeRequired)
11.70 {
11.71 //Not in the proper thread, invoke ourselves
11.72 SetTextsDelegate d = new SetTextsDelegate(SetTextsThreadSafe);
11.73 - this.Invoke(d, new object[] { aSessionId, aTexts });
11.74 + this.Invoke(d, new object[] { aSessionId, aTextFields });
11.75 }
11.76 else
11.77 {
11.78 + //We are in the proper thread
11.79 ClientData client = iClients[aSessionId];
11.80 if (client != null)
11.81 {
11.82 - //Populate our client with the given texts
11.83 + //Populate our client with the given text fields
11.84 int j = 0;
11.85 - foreach (string text in aTexts)
11.86 + foreach (TextField textField in aTextFields)
11.87 {
11.88 if (client.Texts.Count < (j + 1))
11.89 {
11.90 - client.Texts.Add(text);
11.91 + client.Texts.Add(textField);
11.92 }
11.93 else
11.94 {
11.95 - client.Texts[j]=text;
11.96 + client.Texts[j] = textField;
11.97 }
11.98 j++;
11.99 - }
11.100 - //We are in the proper thread
11.101 + }
11.102 //Only support two lines for now
11.103 - for (int i = 0; i < aTexts.Count; i++)
11.104 + for (int i = 0; i < aTextFields.Count; i++)
11.105 {
11.106 - if (i == 0)
11.107 + if (aTextFields[i].Index == 0)
11.108 {
11.109 - marqueeLabelTop.Text = aTexts[i];
11.110 + marqueeLabelTop.Text = aTextFields[i].Text;
11.111 + marqueeLabelTop.TextAlign = aTextFields[i].Alignment;
11.112 }
11.113 - else if (i == 1)
11.114 + else if (aTextFields[i].Index == 1)
11.115 {
11.116 - marqueeLabelBottom.Text = aTexts[i];
11.117 + marqueeLabelBottom.Text = aTextFields[i].Text;
11.118 + marqueeLabelBottom.TextAlign = aTextFields[i].Alignment;
11.119 }
11.120 }
11.121
11.122 @@ -714,9 +719,9 @@
11.123 TreeNode textsRoot = new TreeNode("Text");
11.124 node.Nodes.Add(textsRoot);
11.125 //For each text add a new entry
11.126 - foreach (string text in aClient.Texts)
11.127 + foreach (TextField field in aClient.Texts)
11.128 {
11.129 - textsRoot.Nodes.Add(new TreeNode(text));
11.130 + textsRoot.Nodes.Add(new TreeNode(field.Text));
11.131 }
11.132 }
11.133
11.134 @@ -790,13 +795,13 @@
11.135 {
11.136 SessionId = aSessionId;
11.137 Name = "";
11.138 - Texts = new List<string>();
11.139 + Texts = new List<TextField>();
11.140 Callback = aCallback;
11.141 }
11.142
11.143 public string SessionId { get; set; }
11.144 public string Name { get; set; }
11.145 - public List<string> Texts { get; set; }
11.146 + public List<TextField> Texts { get; set; }
11.147 public IDisplayServiceCallback Callback { get; set; }
11.148 }
11.149 }
12.1 --- a/Server/Properties/Resources.Designer.cs Fri Aug 22 10:55:34 2014 +0200
12.2 +++ b/Server/Properties/Resources.Designer.cs Fri Aug 22 22:48:30 2014 +0200
12.3 @@ -1,17 +1,17 @@
12.4 //------------------------------------------------------------------------------
12.5 // <auto-generated>
12.6 // This code was generated by a tool.
12.7 -// Runtime Version:4.0.30319.18063
12.8 +// Runtime Version:4.0.30319.18444
12.9 //
12.10 // Changes to this file may cause incorrect behavior and will be lost if
12.11 // the code is regenerated.
12.12 // </auto-generated>
12.13 //------------------------------------------------------------------------------
12.14
12.15 -namespace SharpDisplayManager.Properties
12.16 -{
12.17 -
12.18 -
12.19 +namespace SharpDisplayManager.Properties {
12.20 + using System;
12.21 +
12.22 +
12.23 /// <summary>
12.24 /// A strongly-typed resource class, for looking up localized strings, etc.
12.25 /// </summary>
12.26 @@ -22,48 +22,40 @@
12.27 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
12.28 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
12.29 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
12.30 - internal class Resources
12.31 - {
12.32 -
12.33 + internal class Resources {
12.34 +
12.35 private static global::System.Resources.ResourceManager resourceMan;
12.36 -
12.37 +
12.38 private static global::System.Globalization.CultureInfo resourceCulture;
12.39 -
12.40 +
12.41 [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
12.42 - internal Resources()
12.43 - {
12.44 + internal Resources() {
12.45 }
12.46 -
12.47 +
12.48 /// <summary>
12.49 /// Returns the cached ResourceManager instance used by this class.
12.50 /// </summary>
12.51 [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
12.52 - internal static global::System.Resources.ResourceManager ResourceManager
12.53 - {
12.54 - get
12.55 - {
12.56 - if ((resourceMan == null))
12.57 - {
12.58 + internal static global::System.Resources.ResourceManager ResourceManager {
12.59 + get {
12.60 + if (object.ReferenceEquals(resourceMan, null)) {
12.61 global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SharpDisplayManager.Properties.Resources", typeof(Resources).Assembly);
12.62 resourceMan = temp;
12.63 }
12.64 return resourceMan;
12.65 }
12.66 }
12.67 -
12.68 +
12.69 /// <summary>
12.70 /// Overrides the current thread's CurrentUICulture property for all
12.71 /// resource lookups using this strongly typed resource class.
12.72 /// </summary>
12.73 [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
12.74 - internal static global::System.Globalization.CultureInfo Culture
12.75 - {
12.76 - get
12.77 - {
12.78 + internal static global::System.Globalization.CultureInfo Culture {
12.79 + get {
12.80 return resourceCulture;
12.81 }
12.82 - set
12.83 - {
12.84 + set {
12.85 resourceCulture = value;
12.86 }
12.87 }
13.1 --- a/Server/Servers.cs Fri Aug 22 10:55:34 2014 +0200
13.2 +++ b/Server/Servers.cs Fri Aug 22 22:48:30 2014 +0200
13.3 @@ -40,15 +40,15 @@
13.4 }
13.5
13.6 //From IDisplayService
13.7 - public void SetTexts(System.Collections.Generic.IList<string> aTexts)
13.8 + public void SetTexts(System.Collections.Generic.IList<TextField> aTextFields)
13.9 {
13.10 - Program.iMainForm.SetTextsThreadSafe(SessionId, aTexts);
13.11 + Program.iMainForm.SetTextsThreadSafe(SessionId, aTextFields);
13.12 }
13.13
13.14 //
13.15 - public void SetText(int aLineIndex, string aText)
13.16 + public void SetText(TextField aTextField)
13.17 {
13.18 - Program.iMainForm.SetTextThreadSafe(SessionId, aLineIndex, aText);
13.19 + Program.iMainForm.SetTextThreadSafe(SessionId, aTextField);
13.20 }
13.21
13.22 //
14.1 --- a/Server/SharpDisplayManager.csproj Fri Aug 22 10:55:34 2014 +0200
14.2 +++ b/Server/SharpDisplayManager.csproj Fri Aug 22 22:48:30 2014 +0200
14.3 @@ -11,6 +11,22 @@
14.4 <AssemblyName>SharpDisplayManager</AssemblyName>
14.5 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14.6 <FileAlignment>512</FileAlignment>
14.7 + <TargetFrameworkProfile />
14.8 + <PublishUrl>publish\</PublishUrl>
14.9 + <Install>true</Install>
14.10 + <InstallFrom>Disk</InstallFrom>
14.11 + <UpdateEnabled>false</UpdateEnabled>
14.12 + <UpdateMode>Foreground</UpdateMode>
14.13 + <UpdateInterval>7</UpdateInterval>
14.14 + <UpdateIntervalUnits>Days</UpdateIntervalUnits>
14.15 + <UpdatePeriodically>false</UpdatePeriodically>
14.16 + <UpdateRequired>false</UpdateRequired>
14.17 + <MapFileExtensions>true</MapFileExtensions>
14.18 + <ApplicationRevision>0</ApplicationRevision>
14.19 + <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
14.20 + <IsWebBootstrapper>false</IsWebBootstrapper>
14.21 + <UseApplicationTrust>false</UseApplicationTrust>
14.22 + <BootstrapperEnabled>true</BootstrapperEnabled>
14.23 </PropertyGroup>
14.24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14.25 <PlatformTarget>AnyCPU</PlatformTarget>
14.26 @@ -21,6 +37,7 @@
14.27 <DefineConstants>DEBUG;TRACE</DefineConstants>
14.28 <ErrorReport>prompt</ErrorReport>
14.29 <WarningLevel>4</WarningLevel>
14.30 + <Prefer32Bit>false</Prefer32Bit>
14.31 </PropertyGroup>
14.32 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
14.33 <PlatformTarget>AnyCPU</PlatformTarget>
14.34 @@ -30,6 +47,27 @@
14.35 <DefineConstants>TRACE</DefineConstants>
14.36 <ErrorReport>prompt</ErrorReport>
14.37 <WarningLevel>4</WarningLevel>
14.38 + <Prefer32Bit>false</Prefer32Bit>
14.39 + </PropertyGroup>
14.40 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
14.41 + <DebugSymbols>true</DebugSymbols>
14.42 + <OutputPath>..\..\bin\MiniDisplay\Debug\</OutputPath>
14.43 + <DefineConstants>DEBUG;TRACE</DefineConstants>
14.44 + <DebugType>full</DebugType>
14.45 + <PlatformTarget>x86</PlatformTarget>
14.46 + <ErrorReport>prompt</ErrorReport>
14.47 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
14.48 + <Prefer32Bit>false</Prefer32Bit>
14.49 + </PropertyGroup>
14.50 + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
14.51 + <OutputPath>bin\x86\Release\</OutputPath>
14.52 + <DefineConstants>TRACE</DefineConstants>
14.53 + <Optimize>true</Optimize>
14.54 + <DebugType>pdbonly</DebugType>
14.55 + <PlatformTarget>x86</PlatformTarget>
14.56 + <ErrorReport>prompt</ErrorReport>
14.57 + <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
14.58 + <Prefer32Bit>false</Prefer32Bit>
14.59 </PropertyGroup>
14.60 <ItemGroup>
14.61 <Reference Include="Microsoft.VisualBasic" />
14.62 @@ -75,6 +113,7 @@
14.63 <Compile Include="Properties\Resources.Designer.cs">
14.64 <AutoGen>True</AutoGen>
14.65 <DependentUpon>Resources.resx</DependentUpon>
14.66 + <DesignTime>True</DesignTime>
14.67 </Compile>
14.68 <None Include="Properties\Settings.settings">
14.69 <Generator>SettingsSingleFileGenerator</Generator>
14.70 @@ -99,6 +138,28 @@
14.71 <Name>SharpDisplayInterface</Name>
14.72 </ProjectReference>
14.73 </ItemGroup>
14.74 + <ItemGroup>
14.75 + <BootstrapperPackage Include=".NETFramework,Version=v4.0">
14.76 + <Visible>False</Visible>
14.77 + <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
14.78 + <Install>true</Install>
14.79 + </BootstrapperPackage>
14.80 + <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
14.81 + <Visible>False</Visible>
14.82 + <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
14.83 + <Install>false</Install>
14.84 + </BootstrapperPackage>
14.85 + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
14.86 + <Visible>False</Visible>
14.87 + <ProductName>.NET Framework 3.5 SP1</ProductName>
14.88 + <Install>false</Install>
14.89 + </BootstrapperPackage>
14.90 + <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
14.91 + <Visible>False</Visible>
14.92 + <ProductName>Windows Installer 4.5</ProductName>
14.93 + <Install>true</Install>
14.94 + </BootstrapperPackage>
14.95 + </ItemGroup>
14.96 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
14.97 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
14.98 Other similar extension points exist, see Microsoft.Common.targets.
15.1 --- a/SharpDisplayManager.sln Fri Aug 22 10:55:34 2014 +0200
15.2 +++ b/SharpDisplayManager.sln Fri Aug 22 22:48:30 2014 +0200
15.3 @@ -10,21 +10,33 @@
15.4 Global
15.5 GlobalSection(SolutionConfigurationPlatforms) = preSolution
15.6 Debug|Any CPU = Debug|Any CPU
15.7 + Debug|x86 = Debug|x86
15.8 Release|Any CPU = Release|Any CPU
15.9 + Release|x86 = Release|x86
15.10 EndGlobalSection
15.11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
15.12 {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15.13 {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Debug|Any CPU.Build.0 = Debug|Any CPU
15.14 + {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Debug|x86.ActiveCfg = Debug|x86
15.15 + {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Debug|x86.Build.0 = Debug|x86
15.16 {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Release|Any CPU.ActiveCfg = Release|Any CPU
15.17 {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Release|Any CPU.Build.0 = Release|Any CPU
15.18 + {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Release|x86.ActiveCfg = Release|x86
15.19 + {1DA8C1B3-18C5-4E74-BE4E-0B0E15FBAF49}.Release|x86.Build.0 = Release|x86
15.20 {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15.21 {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
15.22 + {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Debug|x86.ActiveCfg = Debug|x86
15.23 + {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Debug|x86.Build.0 = Debug|x86
15.24 {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
15.25 {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Release|Any CPU.Build.0 = Release|Any CPU
15.26 + {7EE64074-8CDB-4448-B40C-81B75D6B31CD}.Release|x86.ActiveCfg = Release|Any CPU
15.27 {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15.28 {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
15.29 + {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Debug|x86.ActiveCfg = Debug|x86
15.30 + {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Debug|x86.Build.0 = Debug|x86
15.31 {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
15.32 {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Release|Any CPU.Build.0 = Release|Any CPU
15.33 + {88EEE0DC-ABBC-4738-BAD6-7E08CF7F50F9}.Release|x86.ActiveCfg = Release|Any CPU
15.34 EndGlobalSection
15.35 GlobalSection(SolutionProperties) = preSolution
15.36 HideSolutionNode = FALSE