private void OnMCCommunicationLog(object sender, MCCommunicationLogEventArgs e) { var prefix = this.GetLayerToString(e); var builder = new StringBuilder(); builder.AppendLine(prefix + "Comm"); builder.AppendLine(prefix + "W : " + string.Join(",", e.Log.WritedBytes.Select(x => x.ToString("X2")))); builder.AppendLine(prefix + "R : " + string.Join(",", e.Log.ReadedBytes.Select(x => x.ToString("X2")))); lock (this.LogQueue) { this.LogQueue.Add(builder.ToString()); } }
protected virtual void OnCommunicationLog(MCCommunicationLogEventArgs e) { this.AddLayer(e); var parent = this.Parent; if (parent != null) { parent.OnCommunicationLog(e); } else { this.CommunicationLog?.Invoke(this, e); } }
public virtual void OnCommunicationLog(CommunicationLog log) { var e = new MCCommunicationLogEventArgs(log); this.OnCommunicationLog(e); }