using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace Exp1
{
class treeNode
{
string attribute; public string Attribute
{
get { return attribute; }
set { attribute = value; }
}
List<string> valueofAttr; public List<string> ValueofAttr
{
get { return valueofAttr; }
set { valueofAttr = value; }
}
treeNode parent; internal treeNode Parent
{
get { return parent; }
set { parent = value; }
}
public List<treeNode> child; //internal List<treeNode> Child
//{
// get { return child; }
// set { child = value; }
//}
string parent_attr_value; public string Parent_attr_value
{
get { return parent_attr_value; }
set { parent_attr_value = value; }
} string yesorno; public string Yesorno
{
get { return yesorno; }
set { yesorno = value; }
} public void addChild(treeNode n) {
this.child.Add(n); 这里提示“未将对象引用设置到对象的实例。”
} public treeNode(string attribute) {
this.attribute = attribute;
this.child = null;
this.parent = null;
this.parent_attr_value = null;
this.valueofAttr = null;
this.yesorno = null;
}
}
} treeNode n = new treeNode(root.Attribute);
n.Parent = root;
n.Parent_attr_value = s;
n.Yesorno = temp.First().PlayBall.ToString();
//List<treeNode> hg = new List<treeNode>();
//hg = root.child;
//hg.Add(n);
root.addChild(n);
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace Exp1
{
class treeNode
{
string attribute; public string Attribute
{
get { return attribute; }
set { attribute = value; }
}
List<string> valueofAttr; public List<string> ValueofAttr
{
get { return valueofAttr; }
set { valueofAttr = value; }
}
treeNode parent; internal treeNode Parent
{
get { return parent; }
set { parent = value; }
}
public List<treeNode> child; //internal List<treeNode> Child
//{
// get { return child; }
// set { child = value; }
//}
string parent_attr_value; public string Parent_attr_value
{
get { return parent_attr_value; }
set { parent_attr_value = value; }
} string yesorno; public string Yesorno
{
get { return yesorno; }
set { yesorno = value; }
} public void addChild(treeNode n) {
this.child.Add(n); 这里提示“未将对象引用设置到对象的实例。”
} public treeNode(string attribute) {
this.attribute = attribute;
this.child = null;
this.parent = null;
this.parent_attr_value = null;
this.valueofAttr = null;
this.yesorno = null;
}
}
} treeNode n = new treeNode(root.Attribute);
n.Parent = root;
n.Parent_attr_value = s;
n.Yesorno = temp.First().PlayBall.ToString();
//List<treeNode> hg = new List<treeNode>();
//hg = root.child;
//hg.Add(n);
root.addChild(n);
if(child!=null)
this.child.Add(n); 这里提示“未将对象引用设置到对象的实例。”
}