/**************************/ /* AgendaBrowser_Executed */ /**************************/ private void AgendaBrowser_Executed( object sender, ExecutedRoutedEventArgs e) { if (agendaBrowserManager.BrowserCount() == 0) { ClosableTab theTabItem = new ClosableTab(); theTabItem.Title = "Agenda"; OpenTabItem(theTabItem); AgendaBrowser theBrowser = agendaBrowserManager.CreateBrowser(); theTabItem.Content = theBrowser; } else { foreach (ClosableTab theTabItem in this.debugTabControl.Items) { if (theTabItem.Content is AgendaBrowser) { AgendaBrowser theBrowser = theTabItem.Content as AgendaBrowser; if (agendaBrowserManager.ManagesBrowser(theBrowser)) { OpenExistingTabItem(theTabItem); return; } } } } }
/******************/ /* ManagesBrowser */ /******************/ public bool ManagesBrowser( AgendaBrowser theBrowser) { lock (browsers) { return(browsers.Contains(theBrowser)); } }
/*****************/ /* RemoveBrowser */ /*****************/ public void RemoveBrowser( AgendaBrowser theBrowser) { browsers.Remove(theBrowser); if (browsers.Count == 0) { focusStack = null; agendaMap = null; } }
/*****************/ /* CreateBrowser */ /*****************/ public AgendaBrowser CreateBrowser() { AgendaBrowser theBrowser = new AgendaBrowser(ide); browsers.Add(theBrowser); if (!ide.dialog.GetExecuting()) { if (browsers.Count == 1) { FetchData(); } theBrowser.UpdateData(focusStack, agendaMap); } return(theBrowser); }
/*****************/ /* UpdateBrowser */ /*****************/ private void UpdateBrowser( AgendaBrowser theBrowser) { theBrowser.UpdateData(focusStack, agendaMap); }