private void ReportStateChange()
        {
            WorkerStateChangedMessage message = new WorkerStateChangedMessage(WorkAssignment, State);
            var envelope = new PipeMessageEnvelope()
            {
                Body  = message,
                Label = WorkerStateChangedMessage.MessageLabel,
            };

            ReportPipe.Send(envelope);
        }
        public void ReportToDirector(string message)
        {
            WorkerMessage workerMessage = new WorkerMessage(WorkerId, message);
            var           envelope      = new PipeMessageEnvelope()
            {
                Body  = workerMessage,
                Label = WorkerMessage.MessageLabel,
            };

            if (null != ReportPipe)
            {
                ReportPipe.Send(envelope);
            }
        }
        public void ForceSend()
        {
            WorkTimeNet   = _workTimeNet.Elapsed;
            WorkTimeGross = _workTimeGross.Elapsed - _idleTime;

            var envelope = new PipeMessageEnvelope()
            {
                Body  = this,
                Label = MessageLabel,
            };

            ReportPipe.Send(envelope);
            PreviousHeartBeatSentTime = DateTime.Now;
            _dirty = false;
        }