private void btnLogin_Click(object sender, RoutedEventArgs e) { if (txtUsername.Text == string.Empty) { lblStatus.Content = "Please enter your Username"; return; } if (txtPassword.Password == string.Empty) { lblStatus.Content = "Please enter your Password"; return; } currentSite = ((SiteList)cmbSite.SelectedItem).site; username = txtUsername.Text; password = txtPassword.Password; twofactor = txt2fa.Text; prgLoginProgress.IsIndeterminate = true; btnLogin.IsEnabled = false; chkLogin.IsEnabled = false; txtUsername.IsEnabled = false; txtPassword.IsEnabled = false; lblStatus.Content = "Attempting to login..."; lblStatus.Foreground = Brushes.Orange; _login.RunWorkerAsync(); }
/// <summary> /// Constructor for General Sites /// </summary> /// <param name="site">Current site</param> /// <param name="username">Current username</param> /// <param name="balance">Current balance in BTC</param> public Programmer(DiceSite site, string username, double balance) { InitializeComponent(); _CurrentSite = site; Title = $"AutoDice: {username}"; _balance = balance; _username = username; cmbTheme.ItemsSource = Enum.GetValues(typeof(Theme)); cmbTheme.SelectedIndex = int.Parse(_parser.GetSetting("AUTODICE", "WINDOWTHEME")); cmbAccent.ItemsSource = Enum.GetValues(typeof(Accent)); cmbAccent.SelectedIndex = int.Parse(_parser.GetSetting("AUTODICE", "WINDOWCOLOR")); dataBets.ItemsSource = _datosRoll; _rollWorker.WorkerReportsProgress = true; _rollWorker.WorkerSupportsCancellation = true; _rollWorker.DoWork += worker_DoWork; _rollWorker.ProgressChanged += worker_ProgressChanged; _rollWorker.RunWorkerCompleted += worker_RunWorkerCompleted; _tipWorker.DoWork += tipWorker_DoWork; _tipWorker.RunWorkerCompleted += tipWorker_RunWorkerCompleted; _balanceWorker.DoWork += BalanceWorkerOnDoWork; _balanceWorker.RunWorkerCompleted += BalanceWorkerOnRunWorkerCompleted; txtScript.Text = "function dobet()\r\n\r\nend"; Lua.RegisterFunction("stop", this, new dStop(Stop).Method); Lua.RegisterFunction("tip", this, new dtip(luatip).Method); Lua.RegisterFunction("print", this, new dWriteConsole(WriteConsole).Method); txtVariables.Text = @"balance:double, RO win:bool, RO profit:double, RO currentprofit:double, RO lastBet:Bet, RO previousbet:double, RO nextbet:double, RW chance:double, RW bethigh:bool, RW "; txtFunctions.Text = @"print(messagetoprint:string) tip(username/userid:string, amount:double)"; }
public AutomaticPlayViewModel(DiceSite Site) : base(Site) { }