public YesSessionData ParseSession(string rawHtml) { //TODO::Change the way the data is read. var htmlByLine = rawHtml.Split('\n'); string sentS = htmlByLine[17]; string recvS = htmlByLine[18]; string timeS = htmlByLine[19]; var sentString = Regex.Match(sentS, @":([^)]*) kB").Groups[1].Value; var recvString = Regex.Match(recvS, @":([^)]*) kB").Groups[1].Value; var timeString = Regex.Match(timeS, @":([^)]*)</tt").Groups[1].Value; try { var session = new YesSessionData() { Sent = double.Parse(sentString), Received = double.Parse(recvString), Time = TimeSpan.Parse(timeString) }; return(session); } catch (Exception) { return(null); } }
private void ProcessSessionUpdate(YesSessionData data) { throw new NotImplementedException(); }