private void CloseStatisticsView(int feedId, StatisticsView statisticsView) { statisticsView.CloseClicked -= StatisticsView_CloseClicked; statisticsView.Close(); statisticsView.Dispose(); _StatisticsViews.Remove(feedId); }
private void StatisticsView_CloseClicked(object sender, EventArgs e) { if (_StatisticsView != null) { _StatisticsView.CloseClicked -= StatisticsView_CloseClicked; _StatisticsView.Close(); _StatisticsView.Dispose(); _StatisticsView = null; } }
private void menuStatisticsToolStripMenuItem_Click(object sender, EventArgs e) { if (_StatisticsView != null) { _StatisticsView.WindowState = FormWindowState.Normal; _StatisticsView.Activate(); } else { _StatisticsView = new StatisticsView(); _StatisticsView.CloseClicked += StatisticsView_CloseClicked; _StatisticsView.Show(); } }
private void ShowStatisticsView(IFeed feed) { if (feed != null && feed.Listener.Statistics != null) { StatisticsView view; if (_StatisticsViews.TryGetValue(feed.UniqueId, out view)) { view.WindowState = FormWindowState.Normal; view.Activate(); } else { view = new StatisticsView(); view.Statistics = feed.Listener.Statistics; view.FeedName = feed.Name; view.CloseClicked += StatisticsView_CloseClicked; view.Show(); _StatisticsViews.Add(feed.UniqueId, view); } } }
private void StatisticsView_CloseClicked(object sender, EventArgs e) { if(_StatisticsView != null) { _StatisticsView.CloseClicked -= StatisticsView_CloseClicked; _StatisticsView.Close(); _StatisticsView.Dispose(); _StatisticsView = null; } }
private void menuStatisticsToolStripMenuItem_Click(object sender, EventArgs e) { if(_StatisticsView != null) { _StatisticsView.WindowState = FormWindowState.Normal; _StatisticsView.Activate(); } else { _StatisticsView = new StatisticsView(); _StatisticsView.CloseClicked += StatisticsView_CloseClicked; _StatisticsView.Show(); } }