private void ProcessMrnMessageEvent(object sender, MrnMessageEventArgs e) { this.Dispatcher.BeginInvoke(new Action(() => { switch (e.Data.MsgType) { case MessageTypeEnum.Refresh: { var msg = $"Streaming"; var originalTitle = $"{_windowsName} Status::"; MrnViewerDesktop.Title = $"{originalTitle} {msg}"; break; } case MessageTypeEnum.Update: { var story = new Model.MrnStory { TimeStamp = e.TimeStamp, Index = _count++, Story = e.Data.Story, GUID = e.Data.GUID, MrnSource = e.Data.Story.Provider, Frag_Num = (int)e.Data.FRAG_NUM, Tot_Size = e.Data.TOT_SIZE }; _fragmentCollection.Insert(0, story); break; } } })); }
protected void RaiseMrnMessageEvent(DateTime timestamp, MrnStoryData data) { var messageCallback = new MrnMessageEventArgs() { Data = data, TimeStamp = timestamp }; OnMessage(messageCallback); }
protected virtual void OnMessage(MrnMessageEventArgs e) { var handler = MessageEvent; handler?.Invoke(this, e); }