public void UpdateView(TreeModelNodeControls.ITreeModelEvent evt) { //save the latest status event if (evt.IpcEvent.EventType == "Status") _latestStatusEvent = evt.IpcEvent; }
/// <summary> /// Update this view (i.e. refresh what is displayed on the web page view). /// </summary> /// <param name="evt"></param> public void UpdateView(TreeModelNodeControls.ITreeModelEvent evt) { try { AcquireLock("UpdateView"); //cache and update status if (evt.IpcEvent.EventType == "Status" || evt.IpcEvent.EventType == "StatusReport") { _cachedStatusJson = evt.IpcEvent.ToJson(); if (_activeView) { InvokeJavascript("resetStatusView", _cachedStatusJson); } } //add event _cachedEvents.Add(evt); if (_cachedEvents.Count > 100) _cachedEvents.RemoveAt(0); if (_activeView) { InvokeJavascript("addRow", evt.IpcEvent.ToJson()); //, evtPropertiesSerialized); } } catch (Exception ex) { logger.Error("TreeModelNodeViewImpl failed to update view: " + ex.Message, ex); throw ex; } finally { ReleaseLock(); } }
public void UpdateView(TreeModelNodeControls.ITreeModelEvent evt) { _latestEvent = evt; _latestUpdateDate = DateTime.Now; }