public void DeletePage() { if (EventData.Pages.Count == 1) { return; } EventPageContainer ct = EventPageContainers.Find(epc => epc.PageData == EventData.Pages[TabController.SelectedIndex]); ct.Dispose(); EventPageContainers.Remove(ct); EventData.Pages.RemoveAt(TabController.SelectedIndex); TabController.DestroyTab(TabController.SelectedIndex); if (TabController.SelectedIndex >= EventPageContainers.Count) { TabController.SelectTab(TabController.SelectedIndex - 1); } else { TabController.SelectTab(TabController.SelectedIndex); } UpdateNames(); if (EventData.Pages.Count == 1) { DeletePageButton.SetEnabled(false); } }
public void ClearPage() { EventPageContainer ct = EventPageContainers.Find(epc => epc.PageData == EventData.Pages[TabController.SelectedIndex]); ct.Dispose(); EventPageContainers.Remove(ct); EventData.Pages[TabController.SelectedIndex] = new EventPage(); EventPageContainer newct = new EventPageContainer(this, EventData, EventData.Pages[TabController.SelectedIndex], TabController.Tabs[TabController.SelectedIndex]); newct.SetSize(750, 515); EventPageContainers.Insert(TabController.SelectedIndex, newct); UpdateNames(); }