private void EnterButton_Click(object sender, RoutedEventArgs e) { if (ModelCheck()) { try { _user.Login = LoginTextBox.Text; _user.Password = PassTextBox.Text; _user.IsBlocked = false; _user.RoleId = 1; _reader.FIO = FIOTextBox.Text; _reader.BirthDate = BirthDatePicker.SelectedDate; _reader.Phone = PhoneTextBox.Text; _reader.IsCollegeEmployee = IsEmpCheckBox.IsChecked; _reader.Rating = 0; dBQueryHelper.AddUserWithReader(_reader, _user); AuthorizationWindow mainWindow = new AuthorizationWindow(); mainWindow.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
private void labelBack_MouseEnter(object sender, MouseEventArgs e) { AuthorizationWindow mainWindow = new AuthorizationWindow(); mainWindow.Show(); this.Close(); }
public void AuthorizeTest() { AuthorizationWindow authorize = new AuthorizationWindow(); Assert.IsTrue(authorize.Authorize("lerka", "123")); Assert.IsFalse(authorize.Authorize("", "")); }
private void ExitButton_Click(object sender, RoutedEventArgs e) { AuthorizationWindow mainWindow = new AuthorizationWindow(); mainWindow.Show(); this.Close(); }
private void AuthorizationBtn_Click(object sender, RoutedEventArgs e) { AuthorizationWindow authorizationWindow = new AuthorizationWindow(); Close(); authorizationWindow.Show(); }
private void AutificationWindow() { AuthorizationWindow login = new AuthorizationWindow(VisibilityAfterUutification, CloseProgram, SetName, SetImageProfile); login.ShowDialog(); NameUser.Text = _nameUser; }
public static Authorization AuthorizeNewAccount(string redirectUrl, string scope) { Authorization account = new Authorization(); AuthorizationWindow authWindow = new AuthorizationWindow(clientId, redirectUrl, scope); authWindow.AuthSuccess += authWindow_AuthSuccess; authWindow.Show(); return(account); }
private void ProfileButton_Click(object sender, RoutedEventArgs e) { ProfileWindow profileWindow = new ProfileWindow((int)InformationAboutCurrnetUser.UserId); if (profileWindow.ShowDialog() == true) { LogOutOnGoogle(); InformationAboutCurrnetUser.NullAllSettings(); AuthorizationWindow authorization = new AuthorizationWindow(); authorization.Show(); this.Close(); } }
protected override void OnStartup(StartupEventArgs e) { IDbContextFactory <FileCabinetContext> dbContextFactory = new FileCabinetDbContextFactory(); IUnitOfWork unitOfWork = new UnitOfWork(dbContextFactory); IAuthorizationService service = new AuthorizationService(unitOfWork); Window authorization = new AuthorizationWindow(service, unitOfWork); authorization.Show(); //var windowFactory = new SimpleWindowFactory(unitOfWork, 87); //var window = windowFactory.CreateWindow(WindowType.Admin); //window.Show(); base.OnStartup(e); }
/// <summary> /// Вызов модального окна для ввода IP-адресса, порта и логина /// </summary> private void Authorization() { AuthorizationWindow authorizationWindow = new AuthorizationWindow(); if (authorizationWindow.ShowDialog() == true) { client = authorizationWindow.ReadyClient; client.StopServer += ServerStatus_Changed; client.AddToLog += LogList_AddData; } else { Application.Current.Shutdown(); } }
public App() { var preloaderWindow = new PreloaderWindow(); preloaderWindow.Show(); InitializeComponent(); MainWindow = new MainWindow(); ResourceSet resourceSet = InCollege.Properties.Resources.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true); if (!Directory.Exists(CommonVariables.TemplatesDirectory)) { Directory.CreateDirectory(CommonVariables.TemplatesDirectory); foreach (DictionaryEntry entry in resourceSet) { if (entry.Key.ToString().EndsWith("_TEMPLATE")) { File.WriteAllBytes(Path.Combine(CommonVariables.TemplatesDirectory, $"{entry.Key.ToString().Split(new[] { "_TEMPLATE" }, StringSplitOptions.RemoveEmptyEntries)[0]}.docx"), (byte[])entry.Value); } } } var loginWindow = new AuthorizationWindow(); var tokenValid = Token != null && ValidateToken(); preloaderWindow.Close(); if (tokenValid || loginWindow.ShowDialog().HasValue&& loginWindow.DialogResult.Value) { MainWindow.ShowDialog(); } else { Shutdown(); } try { NetworkUtils.Disconnect().Wait(); } catch (Exception e) when(e is AggregateException || e is HttpRequestException || e is WebException) { } }
/// <summary> /// Вызов модального окна для ввода IP-адресса и порта сервера /// </summary> public bool Authorization(out string address, out int port) { AuthorizationWindow authorizationWindow = new AuthorizationWindow(); if (authorizationWindow.ShowDialog() == true) { address = authorizationWindow.Address; port = int.Parse(authorizationWindow.Port); return(true); } else { address = ""; port = -1; return(false); } }
public MainWindow() { InitializeComponent(); this.DataContext = MainViewModel.This; if (Settings.Default.token == "") { //скрываем главную форму если нет токена Visibility = Visibility.Hidden; //отображаем окно авторизации var authorization = new AuthorizationWindow { main = this }; //ссылка на главную форму authorization.Show(); } else { VkSettings.Token = Settings.Default.token; } }
private Init() { AuthWindow = new AuthorizationWindow(); ConnectApp = Connect.Instance(); }
static void authWindow_AuthSuccess(object sender, AuthorizationWindow.AuthEventArgs e) { if (e != null) { } }
/// <summary> /// Opens a window where the user enters his credentals to authorize your app /// You MUST listen on the AuthSuccess event which will give you the access token on success /// Be aware that you need to change the registry to bring the WebBrowser control out of quirks mode as described on /// https://github.com/liGhun/AppNet.NET/blob/master/README.md /// See Model.Authorization.registerAppInRegistry() to do so automatically /// </summary> /// <param name="clientId">Your app's client ID</param> /// <param name="redirectUrl">The url where App.net will redirect the user on success. While not really important on the client side flow itself it needs to be an available URL</param> /// <param name="scope">The space separated list of the scopes your app needs</param> public clientSideFlow(string clientId, string redirectUrl, string scope) { authWindowClientSide = new AuthorizationWindow(clientId, redirectUrl, scope); authWindowClientSide.AuthSuccess += authWindowServerSide_AuthSuccess; }
public serverSideFlow(string clientId, string redirectUrl, string scope) { throw new NotImplementedException(); authWindowServerSide = new AuthorizationWindow(clientId, redirectUrl, scope, true); authWindowServerSide.AuthSuccess += authWindowServerSide_AuthSuccess; }
public AuthorizationViewModel(AuthorizationWindow mainWindow) { this.mainWindow = mainWindow; LoadView(ViewType.Authorization); }
private void AutificationWindow() { AuthorizationWindow login = new AuthorizationWindow(VisibilityAfterUutification, _db); login.ShowDialog(); }
void authWindowServerSide_AuthSuccess(object sender, AuthorizationWindow.AuthEventArgs e) { AuthSuccess(this, e); }
public static Authorization AuthorizeNewAccount(string redirectUrl, string scope) { Authorization account = new Authorization(); AuthorizationWindow authWindow = new AuthorizationWindow(clientId, redirectUrl, scope); authWindow.AuthSuccess += authWindow_AuthSuccess; authWindow.Show(); return account; }
public UserAuthorizationViewModel(AuthorizationWindow window) { Window = window; }