예제 #1
0
        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());
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        public virtual void OnCommunicationLog(CommunicationLog log)
        {
            var e = new MCCommunicationLogEventArgs(log);

            this.OnCommunicationLog(e);
        }