/// <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);
        }
Esempio n. 2
0
 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.");
 }
Esempio n. 3
0
 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.");
 }
Esempio n. 4
0
 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;
        }