void SetupObservables() { MessageListViewModel.GetPropertyValues(m => m.SelectedMessage) .Throttle(TimeSpan.FromMilliseconds(200), TaskPoolScheduler.Default) .ObserveOnDispatcher() .Subscribe( m => MessageDetailViewModel.LoadMessageEntry(MessageListViewModel.SelectedMessage)); Observable.FromEventPattern <EventHandler, EventArgs>(h => new EventHandler(h), h => _logClientSinkQueue.LogEvent += h, h => _logClientSinkQueue.LogEvent -= h).ObserveOnDispatcher().Subscribe(o => { foreach (var e in _logClientSinkQueue.GetLastEvents().ToList()) { LogText = LogText.Replace("<body>", "<body>" + string.Join(" ", RenderLogEventParts(e))); } }); this.GetPropertyValues(m => m.IsLogOpen) .ObserveOnDispatcher() .Subscribe(m => { MessageListViewModel.IsLoading = m; MessageDetailViewModel.IsLoading = m; }); }
public NotifySrvInfoItem(NotifySrvInfo info, bool delCrlf = true) { Time = info.time.ToString("yyyy\\/MM\\/dd HH\\:mm\\:ss.fff"); TimeView = info.time.ToString("yyyy\\/MM\\/dd(ddd) HH\\:mm\\:ss.fff"); var notifyID = (UpdateNotifyItem)info.notifyID; Title = notifyID == UpdateNotifyItem.PreRecStart ? "予約録画開始準備" : notifyID == UpdateNotifyItem.RecStart ? "録画開始" : notifyID == UpdateNotifyItem.RecEnd ? "録画終了" : notifyID == UpdateNotifyItem.RecTuijyu ? "追従発生" : notifyID == UpdateNotifyItem.ChgTuijyu ? "番組変更" : notifyID == UpdateNotifyItem.PreEpgCapStart ? "EPG取得" : notifyID == UpdateNotifyItem.EpgCapStart ? "EPG取得" : notifyID == UpdateNotifyItem.EpgCapEnd ? "EPG取得" : info.notifyID.ToString(); LogText = notifyID == UpdateNotifyItem.EpgCapStart ? "開始" : notifyID == UpdateNotifyItem.EpgCapEnd ? "終了" : info.param4; if (delCrlf == true) { LogText = LogText.Replace("\r\n↓\r\n", " → "); } if (delCrlf == true) { LogText = LogText.Replace("\r\n", " "); } keyID = (ulong)this.ToString().GetHashCode(); }
public string ToDataString() { return(string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", GeocacheCode ?? "", LogType.ID, VisitDate.ToString("s"), LogText == null ? "" : LogText.Replace("|", "(!-!)").Replace("\n", "").Replace("\r", "<!br!>"), TrackableDrop.ToString(), TrackableRetrieve.Replace("|", "(!-!)"), AddToFavorites.ToString(), getImagesDataString())); }