Ejemplo n.º 1
0
        public LaunchController(IGuiHost host, ControllerConfig config, [NotNull] IDebug debug,
                                [NotNull] UserSettings settings)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }
            this.host = host;

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (debug == null)
            {
                throw new ArgumentNullException("debug");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            this.config   = config;
            this.debug    = debug;
            this.settings = settings;

            var updaterGui = new UpdaterGui(host, debug);

            host.SetContent(updaterGui);

            gui = updaterGui;
        }
Ejemplo n.º 2
0
 public UpdaterGui(IGuiHost host, [NotNull] IDebug debug)
     : this()
 {
     if (host == null) throw new ArgumentNullException("host");
     if (debug == null) throw new ArgumentNullException("debug");
     this.host = host;
     this.debug = debug;
 }
Ejemplo n.º 3
0
        public bool RemoveScreen(IGuiHost screen)
        {
            if (screen.ScreenState != ScreenState.Active)
            {
                return(false);
            }
            screen.ExitScreen();

            return(true);
        }
Ejemplo n.º 4
0
        public bool AddScreen(IGuiHost screen)
        {
            if (screen.ScreenState != ScreenState.Exit)
            {
                return(false);
            }

            screen.EnterScreen();
            hosts.Add(screen);

            return(true);
        }
Ejemplo n.º 5
0
 public UpdaterGui(IGuiHost host, [NotNull] IDebug debug)
     : this()
 {
     if (host == null)
     {
         throw new ArgumentNullException("host");
     }
     if (debug == null)
     {
         throw new ArgumentNullException("debug");
     }
     this.host  = host;
     this.debug = debug;
 }
Ejemplo n.º 6
0
        public LaunchController(IGuiHost host, ControllerConfig config, [NotNull] IDebug debug)
        {
            if (host == null) throw new ArgumentNullException("host");
            this.host = host;

            if (config == null) throw new ArgumentNullException("config");
            if (debug == null) throw new ArgumentNullException("debug");
            this.config = config;
            this.debug = debug;

            var updaterGui = new UpdaterGui(host, debug);
            host.SetContent(updaterGui);

            gui = updaterGui;
        }
Ejemplo n.º 7
0
 public void AddGuiHost(string guiHostId, IGuiHost guiHost)
 {
     Contract.Requires(!hosts.ContainsKey(guiHostId), "A GuiHost with the same id is already registered");
     this.hosts.Add(guiHostId, guiHost);
 }
Ejemplo n.º 8
0
 private void DrawHost(IGuiHost host)
 {
     spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
     host.Draw(spriteBatch);
     spriteBatch.End();
 }
Ejemplo n.º 9
0
 public bool IsShowing(IGuiHost screen)
 {
     return(hosts.Contains(screen));
 }