Пример #1
0
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            Purse purse = Parse(reader.ReadElementContentAsString());

            _type   = purse._type;
            _number = purse._number;
        }
Пример #2
0
        public static bool TryParse(string value, out Purse purse)
        {
            if (string.IsNullOrEmpty(value))
            {
                purse = default(Purse);
                return(false);
            }

            Match match = Regex.Match(value, Pattern);

            if (match.Value != value)
            {
                purse = default(Purse);
                return(false);
            }

            purse = new Purse(value);
            return(true);
        }
Пример #3
0
 public bool Equals(Purse other)
 {
     return(_type == other.Type &&
            _number == other.Number);
 }