private void OnCommandCompleted(CommandCompletedEventArgs e) { var handler = CommandCompleted; if (handler != null) { handler(this, e); } }
private void ParseNextResponse(object userState) { var line = reader.ReadLine(); var arguments = line.Split(','); var offset = DateTimeOffset.Parse(arguments[0]); nextResponse = new CommandCompletedEventArgs(Convert.ToByte(arguments[1]), Convert.FromBase64String(arguments[2]), null, false, userState); responseTimer.Change(0, (int)offset.Offset.TotalMilliseconds); }
void manager_CommandCompleted(object sender, CommandCompletedEventArgs e) { var line = string.Format("{0},{1},{2}", DateTimeOffset.Now, e.Command, Convert.ToBase64String(e.Response)); writer.WriteLine(line); }