/// <summary> /// When implemented in a derived class, used to synchronously process the tracking record. /// </summary> /// <param name="record"> /// The generated tracking record. /// </param> /// <param name="timeout"> /// The time period after which the provider aborts the attempt. /// </param> /// <param name="callback"> /// The callback. /// </param> /// <param name="state"> /// The state. /// </param> /// <returns> /// The async result. /// </returns> protected override IAsyncResult BeginTrack( TrackingRecord record, TimeSpan timeout, AsyncCallback callback, object state) { var bytes = this.encoding.GetBytes(record.ToFormattedString() + Environment.NewLine); return this.file.BeginWrite(bytes, 0, bytes.Length, callback, state); }
/// <summary> /// </summary> /// <param name="record"> /// The record. /// </param> /// <param name="timeout"> /// The timeout. /// </param> protected override void Track(TrackingRecord record, TimeSpan timeout) { // CommandLine.WriteLineColor(ConsoleColor.Green, record.ToFormattedString()); Console.WriteLine(record.ToFormattedString()); }
/// <summary> /// When implemented in a derived class, used to synchronously process the tracking record. /// </summary> /// <param name="record"> /// The generated tracking record. /// </param> /// <param name="timeout"> /// The time period after which the provider aborts the attempt. /// </param> protected override void Track(TrackingRecord record, TimeSpan timeout) { var bytes = this.encoding.GetBytes(record.ToFormattedString() + Environment.NewLine); this.file.Write(bytes, 0, bytes.Length); }
/// <summary> /// When implemented in a derived class, used to synchronously process the tracking record. /// </summary> /// <param name="record"> /// The generated tracking record. /// </param> /// <param name="timeout"> /// The time period after which the provider aborts the attempt. /// </param> protected override void Track(TrackingRecord record, TimeSpan timeout) { this.Records.Add(record.ToFormattedString()); }