Exemple #1
0
        public void Execute(object parameter)
        {
            var setup = new SetupWindow(_workspace);

            setup.ShowDialog();
            _workspace.FocusListView();
        }
Exemple #2
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            string      path     = Application.ExecutablePath;
            EndogineHub endogine = new EndogineHub(path);

            string[] aAvailableStrategies = StageBase.GetAvailableRenderers();
            //Endogine.MdiParent mdiParent = new MdiParent();
            //SetupWindow wndSetup = new SetupWindow(aAvailableStrategies, mdiParent);
            SetupWindow wndSetup = new SetupWindow(aAvailableStrategies, null);

            wndSetup.ShowDialog();

            Main main = new Main();

            main.Show();

            endogine.Init(main, null, null);
            main.EndogineInitDone();

            MusicGame.Midi.Main game = new MusicGame.Midi.Main();

            while (endogine.MainLoop())
            {
                Application.DoEvents();
            }
        }
Exemple #3
0
        private static IEmulatorWindow SetupWindow(ISettings settings, ILoggerFactory loggerFactory,
                                                   ITextRecognition recognition)
        {
            IEmulatorWindow window = settings.EmulatorType switch
            {
                EmulatorType.NoxPlayer => new NoxWindow(settings.WindowName),
                EmulatorType.BlueStacks => new BluestacksWindow(loggerFactory.CreateLogger <BluestacksWindow>(), recognition, settings.WindowName),
                _ => throw new Exception("Invalid emulator type")
            };

            try
            {
                window.Initialize();
            }
            catch (FailedToFindWindowException)
            {
                var setup = new SetupWindow();
                var vm    = new SetupViewModel(loggerFactory.CreateLogger <SetupViewModel>(), recognition, settings);
                setup.DataContext = vm;
                vm.Saved         += () =>
                {
                    setup.DialogResult = true;
                    //setup.Hide();
                };

                if (setup.ShowDialog() != true)
                {
                    Current.Shutdown();
                }

                window = SetupWindow(settings, loggerFactory, recognition);
            }

            return(window);
        }
Exemple #4
0
        /// <summary>
        /// Handles the OpenSetupRequested event.
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/>.</param>
        /// <param name="e">The e<see cref="ViewModelEventArgs"/>.</param>
        private void Vm_OpenSetupRequested(object sender, ViewModelEventArgs e)
        {
            WpfHelper.SetWindowSettings(Window.GetWindow(this));
            var win = new SetupWindow();

            win.ShowDialog();
        }
Exemple #5
0
        public void ShowSetupDialog(MainWindow mainWindow = null)
        {
            _parent.Effect = new BlurEffect();

            var setupWindow = new SetupWindow(mainWindow)
            {
                Owner = Window.GetWindow(_parent)
            };

            setupWindow.ShowDialog();

            _parent.Effect = new DropShadowEffect();
        }
 private SetupViewModel(Entities entities)
 {
     _entities = entities;
     MoveBack = new RelayCommand<int>(LoadPreviousVehicle);
     MoveForward = new RelayCommand<int>(LoadNextVehicle);
     Save = new RelayCommand<int>(SaveVechicle);
     Close = new RelayCommand<int>((i) => _window.Close());
     Types = _entities.Types.ToList();
     _window = new SetupWindow();
     _window.DataContext = this;
     Load(_entities.Vehicles);
     _window.ShowDialog();
 }
        /// <summary>
        /// Session command
        /// </summary>
        public void GoToSessionBuilder()
        {
            var window = new SetupWindow();
            var mModel = new SetupViewModel();

            window.DataContext           = mModel;
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            try
            {
                window.ShowDialog();
            }
            catch (NullReferenceException ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Exemple #8
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            m_endogine = new EndogineHub(Application.ExecutablePath);

            string[] aAvailableStrategies = StageBase.GetAvailableRenderers(null);
//			string[] aAvailableStrategies = new string[]{Enum.GetName(typeof(EndogineHub.RenderStrategy), 0), Enum.GetName(typeof(EndogineHub.RenderStrategy), 1)};
            if (Endogine.AppSettings.Instance.GetNodeText("MDI") != "false")
            {
                this.IsMdiContainer = true;
            }

            if (Endogine.AppSettings.Instance.GetNodeText("SetupDialog") != "false")
            {
                SetupWindow wndSetup = new SetupWindow(aAvailableStrategies, this);
                wndSetup.ShowDialog();
            }

            m_formStage = new Main();

            Form formMdiParent = (Form)null;

            if (this.IsMdiContainer)
            {
                this.Width            = 800;
                this.Height           = 600;
                this.WindowState      = FormWindowState.Maximized;
                formMdiParent         = this;
                m_formStage.MdiParent = this;
            }
            else
            {
                this.Visible = false;                 //TODO: this doesn't work
                this.Text    = "Should be invisible!";
            }
            //TODO: anyhow, it's strange to use a Form to start from, the project should probably be a console application.

            m_formStage.Show();

            m_endogine.Init(m_formStage, formMdiParent, this);
            m_formStage.EndogineInitDone();
        }