/**************/ /* AssignData */ /**************/ private void AssignData( FocusStack theFocusStack, Dictionary <Focus, Agenda> theAgendaMap) { focusStack = theFocusStack; agendaMap = theAgendaMap; focusStackDataGridView.ItemsSource = theFocusStack.GetStack(); if (theFocusStack.Count == 0) { activationDataGridView.ItemsSource = null; } else { activationDataGridView.ItemsSource = theAgendaMap[theFocusStack.GetStack().First()].GetActivations(); } if (theFocusStack.Count != 0) { focusStackDataGridView.SelectedItem = theFocusStack.GetStack().First(); if (theAgendaMap[theFocusStack.GetStack().First()].GetActivations().Count != 0) { activationDataGridView.SelectedItem = theAgendaMap[theFocusStack.GetStack().First()].GetActivations().First(); } } }
/**************/ /* UpdateData */ /**************/ public void UpdateData( FocusStack theFocusStack, Dictionary <Focus, Agenda> theAgendaMap) { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate { AssignData(theFocusStack, theAgendaMap); })); }
/************************/ /* AgendaBrowserManager */ /************************/ public AgendaBrowserManager( MainWindow theIDE) { ide = theIDE; focusStack = new FocusStack(); agendaMap = new Dictionary <Focus, Agenda>(); }
/*****************/ /* RemoveBrowser */ /*****************/ public void RemoveBrowser( AgendaBrowser theBrowser) { browsers.Remove(theBrowser); if (browsers.Count == 0) { focusStack = null; agendaMap = null; } }
/*************/ /* FetchData */ /*************/ private void FetchData() { focusStack = ide.GetEnvironment().GetFocusStack(); agendaMap = new Dictionary <Focus, Agenda>(); foreach (Focus theFocus in focusStack) { if (!agendaMap.ContainsKey(theFocus)) { Agenda theAgenda = ide.GetEnvironment().GetAgenda(theFocus); agendaMap.Add(theFocus, theAgenda); } } }