private void Voltar() { WindowLogin login = new WindowLogin(); login.Show(); this.Close(); }
public WindowChangePassword(WindowLogin Main, string login, string email) { InitializeComponent(); this.login = login; this.email = email; this.Main = Main; }
private void Button_Click(object sender, RoutedEventArgs e) { Window next = new WindowLogin(); next.Show(); this.Close(); }
private void signout(object sender, RoutedEventArgs e) { Window signout = new WindowLogin(); signout.Show(); this.Close(); }
public WindowInputCode(WindowLogin Main, string login, string authenticationCode, string email) { InitializeComponent(); this.login = login; this.email = email; this.authentificationCode = authenticationCode; this.Main = Main; }
private void BtnSubmit_Click(object sender, RoutedEventArgs e) { ForgottenPasswordService.ResetPassword(TbEmail.Text); MessageBox.Show("You got a new email"); WindowLogin windowLogin = new WindowLogin(); windowLogin.Show(); this.Hide(); }
private void Login() { WindowLogin login = new WindowLogin(ServiceData.GetInstance().GetTitle(), Release.GetInstance().GetVersion()); login.LoginViewModel.PasswordCorrect += LoginPasswordCorrect; login.LoginViewModel.CloseMainWindow += CloseMainWindow; this.Hide(); _windowSplash?.Close(); login.LoginViewModel.CheckVersion(Release.GetInstance().GetBuildDateTime(), Release.GetInstance().GetVersion()); login.LoginViewModel.Create(); }
public static bool InitializeEngine() { NetworkSocket.Initialize(); try { background = new EngineObject($"{Common.Configuration.GamePath}/Data/background.png", 1024, 768); background.Size = new Size2(1024, 768); background.SourceRect = new Rectangle(0, 0, 1024, 720); DataManager.Initialize(); WindowTalent.Initialize(); WindowSkill.Initialize(); WindowPin.Initialize(); WindowCash.Initialize(); WindowMail.Initialize(); WindowSelectedItem.Initialize(); WindowViewTalent.Initialize(); //Carrega os dados de classe. ClasseManager.Initialize(); //Carrega os dados de npc. NpcManager.OpenData(); //Carrega os dados de experiencia ExperienceManager.Read(); EngineFont.Initialize(); EngineMessageBox.Initialize(); EngineInputBox.Initialize(); EngineMultimedia.Initialize(); WindowLogin.Initialize(); WindowServer.Initialize(); WindowCharacter.Initialize(); WindowNewCharacter.Initialize(); WindowGame.Initialize(); WindowViewItem.Initialize(); // EngineMultimedia.PlayMusic(0, true); GameState = 1; return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
public void Initialize() { mView = new WindowLogin(); mViewModel = new WindowLoginViewModel { LoginCommand = new RelayCommand(ExecuteLoginCommand), }; mView.DataContext = mViewModel; WcfHelper.Initialize(); mView.ShowDialog(); }
private void TabItem_Logout(Object sender, EventArgs e) { if (MessageBox.Show("Do you want to logout?", "Logout", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { WindowLogin windowLogin = new WindowLogin(); windowLogin.Show(); this.Close(); } else { this.TabControlMain.SelectedIndex = 0; return; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { WindowLogin windowLogin = new WindowLogin(); windowLogin.Attach(balBank); IsSuccessfulLogin = windowLogin.ShowDialog(); if (IsSuccessfulLogin == false || IsSuccessfulLogin == null) { AccessDeny(); } else { WindowAdd_StartupWindow(); } }
public static void Render() { if (Device == null) { return; } Device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0); Device.BeginScene(); background.Draw(); if (GameState == 1) { // WindowTalent.Visible = true; // WindowTalent.Draw(); // WindowViewTalent.Draw(); WindowLogin.Draw(); } if (GameState == 2) { WindowServer.Draw(); } if (GameState == 3) { WindowCharacter.Draw(); WindowPin.Draw(); } if (GameState == 4) { WindowNewCharacter.Draw(); } if (GameState == 6) { WindowGame.Draw(); } EngineInputBox.Draw(); EngineMessageBox.Draw(); EngineFont.DrawText("FPS: " + FPS, 925, 0, Color.Coral, EngineFontStyle.Bold); EngineFont.DrawText("Ping: " + Common.Configuration.Latency, 5, 0, Color.Coral, EngineFontStyle.Bold); Device.EndScene(); Device.Present(); }
public static bool InitializeEngine() { NetworkSocket.Initialize(); try { background = new EngineObject($"{Environment.CurrentDirectory}\\Data\\background.png", 1024, 768); background.Size = new Size2(1024, 768); background.SourceRect = new Rectangle(0, 0, 1024, 768); //Carrega os dados de classe. ClasseManager.Initialize(); //Carrega os dados de experiencia ExperienceManager.Experience.Initialize("experience"); EngineFont.Initialize(); EngineMessageBox.Initialize(); EngineInputBox.Initialize(); EngineMultimedia.Initialize(); WindowLogin.Initialize(); WindowServer.Initialize(); WindowCharacter.Initialize(); WindowNewCharacter.Initialize(); WindowGame.Initialize(); SpriteManager.Initialize(); EngineMultimedia.PlayMusic(0, true); GameState = 1; return(true); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } }
private void Device_KeyPress(object sender, KeyPressEventArgs e) { #region GameState 1 if (EngineCore.GameState == 1) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { WindowLogin.Login(); } if (e.KeyChar == Convert.ToChar(Keys.Tab)) { if (WindowLogin.textbox[0].CursorEnabled == true) { if (WindowLogin.textbox[0].Enabled == false) { return; } WindowLogin.textbox[0].CursorEnabled = false; WindowLogin.textbox[1].CursorEnabled = true; WindowLogin.textbox[1].CursorState = 0; } else { if (WindowLogin.textbox[1].Enabled == false) { return; } WindowLogin.textbox[0].CursorEnabled = true; WindowLogin.textbox[1].CursorEnabled = false; WindowLogin.textbox[0].CursorState = 0; } return; } if (WindowLogin.textbox[0].CursorEnabled == true) { if (WindowLogin.textbox[0].Enabled == false) { return; } //if (char.IsLetterOrDigit(e.KeyChar) || char.(e.KeyChar)) if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowLogin.textbox[0].Text.Length > 0) { WindowLogin.textbox[0].RemoveText(); } } if (char.IsLetterOrDigit(e.KeyChar)) { if (WindowLogin.textbox[0].Text.Length <= 27) { //retorna se o ime estiver ativado if (ImeModeOn) { return; } WindowLogin.textbox[0].AddText(e.KeyChar); } } } if (WindowLogin.textbox[1].CursorEnabled == true) { if (WindowLogin.textbox[1].Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowLogin.textbox[1].Text.Length > 0) { WindowLogin.textbox[1].RemoveText(); } } if (char.IsLetterOrDigit(e.KeyChar)) { if (WindowLogin.textbox[1].Text.Length <= 27) { if (ImeModeOn) { return; } WindowLogin.textbox[1].AddText(e.KeyChar); } } } return; } #endregion #region GameState 3 if (EngineCore.GameState == 3) { if (!EngineInputBox.Visible) { return; } if (WindowPin.Visible) { if (e.KeyChar == Convert.ToChar(Keys.Tab)) { WindowPin.SelectTextbox(); } } if (EngineInputBox.TextBox.CursorEnabled == true) { if (EngineInputBox.TextBox.Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (EngineInputBox.TextBox.Text.Length > 0) { EngineInputBox.TextBox.RemoveText(); } } if (ImeModeOn) { return; } if (char.IsDigit(e.KeyChar) || char.IsLetter(e.KeyChar)) { if (EngineInputBox.TextBox.Text.Length <= 12) { EngineInputBox.TextBox.AddText(e.KeyChar); } } } return; } #endregion #region GameState 4 if (EngineCore.GameState == 4) { if (WindowNewCharacter.textbox.CursorEnabled == true) { if (WindowNewCharacter.textbox.Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowNewCharacter.textbox.Text.Length > 0) { WindowNewCharacter.textbox.RemoveText(); } } if (ImeModeOn) { return; } if (char.IsDigit(e.KeyChar) || char.IsLetter(e.KeyChar)) { if (WindowNewCharacter.textbox.Text.Length <= 12) { WindowNewCharacter.textbox.AddText(e.KeyChar); } } } return; } #endregion #region GameState 6 if (EngineCore.GameState == 6) { if (WindowCash.BuyItemVisible) { if (WindowCash.textbox.CursorEnabled == true) { if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowCash.textbox.Text.Length > 0) { WindowCash.textbox.RemoveText(); } return; } if (ImeModeOn) { return; } if (WindowCash.textbox.Text.Length <= 20) { WindowCash.textbox.AddText(e.KeyChar); } } return; } if (e.KeyChar == 13) { if (WindowChat.textbox.CursorEnabled) { //envia o texto if (WindowChat.textbox.Text.Length > 0) { WindowChat.SendChat(); } //limpa o texto e fecha WindowChat.textbox.Clear(); WindowChat.textbox.CursorEnabled = false; WindowChat.Transparency = 120; } else { WindowChat.textbox.Clear(); WindowChat.textbox.CursorEnabled = true; WindowChat.Transparency = 255; } } if (WindowChat.textbox.CursorEnabled == true) { if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowChat.textbox.Text.Length > 0) { WindowChat.textbox.RemoveText(); } return; } if (ImeModeOn) { return; } if (WindowChat.textbox.Text.Length <= 30) { WindowChat.textbox.AddText(e.KeyChar); } } } #endregion }
/// <summary> /// Executes login command. Opens login dialog and loads customers. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoginCommand_Executed(object sender, ExecutedRoutedEventArgs e) { WindowLogin window = new WindowLogin(); window.Owner = this; // This will center dialog in owner window if (window.ShowDialog() == true) { LoadCustomers(); CommandManager.InvalidateRequerySuggested(); } }
public WindowInputCode(WindowLogin Main) { InitializeComponent(); this.Main = Main; }
public WindowForgotPassword(WindowLogin Main) { InitializeComponent(); this.Main = Main; }
public WindowLoginController() { windowLogin = new WindowLogin(this); }
private void CreateDevice_KeyPress(object sender, KeyPressEventArgs e) { #region GameState 1 if (EngineCore.GameState == 1) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { WindowLogin.Login(); } if (e.KeyChar == Convert.ToChar(Keys.Tab)) { if (WindowLogin.textbox[0].CursorEnabled == true) { if (WindowLogin.textbox[0].Enabled == false) { return; } WindowLogin.textbox[0].CursorEnabled = false; WindowLogin.textbox[1].CursorEnabled = true; WindowLogin.textbox[1].CursorState = 0; } else { if (WindowLogin.textbox[1].Enabled == false) { return; } WindowLogin.textbox[0].CursorEnabled = true; WindowLogin.textbox[1].CursorEnabled = false; WindowLogin.textbox[0].CursorState = 0; } return; } if (ImeModeOn) { return; } if (WindowLogin.textbox[0].CursorEnabled == true) { if (WindowLogin.textbox[0].Enabled == false) { return; } //if (char.IsLetterOrDigit(e.KeyChar) || char.(e.KeyChar)) if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowLogin.textbox[0].Text.Length > 0) { WindowLogin.textbox[0].RemoveText(); } } if (char.IsLetterOrDigit(e.KeyChar)) { if (WindowLogin.textbox[0].Text.Length <= 27) { //retorna se o ime estiver ativado WindowLogin.textbox[0].AddText(e.KeyChar); } } } if (WindowLogin.textbox[1].CursorEnabled == true) { if (WindowLogin.textbox[1].Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowLogin.textbox[1].Text.Length > 0) { WindowLogin.textbox[1].RemoveText(); } } if (char.IsLetterOrDigit(e.KeyChar)) { if (WindowLogin.textbox[1].Text.Length <= 27) { WindowLogin.textbox[1].AddText(e.KeyChar); } } } return; } #endregion #region GameState 3 if (EngineCore.GameState == 3) { if (!EngineInputBox.Visible) { return; } if (EngineInputBox.TextBox.CursorEnabled == true) { if (EngineInputBox.TextBox.Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (EngineInputBox.TextBox.Text.Length > 0) { EngineInputBox.TextBox.RemoveText(); } } if (ImeModeOn) { return; } if (char.IsDigit(e.KeyChar) || char.IsLetter(e.KeyChar)) { if (EngineInputBox.TextBox.Text.Length <= 12) { EngineInputBox.TextBox.AddText(e.KeyChar); } } } return; } #endregion #region GameState 4 if (EngineCore.GameState == 4) { if (WindowNewCharacter.textbox.CursorEnabled == true) { if (WindowNewCharacter.textbox.Enabled == false) { return; } if (Convert.ToInt32(e.KeyChar) == 8) { if (WindowNewCharacter.textbox.Text.Length > 0) { WindowNewCharacter.textbox.RemoveText(); } } if (ImeModeOn) { return; } if (char.IsDigit(e.KeyChar) || char.IsLetter(e.KeyChar)) { if (WindowNewCharacter.textbox.Text.Length <= 12) { WindowNewCharacter.textbox.AddText(e.KeyChar); } } } return; } #endregion }
public PageLogin(WindowLogin Main) { InitializeComponent(); this.Main = Main; }
private void Page_Loaded(object sender, RoutedEventArgs e) { BL.IsEnabled = false; BL.Content = Json.Read("Login", "userName"); Task task = new Task(() => { if (App.ISLogin) { this.Dispatcher.BeginInvoke(new Action(() => { if (App.ISOnline) { head.Source = new BitmapImage(new Uri(System.IO.Directory.GetCurrentDirectory() + "\\user\\" + Json.Read("Login", "userName") + "\\head.png")); TL.Content = "已登录"; } else { TL.Content = "离线"; } BL.IsEnabled = true; })); } else { if (XMCL.Core.Authenticate.Refresh(Json.Read("Login", "accessToken"), Json.Read("Login", "clientToken"))) { App.ISLogin = true; App.ISOnline = true; XMCL.Core.Tools.GetSkins(Json.Read("Login", "uuid")); this.Dispatcher.BeginInvoke(new Action(() => { BL.IsEnabled = true; TL.Content = "已登录"; head.Source = new BitmapImage(new Uri(System.IO.Directory.GetCurrentDirectory() + "\\user\\" + Json.Read("Login", "userName") + "\\head.png")); })); } else { bool a = false; if (Json.Read("Login", "uuid").Length > 0) { if (Json.Read("Login", "userName").Length > 0) { a = true; } } if (a) { this.Dispatcher.BeginInvoke(new Action(() => { TL.Content = "离线"; BL.IsEnabled = true; })); } else { this.Dispatcher.BeginInvoke(new Action(() => { if (WindowLogin.WindowLoginShow(false)) { App.ISOnline = true; TL.Content = "已登录"; head.Source = new BitmapImage(new Uri(System.IO.Directory.GetCurrentDirectory() + "\\user\\" + Json.Read("Login", "userName") + "\\head.png")); } BL.Content = Json.Read("Login", "userName"); BL.IsEnabled = true; })); } App.ISLogin = true; } } this.Dispatcher.BeginInvoke(new Action(() => { LL1.Source = null; LL1.Visibility = Visibility.Collapsed; TL.Visibility = Visibility.Visible; })); }); task.Start(); }