|
| 1 | +using MetaCom.ViewModels; |
| 2 | +using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.Collections.ObjectModel; |
| 5 | +using System.IO; |
| 6 | +using System.Linq; |
| 7 | +using System.Text; |
| 8 | +using System.Xml; |
| 9 | +using System.Xml.Serialization; |
| 10 | + |
| 11 | +namespace MetaCom.Models |
| 12 | +{ |
| 13 | + [XmlRoot(ElementName = "Config")] |
| 14 | + public class ConfigModel : MainWindowBase |
| 15 | + { |
| 16 | + private string _port; |
| 17 | + [XmlAttribute(AttributeName = "port", Namespace = "")] |
| 18 | + public string Port |
| 19 | + { |
| 20 | + get |
| 21 | + { |
| 22 | + return _port; |
| 23 | + } |
| 24 | + set |
| 25 | + { |
| 26 | + _port = value; |
| 27 | + RaisePropertyChanged(nameof(Port)); |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + [XmlRoot(ElementName = "commoncmd")] |
| 33 | + public class CommonCmd : MainWindowBase |
| 34 | + { |
| 35 | + private string _item; |
| 36 | + [XmlElement(ElementName = "item", Namespace = "")] |
| 37 | + public string Item |
| 38 | + { |
| 39 | + get |
| 40 | + { |
| 41 | + return _item; |
| 42 | + } |
| 43 | + set |
| 44 | + { |
| 45 | + _item = value; |
| 46 | + RaisePropertyChanged(nameof(Item)); |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + private ObservableCollection<CommonCmd> _commoncmds; |
| 51 | + [XmlElement(ElementName = "commoncmds", Namespace = "")] |
| 52 | + public ObservableCollection<CommonCmd> CommonCmds |
| 53 | + { |
| 54 | + get |
| 55 | + { |
| 56 | + return _commoncmds; |
| 57 | + } |
| 58 | + set |
| 59 | + { |
| 60 | + _commoncmds = value; |
| 61 | + RaisePropertyChanged(nameof(CommonCmds)); |
| 62 | + } |
| 63 | + } |
| 64 | + [XmlRoot(ElementName = "rescentcmd")] |
| 65 | + public class RescentCmd : MainWindowBase |
| 66 | + { |
| 67 | + private string _item; |
| 68 | + [XmlElement(ElementName = "item", Namespace = "")] |
| 69 | + public string Item |
| 70 | + { |
| 71 | + get |
| 72 | + { |
| 73 | + return _item; |
| 74 | + } |
| 75 | + set |
| 76 | + { |
| 77 | + _item = value; |
| 78 | + RaisePropertyChanged(nameof(Item)); |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + } |
| 83 | + private ObservableCollection<RescentCmd> _rescentcmds; |
| 84 | + [XmlElement(ElementName = "rescentcmds", Namespace = "")] |
| 85 | + public ObservableCollection<RescentCmd> RescentCmds |
| 86 | + { |
| 87 | + get |
| 88 | + { |
| 89 | + return _rescentcmds; |
| 90 | + } |
| 91 | + set |
| 92 | + { |
| 93 | + _rescentcmds = value; |
| 94 | + //NotifyPropertyChange("RescentCmds"); |
| 95 | + RaisePropertyChanged(nameof(RescentCmds)); |
| 96 | + } |
| 97 | + } |
| 98 | + |
| 99 | + } |
| 100 | +} |
0 commit comments