Files
webwindowconfigurator/WebWindowComplex/Models/Joint.cs
T
Annamaria Sassi e8cecb3113 - Aggiornati select con lista dati
- Aggiornato readme
2025-11-05 16:15:33 +01:00

124 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebWindowComplex.Json;
using static WebWindowComplex.Json.WindowConst;
namespace WebWindowComplex.Models
{
public class Joint
{
#region Public Constructors
public Joint(Area ParentArea, int nIndex, Joints SelJointType)
{
m_ParentArea = ParentArea;
m_nIndex = nIndex;
m_SelJointType = SelJointType;
}
#endregion Public Constructors
#region Public Properties
public List<IdNameStruct> JointTypeList
{
get
{
return m_JointTypeList;
}
}
public int nIndex
{
get
{
return m_nIndex;
}
}
public Area ParentArea
{
get
{
return m_ParentArea;
}
}
public Joints SelJointType
{
get
{
return m_SelJointType;
}
set
{
m_SelJointType = value;
}
}
public int SelJointTypeIndex
{
get
{
//return IdNameStruct.IndFromId((int)m_SelJointType, m_JointTypeList);
return (int)m_SelJointType;
}
set
{
//m_SelJointType = (Joints)IdNameStruct.IdFromInd(value, m_JointTypeList);
m_SelJointType = (Joints)value;
m_ParentArea.ParentWindow.OnUpdatePreview(m_ParentArea.ParentWindow.sSerialized());
}
}
#endregion Public Properties
#region Public Methods
public Joint Copy()
{
Joint newJoint = new Joint(ParentArea, nIndex, SelJointType);
return newJoint;
}
#endregion Public Methods
#region Internal Methods
internal JsonJoint Serialize()
{
JsonJoint JsonJoint = new JsonJoint(m_nIndex, m_SelJointType);
return JsonJoint;
}
internal void SetSelJointType(Joints value)
{
m_SelJointType = value;
}
#endregion Internal Methods
#region Protected Fields
protected Area m_ParentArea;
#endregion Protected Fields
#region Private Fields
private List<IdNameStruct> m_JointTypeList = new List<IdNameStruct>
{
new IdNameStruct((int)Joints.ANGLED, "Angled"),
new IdNameStruct((int)Joints.FULL_H, "Full H"),
new IdNameStruct((int)Joints.FULL_V, "Full V")
};
private int m_nIndex;
private Joints m_SelJointType;
#endregion Private Fields
}
}