protected virtual void OnDataReceived(CommunicatorEventArgs e)
 {
     if (!EqualityComparer <CommunicatorEventArgs> .Default.Equals(e, default(CommunicatorEventArgs)) && DataReceived != null)
     {
         DataReceived(e);
     }
 }
        public void Write(CommunicatorEventArgs args)
        {
            if (ReadPosition < 0 || WritePosition < 0)
            {
                throw new ArgumentException();
            }

            lock (obj)
            {
                dataToSend.Add(args.Serialize());
                if (!writerThreadRunning)
                {
                    writerThreadRunning = true;
                    Task.Factory.StartNew(WriterThread);
                }
            }
        }