日期:2014-05-18  浏览次数:20854 次

自定义控件中有一个结构体,老是警告为标记为可序列化
class myplot
{
.......
public struct curveAttri
  {
  public string curveName;
  public string thisCurveName
  {
  get { return curveName; }
  set { curveName = value; }
  }
   
  public int curveType;  
  public int thisCurveType
  {
  get { return curveType; }
  set { curveType = value; }
  }
  }

  public List<curveAttri> curveList = new List<curveAttri>();

  public List<curveAttri> mycurves
  {
  get { return curveList; }
  set
  {
  curveList = value;
  }
  }
........
}

自定义控件中有一个结构体这么写的,编译的时候能通过,可是隔一段时间就报警,下图所示。
在窗口程序中拖此控件时也提示,见上图所示。
怎么回事?
序列化我一点不懂
[/url]][/img]

------解决方案--------------------
把struct curveAttri放在class myplot的外边