void _messengerWorker_ReadTimeProgressCompleted(IMessenger sender, TimeProgressResponseMessage obj)
 {
     TimeLineTimeProgress = obj.TimeProgress;
     UIDispatcher.Current.BeginInvoke(new Action(() =>
     {
         _sliderCanvasService.SetProgress(obj.TimeProgress / (double)UInt16.MaxValue);
     }));
 }
Пример #2
0
        void _rs_FrameReceived(FrameReceiverState obj)
        {
            switch (_messageType)
            {
            case MessageType.GetMarker:
                if (ReadMarkerCompleted != null)
                {
                    _colorMarkerResponseMessage             = new ColorMarkerResponseMessage();
                    _colorMarkerResponseMessage.TimePoint   = obj.PayloadBuff[0];
                    _colorMarkerResponseMessage.R           = obj.PayloadBuff[1];
                    _colorMarkerResponseMessage.G           = obj.PayloadBuff[2];
                    _colorMarkerResponseMessage.B           = obj.PayloadBuff[3];
                    _colorMarkerResponseMessage.MarkerIndex = _markerIndex;
                    ReadMarkerCompleted(this, _colorMarkerResponseMessage);
                }
                break;

            case MessageType.GetMarkerCount:
                if (ReadMarkerCountCompleted != null)
                {
                    _colorMarkerCountResponseMessage = new ColorMarkerCountResponseMessage()
                    {
                        MarkerCount = obj.PayloadBuff[0]
                    };
                    ReadMarkerCountCompleted(this, _colorMarkerCountResponseMessage);
                }
                break;

            case MessageType.GetTimeSpan:
                if (ReadTimeSpanCompleted != null)
                {
                    _timeSpanResponseMessage           = new TimeSpanResponseMessage();
                    _timeSpanResponseMessage.TimeSpan  = obj.PayloadBuff[0];
                    _timeSpanResponseMessage.TimeSpan |= (UInt16)((UInt16)obj.PayloadBuff[1] << 8);
                    ReadTimeSpanCompleted(this, _timeSpanResponseMessage);
                }
                break;

            case MessageType.GetTimeProgress:
                if (ReadTimeProgressCompleted != null)
                {
                    _timeProgressResponseMessage = new TimeProgressResponseMessage();
                    _timeProgressResponseMessage.TimeProgress  = obj.PayloadBuff[0];
                    _timeProgressResponseMessage.TimeProgress |= (UInt16)((UInt16)obj.PayloadBuff[1] << 8);
                    ReadTimeProgressCompleted(this, _timeProgressResponseMessage);
                }
                break;

            case MessageType.GetSystemStateFlags:
                if (ReadSystemStateFlagsCompleted != null)
                {
                    _systemStateFlagsResponseMessage      = new SystemStateFlagsResponseMessage();
                    _systemStateFlagsResponseMessage.Data = obj.PayloadBuff;
                    ReadSystemStateFlagsCompleted(this, _systemStateFlagsResponseMessage);
                }
                break;
            }

            _messageType     = MessageType.Undefined;
            _pendingResponse = false;
        }
Пример #3
0
 void _messageReceiver_ReadTimeProgressCompleted(IMessenger sender, TimeProgressResponseMessage obj)
 {
     RaiseEventAction(ReadTimeProgressCompleted, obj);
 }