diff --git a/WebWindowComplex/Models/AGBOptionCombo.cs b/WebWindowComplex/Models/AGBOptionCombo.cs new file mode 100644 index 0000000..8413114 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionCombo.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionCombo : ParametriOpzioni + { + #region Public Constructors + + public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) + { + m_Type = HDWOPTIONTYPES.COMBO; + foreach (var Value in HdwOptionParam.Opzioni) + m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); + m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); + } + + #endregion Public Constructors + + #region Public Properties + + public AGBOptionParameter sValue + { + get + { + return m_sValue; + } + set + { + m_sValue = value; + } + } + + public List ValueList + { + get + { + return m_ValueList; + } + } + + #endregion Public Properties + + #region Private Fields + + private AGBOptionParameter m_sValue; + private List m_ValueList = new List(); + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/AGBOptionParameter.cs b/WebWindowComplex/Models/AGBOptionParameter.cs new file mode 100644 index 0000000..8e90c21 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionParameter.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionParameter + { + #region Public Constructors + + public AGBOptionParameter(string sValue, string sDescription) + { + m_sValue = sValue; + m_sDescription = sDescription; + } + + #endregion Public Constructors + + #region Public Properties + + public string sDescription + { + get + { + return m_sDescription; + } + } + + public string sValue + { + get + { + return m_sValue; + } + } + + #endregion Public Properties + + #region Private Fields + + private string m_sDescription; + private string m_sValue; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/AGBOptionText.cs b/WebWindowComplex/Models/AGBOptionText.cs new file mode 100644 index 0000000..252c814 --- /dev/null +++ b/WebWindowComplex/Models/AGBOptionText.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class AGBOptionText : ParametriOpzioni + { + #region Public Constructors + + public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) + { + m_Type = HDWOPTIONTYPES.TEXT; + m_sValue = HdwOptionParam.ValoreCorrente; + } + + #endregion Public Constructors + + #region Public Properties + + public string sValue + { + get + { + return m_sValue; + } + set + { + m_sValue = value; + } + } + + #endregion Public Properties + + #region Private Fields + + private string m_sValue; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/IdNameStruct.cs b/WebWindowComplex/Models/IdNameStruct.cs new file mode 100644 index 0000000..06cf1af --- /dev/null +++ b/WebWindowComplex/Models/IdNameStruct.cs @@ -0,0 +1,126 @@ +namespace WebWindowComplex.Models +{ + public struct IdNameStruct + { + #region Public Constructors + + public IdNameStruct(int Id, string Name) + { + this = default(IdNameStruct); + m_Id = Id; + m_Name = Name; + } + + #endregion Public Constructors + + #region Public Properties + + public int Id + { + get + { + return m_Id; + } + set + { + m_Id = value; + } + } + + public string Name + { + get + { + return m_Name; + } + set + { + m_Name = value; + } + } + + #endregion Public Properties + + #region Public Methods + + public static int IdFromInd(int Ind, List List) + { + return List[Ind].Id; + } + + public static int IdFromInd(int Ind, List List) + { + if (List[Ind] is IdNameStruct) + { + return ((IdNameStruct)List[Ind]).Id; + } + + return 0; + } + + public static int IdFromName(string Name, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0) + { + return ((IdNameStruct)List[i]).Id; + } + } + return 0; + } + } + + public static int IndFromId(int Id, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (List[i].Id == Id) + { + return i; + } + } + + return 0; + } + } + + public static int IndFromId(int Id, List List) + { + checked + { + int num = List.Count - 1; + for (int i = 0; i <= num; i++) + { + if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id) + { + return i; + } + } + + return 0; + } + } + + public override string ToString() + { + return Name; + } + + #endregion Public Methods + + #region Private Fields + + private int m_Id; + + private string m_Name; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/OnPreviewEventArgs.cs b/WebWindowComplex/Models/OnPreviewEventArgs.cs new file mode 100644 index 0000000..d6585e0 --- /dev/null +++ b/WebWindowComplex/Models/OnPreviewEventArgs.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WebWindowComplex.Models +{ + public class OnPreviewEventArgs : EventArgs + { + #region Public Fields + + public string sJwd; + + #endregion Public Fields + + #region Public Constructors + + public OnPreviewEventArgs(string sJwd) + { + this.sJwd = sJwd; + } + + #endregion Public Constructors + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/ParametriOpzioni.cs b/WebWindowComplex/Models/ParametriOpzioni.cs new file mode 100644 index 0000000..5ad6324 --- /dev/null +++ b/WebWindowComplex/Models/ParametriOpzioni.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static WebWindowComplex.Json.WindowConst; + +namespace WebWindowComplex.Models +{ + public partial class ParametriOpzioni + { + #region Public Constructors + + public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam) + { + m_sName = HdwOptionParam.NomeParametro; + m_sDescription = HdwOptionParam.DescrizioneParametro; + m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) + } + + #endregion Public Constructors + + #region Public Enums + + public enum HDWOPTIONTYPES : int + { + TEXT = 1, + LENGHT = 2, + COMBO = 3 + } + + #endregion Public Enums + + #region Public Properties + + public Visibility OptVisibility + { + get + { + return m_OptVisibility; + } + } + + public string sDescription + { + get + { + return m_sDescription; + } + } + + public string sName + { + get + { + return m_sName; + } + } + + public HDWOPTIONTYPES Type + { + get + { + return m_Type; + } + } + + #endregion Public Properties + + #region Protected Fields + + protected HDWOPTIONTYPES m_Type; + + #endregion Protected Fields + + #region Private Fields + + private Visibility m_OptVisibility; + private string m_sDescription; + private string m_sName; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/WebWindowComplex/Models/Window.cs b/WebWindowComplex/Models/Window.cs index f6aac9c..3a41a7d 100644 --- a/WebWindowComplex/Models/Window.cs +++ b/WebWindowComplex/Models/Window.cs @@ -15,39 +15,28 @@ using static WebWindowComplex.ParametriOpzioni; namespace WebWindowComplex.Models { - public class Window { + #region Public Events + public event EventHandler OnPreview = delegate { }; - private string m_sProfilePath; - public string sProfilePath + #endregion Public Events + + #region Public Properties + + public List AreaList { get { - return m_sProfilePath; + return m_AreaList; } set { - m_sProfilePath = value; + m_AreaList = value; } } - private string m_sMaterial; - public string sMaterial - { - get - { - return m_sMaterial; - } - set - { - m_sMaterial = value; - OnUpdatePreview(sSerialized()); - } - } - - private string m_sColorMaterial; public string sColorMaterial { get @@ -61,7 +50,6 @@ namespace WebWindowComplex.Models } } - private string m_sGlass; public string sGlass { get @@ -75,16 +63,42 @@ namespace WebWindowComplex.Models } } - private List m_AreaList = new List(); - public List AreaList + public string sMaterial { get { - return m_AreaList; + return m_sMaterial; } set { - m_AreaList = value; + m_sMaterial = value; + OnUpdatePreview(sSerialized()); + } + } + + public string sProfilePath + { + get + { + return m_sProfilePath; + } + set + { + m_sProfilePath = value; + } + } + + #endregion Public Properties + + #region Internal Methods + + internal void OnUpdatePreview(string sJwd) + { + OnPreviewEventArgs e = new OnPreviewEventArgs(sJwd); + EventHandler handler = OnPreview; + if (handler != null) + { + handler(this, e); } } @@ -101,268 +115,16 @@ namespace WebWindowComplex.Models return JsonConvert.SerializeObject(Serialize(), Formatting.Indented); } - internal void OnUpdatePreview(string sJwd) - { - OnPreviewEventArgs e = new OnPreviewEventArgs(sJwd); - EventHandler handler = OnPreview; - if (handler != null) - { - handler(this, e); - } - } + #endregion Internal Methods + + #region Private Fields + + private List m_AreaList = new List(); + private string m_sColorMaterial; + private string m_sGlass; + private string m_sMaterial; + private string m_sProfilePath; + + #endregion Private Fields } - - public class OnPreviewEventArgs : EventArgs - { - public string sJwd; - - public OnPreviewEventArgs(string sJwd) - { - this.sJwd = sJwd; - } - } - - public partial class ParametriOpzioni - { - public enum HDWOPTIONTYPES : int - { - TEXT = 1, - LENGHT = 2, - COMBO = 3 - } - - protected HDWOPTIONTYPES m_Type; - public HDWOPTIONTYPES Type - { - get - { - return m_Type; - } - } - - private string m_sName; - public string sName - { - get - { - return m_sName; - } - } - - private string m_sDescription; - public string sDescription - { - get - { - return m_sDescription; - } - } - - private Visibility m_OptVisibility; - public Visibility OptVisibility - { - get - { - return m_OptVisibility; - } - } - - public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam) - { - m_sName = HdwOptionParam.NomeParametro; - m_sDescription = HdwOptionParam.DescrizioneParametro; - m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed) - } - } - - public class AGBOptionCombo : ParametriOpzioni - { - private List m_ValueList = new List(); - public List ValueList - { - get - { - return m_ValueList; - } - } - - private AGBOptionParameter m_sValue; - public AGBOptionParameter sValue - { - get - { - return m_sValue; - } - set - { - m_sValue = value; - } - } - - public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) - { - m_Type = HDWOPTIONTYPES.COMBO; - foreach (var Value in HdwOptionParam.Opzioni) - m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione)); - m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", ""); - } - } - - public class AGBOptionParameter - { - private string m_sValue; - public string sValue - { - get - { - return m_sValue; - } - } - - private string m_sDescription; - public string sDescription - { - get - { - return m_sDescription; - } - } - - public AGBOptionParameter(string sValue, string sDescription) - { - m_sValue = sValue; - m_sDescription = sDescription; - } - } - - public class AGBOptionText : ParametriOpzioni - { - private string m_sValue; - public string sValue - { - get - { - return m_sValue; - } - set - { - m_sValue = value; - } - } - - public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam) - { - m_Type = HDWOPTIONTYPES.TEXT; - m_sValue = HdwOptionParam.ValoreCorrente; - } - } - - public struct IdNameStruct - { - private int m_Id; - - private string m_Name; - - public int Id - { - get - { - return m_Id; - } - set - { - m_Id = value; - } - } - - public string Name - { - get - { - return m_Name; - } - set - { - m_Name = value; - } - } - - public IdNameStruct(int Id, string Name) - { - this = default(IdNameStruct); - m_Id = Id; - m_Name = Name; - } - - public override string ToString() - { - return Name; - } - - public static int IndFromId(int Id, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i].Id == Id) - { - return i; - } - } - - return 0; - } - } - - public static int IdFromInd(int Ind, List List) - { - return List[Ind].Id; - } - - public static int IndFromId(int Id, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id) - { - return i; - } - } - - return 0; - } - } - - public static int IdFromInd(int Ind, List List) - { - if (List[Ind] is IdNameStruct) - { - return ((IdNameStruct)List[Ind]).Id; - } - - return 0; - } - - public static int IdFromName(string Name, List List) - { - checked - { - int num = List.Count - 1; - for (int i = 0; i <= num; i++) - { - if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0) - { - return ((IdNameStruct)List[i]).Id; - } - } - return 0; - } - } - } - -} +} \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 4e8377a..452cdf6 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1016 + 2.7.10.1017 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -52,6 +52,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 8ea5b20..1b82b4e 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.1016 + 2.7.10.1017 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -79,6 +79,9 @@ + + +