示例#1
0
        public static UserInfo[] Parse
        (
            [NotNull] ServerResponse response
        )
        {
            Sure.NotNull(response, nameof(response));

            List <UserInfo> result = new List <UserInfo>();

            response.GetAnsiStrings(2);

            while (true)
            {
                string[] lines = response.GetAnsiStringsPlus(9);
                if (ReferenceEquals(lines, null))
                {
                    break;
                }

                UserInfo user = new UserInfo
                {
                    Number        = lines[0].EmptyToNull(),
                    Name          = lines[1].EmptyToNull(),
                    Password      = lines[2].EmptyToNull(),
                    Cataloger     = lines[3].EmptyToNull(),
                    Reader        = lines[4].EmptyToNull(),
                    Circulation   = lines[5].EmptyToNull(),
                    Acquisitions  = lines[6].EmptyToNull(),
                    Provision     = lines[7].EmptyToNull(),
                    Administrator = lines[8].EmptyToNull()
                };
                result.Add(user);
            }

            return(result.ToArray());
        }