﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml;
using CS.SL.Common.Extensions;

namespace SPS.Model
{
    public class ListItemInfo
    {
        public string Key { get; set; }
        public string Value { get; set; }
        public bool Selected { get; set; }
        public void Parse(XmlReader reader)
        {
            this.Key = reader.GetAttribute("key");
            this.Selected = string.Equals(reader.GetAttribute("selected"),"true",StringComparison.OrdinalIgnoreCase);
            this.Value = reader.ReadInnerXml().EscapeXml();
        }
        public override string ToString()
        {
            return this.Value;
        }
    }
}
