내가 중첩 된 데이터 클래스 제품 설명베이스에서 처리하는 방법 중첩 된 데이터 클래스중첩 된 클래스는 기본 내에서 사용하고 파생 클래스
에서 노드에 대한이 코드의 세터에 스택 오버플로 exceptin 받고 있어요 및 파생 클래스를 사용하여 주 창에서 만든 새 노드에서이 데이터를 사용할 수 있습니까?
namespace Lib
{
// Nested Data Class
public class Desc
{
public Desc(string shape, Nullable<bool>[] inpins)
{
this.inpins = inpins;
}
string shape { get; set; }
Nullable<bool>[] inpins { get; set; }
}
// Base class drived from ShapeNode class in vendor's framework
public class Node : ShapeNode
{
public Node()
{
}
// Make a copy of Node
public Node(Node copy)
: base(copy)
{
Text = copy.Text;
NodeId = copy.NodeId;
}
public virtual Node Clone()
{
return new Node(this);
}
// Base Constructor
public Node(string Text, Desc NodeId)
{
this.Text = Text;
this.NodeId = NodeId;
}
new public string Text { get { return base.Text; } set { base.Text = value; } }
public Desc NodeId { get { return NodeId; } set { NodeId = value; }
}
}
namespace Test
{
// Main Window code
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
nodes = new Node[]
{ new A(
"TESTA",
new Desc(new Nullable<bool>[]{false, false})),
new B(
"TESTB",
new Desc(new Nullable<bool>[] {false, false, false}))
}
}
}