Пример #1
0
        private PassportData ParsePassportData()
        {
            string[] passportData = new List <string>(
                PassportData.Split(' ')
                )
                                    .Select(s => s.Trim())
                                    .ToArray();

            PassportData data = new PassportData();

            for (int i = 0; i < passportData.Length; i++)
            {
                string[] property = passportData[i].Split(':');

                if (!String.IsNullOrEmpty(property[0]))
                {
                    data.SetValue(property[0], property[1]);
                }
            }

            return(data);
        }
Пример #2
0
 public Passport(PassportData data)
 {
     Data = data;
 }
Пример #3
0
        public Passport CreatePassport()
        {
            PassportData data = ParsePassportData();

            return(new Passport(data));
        }