141 lines
3.5 KiB
C#
141 lines
3.5 KiB
C#
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<string, double> m_ParameterList = new Dictionary<string, double>();
|
|
|
|
#endregion Public Fields
|
|
|
|
#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 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<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, 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<Frame> m_AreaList = new List<Frame>();
|
|
private string? m_sColorMaterial;
|
|
private string? m_sGlass;
|
|
private string? m_sWood;
|
|
private string? m_sProfilePath;
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |