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

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

            while (true)
            {
                string[] lines = response.GetAnsiStrings(10);
                if (ReferenceEquals(lines, null))
                {
                    break;
                }
                IrbisProcessInfo info = new IrbisProcessInfo
                {
                    ProcessID     = lines[0],
                    State         = lines[1],
                    Number        = lines[2],
                    IPAddress     = lines[3],
                    Name          = lines[4],
                    ClientID      = lines[5],
                    Workstation   = lines[6],
                    Started       = lines[7],
                    LastCommand   = lines[8],
                    CommandNumber = lines[9]
                };
                result.Add(info);
            }

            return(result.ToArray());
        }
示例#2
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());
        }