Completata separazione huge file
This commit is contained in:
@@ -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<AGBOptionParameter> ValueList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ValueList;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private AGBOptionParameter m_sValue;
|
||||
private List<AGBOptionParameter> m_ValueList = new List<AGBOptionParameter>();
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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<IdNameStruct> List)
|
||||
{
|
||||
return List[Ind].Id;
|
||||
}
|
||||
|
||||
public static int IdFromInd(int Ind, List<object> List)
|
||||
{
|
||||
if (List[Ind] is IdNameStruct)
|
||||
{
|
||||
return ((IdNameStruct)List[Ind]).Id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int IdFromName(string Name, List<object> 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<IdNameStruct> 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<object> 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -15,39 +15,28 @@ using static WebWindowComplex.ParametriOpzioni;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
|
||||
public class Window
|
||||
{
|
||||
#region Public Events
|
||||
|
||||
public event EventHandler<OnPreviewEventArgs> OnPreview = delegate { };
|
||||
|
||||
private string m_sProfilePath;
|
||||
public string sProfilePath
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public List<Frame> 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<Frame> m_AreaList = new List<Frame>();
|
||||
public List<Frame> 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<OnPreviewEventArgs> 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<OnPreviewEventArgs> handler = OnPreview;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
|
||||
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<AGBOptionParameter> m_ValueList = new List<AGBOptionParameter>();
|
||||
public List<AGBOptionParameter> 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<IdNameStruct> 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<IdNameStruct> List)
|
||||
{
|
||||
return List[Ind].Id;
|
||||
}
|
||||
|
||||
public static int IndFromId(int Id, List<object> 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<object> List)
|
||||
{
|
||||
if (List[Ind] is IdNameStruct)
|
||||
{
|
||||
return ((IdNameStruct)List[Ind]).Id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int IdFromName(string Name, List<object> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user