Esempio n. 1
0
        void OpenWindowCommandExecute()
        {
            if (Username == string.Empty)
            {
                MessageBoxService.ShowMessage("Wpisz Użytkownika!");
                return;
            }
            if (Password == string.Empty)
            {
                MessageBoxService.ShowMessage("Wpisz Hasło");
                return;
            }
            IHP_ZAM_USERS user = DoLogin(Username, Password);

            if (user != null)
            {
                ProgramDataSotrage.User = user;

                MainWindowService.ShowMainWindow();

                //var w = new JaednDodatPodpowiedz();
                //w.ShowDialog();

                Messenger.Default.Send <IHP_ZAM_USERS>(user);
                CurrentWindowService.Close();
            }
            else
            {
                MessageBoxService.ShowMessage("Niepoprawny Użytkownik lub Hasło!");
            }
        }
        public void SetWindowState2()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;

            Assert.AreEqual(DXWindowState.Normal, iService.WindowState);
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            RealWindow.Content = grid;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                Assert.AreEqual(DXWindowState.Normal, iService.WindowState);
                iService.WindowState = DXWindowState.Maximized;
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.AreEqual(WindowState.Maximized, RealWindow.WindowState);
                iService.WindowState = DXWindowState.Minimized;
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.AreEqual(WindowState.Minimized, RealWindow.WindowState);
            });
            EnqueueTestComplete();
        }
Esempio n. 3
0
 public void Cancel()
 {
     if (ModernDialogService.Show(Properties.Resources.NotCompleted, ApplicationTitle,
                                  MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         CurrentWindowService.Close();
     }
 }
Esempio n. 4
0
        public async Task Run(CancelEventArgs args)
        {
            args.Cancel = true;

            AsyncCommand <CancelEventArgs> defaultCommand = DefaultCommand.Command as AsyncCommand <CancelEventArgs>;

            CancelCommand.Command = defaultCommand.CancelCommand;

            await RunCore(defaultCommand.CancellationTokenSource);

            CurrentWindowService.Close();
        }
 public void Activate() {
     CurrentWindowService service = new CurrentWindowService();
     ICurrentWindowService iService = service;
     Grid grid = new Grid();
     Interactivity.Interaction.GetBehaviors(grid).Add(service);
     RealWindow.Content = grid;
     RealWindow.ShowActivated = false;
     EnqueueShowRealWindow();
     EnqueueCallback(() => {
         Assert.IsFalse(RealWindow.IsActive);
         iService.Activate();
         Assert.IsTrue(RealWindow.IsActive);
     });
     EnqueueTestComplete();
 }
        public void ActualWindow_HiddenWindow()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;

            Interactivity.Interaction.GetBehaviors(RealWindow).Add(service);
            try {
                EnqueueCallback(() => {
                    Assert.AreSame(RealWindow, service.ActualWindow);
                });
                EnqueueTestComplete();
            } finally {
                Interactivity.Interaction.GetBehaviors(RealWindow).Remove(service);
            }
        }
        public void Activate()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            RealWindow.Content       = grid;
            RealWindow.ShowActivated = false;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                Assert.IsFalse(RealWindow.IsActive);
                iService.Activate();
                Assert.IsTrue(RealWindow.IsActive);
            });
            EnqueueTestComplete();
        }
Esempio n. 8
0
        public void Finish()
        {
            if (LaunchApplication)
            {
                try
                {
                    Process.Start(Path.Combine(SetupLocation, ProductName + ".exe"));
                }
                catch (Exception e)
                {
                    ModernDialogService.Show(e.Message, ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }

            Utilities.SetCurrentSetupLocation(SetupLocation, ApplicationTitle);
            CurrentWindowService.Close();
        }
 public void ActualWindow() {
     CurrentWindowService service = new CurrentWindowService();
     ICurrentWindowService iService = service;
     Grid grid = new Grid();
     Interactivity.Interaction.GetBehaviors(grid).Add(service);
     service.Window = new Window();
     service.Window = null;
     RealWindow.Content = grid;
     EnqueueShowRealWindow();
     EnqueueCallback(() => {
         Assert.AreSame(RealWindow, service.ActualWindow);
         service.Window = new Window();
         Assert.AreNotSame(RealWindow, service.ActualWindow);
         service.Window = null;
         Assert.AreSame(RealWindow, service.ActualWindow);
     });
     EnqueueTestComplete();
 }
        public void ActualWindow()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            service.Window     = new Window();
            service.Window     = null;
            RealWindow.Content = grid;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                Assert.AreSame(RealWindow, service.ActualWindow);
                service.Window = new Window();
                Assert.AreNotSame(RealWindow, service.ActualWindow);
                service.Window = null;
                Assert.AreSame(RealWindow, service.ActualWindow);
            });
            EnqueueTestComplete();
        }
 public void SetWindowState() {
     CurrentWindowService service = new CurrentWindowService();
     ICurrentWindowService iService = service;
     Grid grid = new Grid();
     Interactivity.Interaction.GetBehaviors(grid).Add(service);
     RealWindow.Content = grid;
     EnqueueShowRealWindow();
     EnqueueCallback(() => {
         iService.SetWindowState(WindowState.Maximized);
     });
     EnqueueWindowUpdateLayout();
     EnqueueCallback(() => {
         Assert.AreEqual(WindowState.Maximized, RealWindow.WindowState);
         iService.SetWindowState(WindowState.Minimized);
     });
     EnqueueWindowUpdateLayout();
     EnqueueCallback(() => {
         Assert.AreEqual(WindowState.Minimized, RealWindow.WindowState);
     });
     EnqueueTestComplete();
 }
 public void ShowHide() {
     CurrentWindowService service = new CurrentWindowService();
     ICurrentWindowService iService = service;
     Grid grid = new Grid();
     Interactivity.Interaction.GetBehaviors(grid).Add(service);
     RealWindow.Content = grid;
     EnqueueShowRealWindow();
     EnqueueCallback(() => {
         iService.Hide();
     });
     EnqueueWindowUpdateLayout();
     EnqueueCallback(() => {
         Assert.IsFalse(RealWindow.IsVisible);
         iService.Show();
     });
     EnqueueWindowUpdateLayout();
     EnqueueCallback(() => {
         Assert.IsTrue(RealWindow.IsVisible);
     });
     EnqueueTestComplete();
 }
        public void ShowHide()
        {
            CurrentWindowService  service  = new CurrentWindowService();
            ICurrentWindowService iService = service;
            Grid grid = new Grid();

            Interactivity.Interaction.GetBehaviors(grid).Add(service);
            RealWindow.Content = grid;
            EnqueueShowRealWindow();
            EnqueueCallback(() => {
                iService.Hide();
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.IsFalse(RealWindow.IsVisible);
                iService.Show();
            });
            EnqueueWindowUpdateLayout();
            EnqueueCallback(() => {
                Assert.IsTrue(RealWindow.IsVisible);
            });
            EnqueueTestComplete();
        }
Esempio n. 14
0
 public void Exit()
 {
     CurrentWindowService.Close();
 }
Esempio n. 15
0
 public void ActivateMainWindow()
 {
     CurrentWindowService.SetWindowState(System.Windows.WindowState.Normal);
     CurrentWindowService.Activate();
 }
Esempio n. 16
0
 private void ExecuteCloseApplication() => CurrentWindowService?.Close();
 void OnCloseWindowCommandExecute()
 {
     CurrentWindowService.Close();
 }