Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IScreen"/> class.
 /// </summary>
 /// <param name="gui">The GUI Component, if null you cant use GUI in this screen.</param>        
 public IScreen(IGui gui = null)
 {
     this.gui = gui;
     IsLoaded = false;
     CleanUpWhenRemoved = true;
     CleanupAbles = new List<ICleanupAble>();
 }
Пример #2
0
 public Options(IGui gui)
     : base(gui)
 {
 }
Пример #3
0
Файл: Menu.cs Проект: tubitos/1
 public Menu(IGui gui)
     : base(gui)
 {
 }
Пример #4
0
 public I2DScene(IGui gui = null) : base(gui) { }
Пример #5
0
        /// <summary>
        /// Cleans up resources that dont are exclusive of the screen        
        /// </summary>
        protected virtual void CleanUp(EngineStuff engine)
        {
            if (CleanUpWhenRemoved)
            {
#if WINDOWS
                foreach (var item in KeyBinds.Values)
                {
                    item.BindAction = BindAction.REMOVE;
                    CommandProcessor.getCommandProcessor().SendCommandAssyncronous(item);
                }
                foreach (var item in MouseBinds.Values)
                {
                    item.BindAction = BindAction.REMOVE;
                    CommandProcessor.getCommandProcessor().SendCommandAssyncronous(item);
                }
#elif WINDOWS_PHONE
            foreach (var item in GestureBinds.Values)
            {
                item.BindAction = BindAction.REMOVE;
                CommandProcessor.getCommandProcessor().SendCommandAssyncronous(item);
            }
            
#endif

                IScreenUpdateable[] updts = updateables.ToArray();

                for (int i = 0; i < updts.Length; i++)
                {
                    updts[i].iCleanUp();
                }

                if (gui != null)
                {
                    gui.iDispose();
                    gui = null;
                }

                foreach (var item in CleanupAbles)
                {
                    item.CleanUp(graphicFactory);
                }
                CleanupAbles.Clear();
#if DEBUG
            GC.Collect();
            GC.WaitForPendingFinalizers();
#endif
            }
        }