public static IrbisVersion ParseServerResponse ( [NotNull] ServerResponse response ) { Sure.NotNull(response, nameof(response)); List <string> lines = response.RemainingAnsiStrings(); IrbisVersion result = ParseServerResponse(lines); return(result); }
public static IrbisVersion ParseServerResponse ( [NotNull] List <string> lines ) { Sure.NotNull(lines, nameof(lines)); IrbisVersion result = lines.Count == 4 ? new IrbisVersion { Organization = lines.GetItem(0), Version = lines.GetItem(1), ConnectedClients = lines.GetItem(2).SafeToInt32(), MaxClients = lines.GetItem(3).SafeToInt32() } : new IrbisVersion { Version = lines.GetItem(0), ConnectedClients = lines.GetItem(1).SafeToInt32(), MaxClients = lines.GetItem(2).SafeToInt32() }; return(result); }