zoukankan      html  css  js  c++  java
  • 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

    转载请注明出处!

  • 相关阅读:
    Winform 切换语言 实现多语言版本
    PowerDesigner导出表到word
    【SQL】两个带order by查询进行union all报ORA-00933错误的解决方法
    读写txt文件
    c# 进度条的使用(例子)、线程
    设计模式——策略模式
    设计模式——简单工厂模式
    解决JSP路径问题的方法(jsp文件开头path, basePath作用)
    反射
    Struts2中的valuestack
  • 原文地址:https://www.cnblogs.com/fattydoit/p/4954876.html
Copyright © 2011-2022 走看看