using Egw.Window.Data; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections; using System.Collections.ObjectModel; using System.ComponentModel; using System.Drawing; using System.Runtime.Intrinsics.Arm; using System.Security.Cryptography; using System.Xml.Linq; using System.Xml.Serialization; using WebWindowTest.Json; using static WebWindowTest.Json.WindowConst; using static WebWindowTest.Models.ParametriOpzioni; namespace WebWindowTest.Models { public class Window { #region Public Events //public event EventHandler OnPreview = delegate { }; //public event EventHandler OnReqShape = delegate { }; //public event EventHandler OnReqHwOption = delegate { }; #endregion Public Events #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 sMaterial { get { return m_sMaterial; } set { m_sMaterial = 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, sMaterial, 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_sMaterial; private string m_sProfilePath; #endregion Private Fields } }