• test


    public class FilterItem : ObservableObject { [XmlAttribute("Key")] public string Key { get; set; } [XmlAttribute("Value")] public string Value { get; set; } private bool isChecked; [XmlAttribute("IsChecked")] public bool IsChecked { get { return isChecked; } set { if (isChecked != value) { isChecked = value; RaisePropertyChanged("IsChecked"); } } } } public class Filters { [XmlElement("FilterItems")] public List FilterItems { get; set; } [XmlElement("FilterType")] public FilterType FilterType { get; set; } } public enum FilterType { Desk, Sector, Seniority } public class FiltersList { [XmlElement("Filters")] public List ItemsSource { get; set; } public string ToXml() { var xs = new XmlSerializer(ItemsSource.GetType()); var xml = new StringWriter(); xs.Serialize(xml, ItemsSource); return xml.ToString(); } public List ToFiltersList(string xml) { var xs = new XmlSerializer(ItemsSource.GetType()); return (List)xs.Deserialize(new StringReader(xml)); } }

    作者: 小胖

    出处: 小胖搞IT

    转载请注明出处!

  • 相关阅读:
    猜数字游戏
    发红包程序
    实现微信摇一摇部分功能
    计算1+1/2+1/3+....+1/100的值
    约瑟夫问题
    简易计时器
    简易学生管理系统
    文件加密解密
    分鱼问题
    分橘子问题
  • 原文地址:https://www.cnblogs.com/fattydoit/p/4954876.html
Copyright © 2020-2023  润新知