コード例 #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
ファイル: Authentication.cs プロジェクト: FlashPros/OakBot
        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();
                    }
                }
            }
        }