/// <summary> /// /// </summary> /// <param name="screen"></param> /// <param name="isInitialized"></param> public void AddScreen(Screen screen, bool isInitialized) { screen.ScreenManager = this; if (!isInitialized) { screen.Initialize(); screen.LoadContent(); } screens.Add(screen); }
internal void GoToScreen(string name) { if(screens.ContainsKey(name)) { ActiveScreen = screens[name]; ActiveScreen.Start(); } else throw new Exception("You tried to go to a named screen that doesn't exist. Check the spelling, including capitalisation."); }
public void GoToScreen(int number) { if (screens.Count() < number && number >= 0) { ActiveScreen = screens.ElementAt(number).Value; ActiveScreen.Start(); } else throw new Exception("You tried to go to a screen number that does not exist."); }
public void Add(Screen ScreenToAdd, string name) { screens.Add(name, ScreenToAdd); if (ActiveScreen == null) ActiveScreen = ScreenToAdd; }
/// <summary> /// /// </summary> /// <param name="screen"></param> public void RemoveScreen(Screen screen) { screens.Remove(screen); screens[screens.Count - 1].ScreenState = State.Visible; }