Inizio spacchettamento file window delle classi di base del modello
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
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);
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SelJointType = (Joints)IdNameStruct.IdFromInd(value, m_JointTypeList);
|
||||
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;
|
||||
//NotifyPropertyChanged(nameof(SelJointTypeIndex));
|
||||
}
|
||||
|
||||
#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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user