154 lines
3.9 KiB
C#
154 lines
3.9 KiB
C#
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<OnPreviewEventArgs> OnPreview = delegate { };
|
|
//public event EventHandler<OnReqShapeEventArgs> OnReqShape = delegate { };
|
|
//public event EventHandler<OnReqHwOptEventArgs> OnReqHwOption = delegate { };
|
|
|
|
#endregion Public Events
|
|
|
|
#region Public Properties
|
|
|
|
public List<Frame> 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<OnPreviewEventArgs> handler = OnPreview;
|
|
// if (handler != null)
|
|
// {
|
|
// handler(this, e);
|
|
// }
|
|
//}
|
|
|
|
//internal void OnReqShapePreview(string sJwd, int groupId)
|
|
//{
|
|
// OnReqShapeEventArgs e = new OnReqShapeEventArgs(sJwd, groupId);
|
|
// EventHandler<OnReqShapeEventArgs> handler = OnReqShape;
|
|
// if (handler != null)
|
|
// {
|
|
// handler(this, e);
|
|
// }
|
|
//}
|
|
|
|
//internal void OnReqHwOptionPreview(string sJwd, int groupId)
|
|
//{
|
|
// OnReqHwOptEventArgs e = new OnReqHwOptEventArgs(sJwd, groupId);
|
|
// EventHandler<OnReqHwOptEventArgs> handler = OnReqHwOption;
|
|
// if (handler != null)
|
|
// {
|
|
// handler(this, e);
|
|
// }
|
|
//}
|
|
|
|
/// <summary>
|
|
/// Serializzazione dell'oggetto windows
|
|
/// </summary>
|
|
/// <param name="hideHw">Hide hw x preview SVG veloci</param>
|
|
/// <returns></returns>
|
|
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<Frame> m_AreaList = new List<Frame>();
|
|
private string m_sColorMaterial;
|
|
private string m_sGlass;
|
|
private string m_sMaterial;
|
|
private string m_sProfilePath;
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |