树型转换 [英] Tree Type Convert

查看:70
本文介绍了树型转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:
当我重写树控件时,我定义了一组类,当您第一次打开设计器时可以添加到数据集合中,但似乎重新打开了一个异常.无法将对象的"MyTree.ObjectListInfo []"类型转换为"MyTree.ObjectListInfo []"类型.你能帮我吗?
谢谢
代码:
公共局部类MyTree:TreeList
(
私人布尔fIsLoaded = false;
私有字符串fTypeName = string.Empty;
私有列表< ObjectListInfo> fTypeList =新列表< ObjectListInfo> ();

公共布尔TreeIsLoaded(获取(返回fIsLoaded;))

公共字符串TypeName(获取(返回fTypeName;)设置(fTypeName =值;))

公共列表< ObjectListInfo> TypeList(获取(返回fTypeList;)设置(fTypeList =值;))

公共MyTree()
(
InitializeComponent();
)
)

Hi:
When I rewrite a tree control, I defined a set of class, when you first open the designer can add to the collection of data, but appeared to re-open out an exception. Type "MyTree.ObjectListInfo []" of the object can not be converted to type "MyTree.ObjectListInfo []". Can you help me?
Thanks
Code:
public partial class MyTree: TreeList
(
private bool fIsLoaded = false;
private string fTypeName = string.Empty;
private List <ObjectListInfo> fTypeList = new List <ObjectListInfo> ();

public bool TreeIsLoaded (get (return fIsLoaded;))

public string TypeName (get (return fTypeName;) set (fTypeName = value;))

public List <ObjectListInfo> TypeList (get (return fTypeList;) set (fTypeList = value;))

public MyTree ()
(
InitializeComponent ();
)
)

推荐答案

我认为错误意味着您需要为ObjectListInfo或ObjectListInfo []定义运算符==
I believe that error means you need to define operator == for ObjectListInfo or ObjectListInfo[]


我认为有List的结果
I think there might be serialized into an array when a result of List


这篇关于树型转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆