# HG changeset patch # User sl # Date 1409494910 -7200 # Node ID ba4cad33db58ab36cd3c27176c72069a73780d1e # Parent eab73d41c9e613bf2cec1b3d0316b96721e6942e Renaming some of our new display settings classes. diff -r eab73d41c9e6 -r ba4cad33db58 Server/DisplaySettings.cs --- a/Server/DisplaySettings.cs Sun Aug 31 16:14:10 2014 +0200 +++ b/Server/DisplaySettings.cs Sun Aug 31 16:21:50 2014 +0200 @@ -13,12 +13,12 @@ namespace SharpDisplayManager { /// - /// Display settings a the specified hardware type + /// Display settings for the specified hardware type /// [DataContract] - public class DisplaySettingsEntry + public class DisplaySettings { - public DisplaySettingsEntry() + public DisplaySettings() { Brightness = 1; DisplayType = 0; @@ -31,6 +31,9 @@ [DataMember] public int Brightness { get; set; } + /// + /// See Display.TMiniDisplayType + /// [DataMember] public int DisplayType { get; set; } @@ -64,11 +67,14 @@ }; + /// + /// Contain settings for each of our display type. + /// [TypeConverter(typeof(DisplaySettingsConverter))] [DataContract] - public class DisplaySettings + public class DisplaysSettings { - public DisplaySettings() + public DisplaysSettings() { Init(); } @@ -77,7 +83,7 @@ { if (Displays == null) { - Displays = new List(); + Displays = new List(); } } @@ -85,13 +91,13 @@ //public int CurrentSettingsIndex { get; set; } [DataMember] - public List Displays { get; set; } + public List Displays { get; set; } public override string ToString() { //Save settings into JSON string MemoryStream stream = new MemoryStream(); - DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DisplaySettings)); + DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DisplaysSettings)); ser.WriteObject(stream, this); // convert stream to string stream.Position = 0; @@ -119,8 +125,8 @@ //Load settings form JSON string byte[] byteArray = Encoding.UTF8.GetBytes(stringValue); MemoryStream stream = new MemoryStream(byteArray); - DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DisplaySettings)); - DisplaySettings settings = (DisplaySettings)ser.ReadObject(stream); + DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DisplaysSettings)); + DisplaysSettings settings = (DisplaysSettings)ser.ReadObject(stream); settings.Init(); return settings; } diff -r eab73d41c9e6 -r ba4cad33db58 Server/MainForm.cs --- a/Server/MainForm.cs Sun Aug 31 16:14:10 2014 +0200 +++ b/Server/MainForm.cs Sun Aug 31 16:21:50 2014 +0200 @@ -319,19 +319,19 @@ /// /// CDS stands for Current Display Settings /// - private DisplaySettingsEntry cds + private DisplaySettings cds { get { - DisplaySettings settings = Properties.Settings.Default.DisplaySettings; + DisplaysSettings settings = Properties.Settings.Default.DisplaySettings; //Make sure all our settings have been created while (settings.Displays.Count <= Properties.Settings.Default.CurrentDisplayIndex) { - settings.Displays.Add(new DisplaySettingsEntry()); + settings.Displays.Add(new DisplaySettings()); } - DisplaySettingsEntry displaySettings = settings.Displays[Properties.Settings.Default.CurrentDisplayIndex]; + DisplaySettings displaySettings = settings.Displays[Properties.Settings.Default.CurrentDisplayIndex]; return displaySettings; } } diff -r eab73d41c9e6 -r ba4cad33db58 Server/Properties/Settings.Designer.cs --- a/Server/Properties/Settings.Designer.cs Sun Aug 31 16:14:10 2014 +0200 +++ b/Server/Properties/Settings.Designer.cs Sun Aug 31 16:21:50 2014 +0200 @@ -37,9 +37,9 @@ [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::SharpDisplayManager.DisplaySettings DisplaySettings { + public global::SharpDisplayManager.DisplaysSettings DisplaySettings { get { - return ((global::SharpDisplayManager.DisplaySettings)(this["DisplaySettings"])); + return ((global::SharpDisplayManager.DisplaysSettings)(this["DisplaySettings"])); } set { this["DisplaySettings"] = value;