private void CloseView() { if (CurrentView == -1) { // OK We are still at the select a graph screen. Find out which // graph was selected and go recursively create all the BaseViews // ready for showing to the user. XmlNode SelectedNode = XmlHelper.Find(Graphs, GraphList.Items[GraphList.SelectedIndex].ToString()); if (Controller.ApsimData.RootComponent == null) { Controller.ApsimData.New("<folder name=\"Graphs\"/>"); SelectedComponent = Controller.ApsimData.RootComponent; } SelectedComponent = Controller.Selection.Add(SelectedNode.OuterXml); CreateViews(SelectedComponent); GraphList.Visible = false; GraphListLabel.Visible = false; } else { BaseView View = Views[CurrentView]; ApsimFile.Component Comp = Controller.ApsimData.Find(View.NodePath); Comp.Contents = View.GetData(); View.Visible = false; } }
protected void UpdateCurrentTable(Filter filter = null) { int tableNumber = cb_table.SelectedIndex; if (curTableIndex != tableNumber) { curTableIndex = tableNumber; currentView = permittedTables[tableNumber]; currentPermissions = currentView.GetPermissionsOf(Program.Container.GetCurrentUser()); UpdateFilters(); } currentView.LoadData(filter); data = currentView.GetData(); ShowData(); }