技術文章
C#添加自定義List<>屬性時序列化
2014/3/10 11:23:34  
 

 /// <summary>
    /// 選擇項類,用于ComboBox或者ListBox添加項
    /// </summary>
    ///
    [Serializable]//這里標識序列化
    public class cdListItem
    {
        private string id = string.Empty;
        private string name = string.Empty;
        public cdListItem(string sid, string sname)
        {
            id = sid;
            name = sname;
        }
        public cdListItem()
        {
            id = "";
            name = "";
        }
        public override string ToString()
        {
            return this.name;
        }
        public string Key
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }
    }

  技術熱點  
  網站推薦  
 
 
 X派工作室   2013 XSTT Studio  
6080在线无码视频_国内视频在线精品一区_色天堂在线