private void ShowAgentViewer() { if (lvwAgents.SelectedItems.Count == 1 && lvwAgents.SelectedItems[0].Tag is INotifier) { INotifier currentNotifier = (INotifier)lvwAgents.SelectedItems[0].Tag; INotivierViewer currentNotivierViewer = (from v in agentDetailViews where v.SelectedNotifier == currentNotifier select v).FirstOrDefault(); if (currentNotivierViewer != null && !currentNotivierViewer.IsViewerStillVisible()) { agentDetailViews.Remove(currentNotivierViewer); currentNotivierViewer = null; } if (currentNotivierViewer == null) { WinFormsUINotifierBase agentUI = RegisteredAgentUIMapper.GetNotifierUIClass(currentNotifier); if (agentUI != null && agentUI.HasDetailView) { currentNotivierViewer = agentUI.Viewer; currentNotivierViewer.SelectedNotifier = currentNotifier; agentDetailViews.Add(currentNotivierViewer); } } if (currentNotivierViewer != null) { currentNotivierViewer.ShowNotifierViewer(); } ; } }
public void ShowViewer() { if (Notifier != null && Notifier.HasViewer) { if (notifierViewer == null || (!notifierViewer.IsStillVisible())) { notifierViewer = Notifier.GetNotivierViewer(); notifierViewer.SetWindowTitle(Name + " (" + this.NotifierRegistrationName + ")"); notifierViewer.ShowNotifierViewer(Notifier); } else { notifierViewer.RefreshConfig(Notifier); } } }