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

    转载请注明出处!

  • 相关阅读:
    一个apache安装后无法启动的原因分析
    数字的一点考虑
    [转]bat方式上删除注册表键,项
    题解 P2016 【战略游戏】
    题解 P1403 【[AHOI2005]约数研究】
    题解 P1317 【低洼地】
    2020面向对象程序设计寒假作业3 设计思想
    题解 P1829 【[国家集训队]Crash的数字表格 / JZPTAB】
    题解 P1082 【同余方程】
    Unity3D读取外部Text
  • 原文地址:https://www.cnblogs.com/fattydoit/p/4954876.html
Copyright © 2011-2022 走看看