using Newtonsoft.Json; using WebWindowComplex.Json; namespace WebWindowComplex.Models { public class Window { #region Public Fields // Lista dei parametri del profilo passata dal chiamante del componente public static Dictionary m_ParameterList = new Dictionary(); #endregion Public Fields #region Public Properties public List AreaList { get { return m_AreaList; } set { m_AreaList = value; } } public string sColorMaterial { get { return m_sColorMaterial; } set { m_sColorMaterial = value; } } public string sGlass { get { return m_sGlass; } set { m_sGlass = value; } } public string sWood { get { return m_sWood; } set { m_sWood = value; } } 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); // } //} //internal void OnReqShapePreview(string sJwd, int groupId) //{ // OnReqShapeEventArgs e = new OnReqShapeEventArgs(sJwd, groupId); // EventHandler handler = OnReqShape; // if (handler != null) // { // handler(this, e); // } //} //internal void OnReqHwOptionPreview(string sJwd, int groupId) //{ // OnReqHwOptEventArgs e = new OnReqHwOptEventArgs(sJwd, groupId); // EventHandler handler = OnReqHwOption; // if (handler != null) // { // handler(this, e); // } //} /// /// Serializzazione dell'oggetto windows /// /// Hide hw x preview SVG veloci /// internal JsonWindow Serialize(bool hideHw = false) { JsonWindow JsonWindow = new JsonWindow(sProfilePath, sWood, sColorMaterial, sGlass); foreach (var Area in AreaList) JsonWindow.AreaList.Add(Area.Serialize(hideHw)); return JsonWindow; } internal string sSerialized(bool hideHw = false) { return JsonConvert.SerializeObject(Serialize(hideHw), Formatting.Indented); } #endregion Internal Methods #region Private Fields private List m_AreaList = new List(); private string? m_sColorMaterial; private string? m_sGlass; private string? m_sWood; private string? m_sProfilePath; #endregion Private Fields } }