예제 #1
0
 private void RegistrationWindow_Closed(object sender, EventArgs e)
 {
     if (_dialogResult != 1)
     {
         _authenticationWindow.ShowDialog();
     }
 }
예제 #2
0
        public MainWindow()
        {
            AuthenticationWindow aw = new AuthenticationWindow(hb);

            if (aw.ShowDialog() != true)
            {
                Close();
                return;
            }

            user = aw.User;

            InitializeComponent();

            Title = "Домашня бугалтерія - " + user.Name;

            curUserControl = ouc = new OrdersUserControl(hb);
            GridMain.Children.Add(ouc);
            GridFilters.Children.Add(ouc.FilterUserControl);

            buc = new BalanceUserControl(hb);
            GridMain.Children.Add(buc);

            erfpuc = new ExpensesRevenuesForPeriodUserControl(hb);
            GridMain.Children.Add(erfpuc);

            buc.Visibility = erfpuc.Visibility = Visibility.Collapsed;

            curButton = ButtonOrders;

            FieldChange("ButtonOrders");

            UpdateAll();
        }
예제 #3
0
        private bool Authenticate(Window window)
        {
            window.Hide();
            AuthenticationWindow authentication = new AuthenticationWindow();

            if (authentication.ShowDialog() == true)
            {
                window.Show();
                return(true);
            }
            return(false);
        }
예제 #4
0
        public static string AuthenticateTwitch(string username, bool isBot)
        {
            var authwindow = new AuthenticationWindow(username, isBot);

            if (authwindow.ShowDialog() == true)
            {
                return(authwindow.Oauth);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
        public static string AuthenticateTwitch(string username, bool isBot)
        {
            var authwindow = new AuthenticationWindow(username, isBot);

            if (authwindow.ShowDialog() == true)
            {
                //System.Console.WriteLine("My Oauth: " + authwindow.Oauth);
                return(authwindow.Oauth);
            }
            else
            {
                return(null);
            }
        }
예제 #6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            AuthenticationWindow    authWindow          = new AuthenticationWindow();
            AuthenticationViewModel authWindowViewModel = new AuthenticationViewModel();

            authWindow.DataContext              = authWindowViewModel;
            authWindowViewModel.LoginCompleted += (sender, args) =>
            {
                MainWindow = new MainWindow();
                MainWindow.Show();
                authWindow.Close();
            };
            authWindow.ShowDialog();
        }
예제 #7
0
        public MainWindowViewModel(MainWindow window)
        {
            AddNewEntityCommand = new DelegateCommand <object>(AddNewEntity, CanAddNewEntity);
            ShowAllInfoAboutSelectedAuthorCommand =
                new DelegateCommand <object>(ShowAllInfoAboutSelectedAuthor, CanShowAllInfoAboutSelectedAuthor);
            ShowAllInfoAboutSelectedPublisherCommand =
                new DelegateCommand <object>(ShowAllInfoAboutSelectedPublisher, CanShowAllInfoAboutSelectedPublisher);

            _mainWindow = window;
            var authenticationViewModel = new AuthenticationViewModel();

            authenticationViewModel.SignInConfirmed += AuthenticationViewModel_SignInConfirmed;
            authenticationViewModel.SignInSkipped   += AuthenticationViewModel_SignInSkipped;
            authenticationViewModel.SignUpConfirmed += AuthenticationViewModel_SignUpConfirmed;
            _authenticationWindow          = new AuthenticationWindow(authenticationViewModel);
            _mainWindow.SourceInitialized += delegate {
                _mainWindow.ShowActivated = false;
                _mainWindow.Hide();
                _authenticationWindow.Closed += AuthenticationWindow_Closed;
                _authenticationWindow.ShowDialog();
            };
        }
예제 #8
0
파일: App.xaml.cs 프로젝트: Dmitriy91/skype
        public static void Authenticate()
        {
            while (true)
            {
                AuthenticationWindow authenticationWindow = new AuthenticationWindow();
                authenticationWindow.ShowDialog();

                if (authenticationWindow.Tag == null)
                {
                    AsynchronousClientSocket.Shutdown();
                    Process.GetCurrentProcess().CloseMainWindow();
                }
                else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.Authenticated)
                {
                    break;
                }
                else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.ShowRegWin)
                {
                    RegistrationWindow registrationWindow = new RegistrationWindow();
                    registrationWindow.ShowDialog();

                    if (registrationWindow.Tag == null)
                    {
                        AsynchronousClientSocket.Shutdown();
                        Process.GetCurrentProcess().CloseMainWindow();
                    }
                }
            }
        }