Exemple #1
0
        private async void btnLogin_Click(object sender, EventArgs e) {
            EnableChildren(false);

            string response;
            lblStatus.ForeColor = Color.Black;
            lblStatus.Text = "Authenticating; please wait...";

            Client = new PoESiteClient();

            // We require the user to not have made any changes to the login info if we're to fetch old cookies from cache.
            if (_settings.RememberMe && !_infoDirty) {
                // Try to load the cookies from disk
                Client.Cookies = _cookies.Load(() => Client.Cookies);
                response = string.Empty;
            } else {
                // Make the store reference the client's cookies
                _cookies.Value = Client.Cookies;
                response = await Client.LoginAsync(new PoESiteCredentials(txtEmail.Text, txtPassword.Text));
            }

            if (response.Contains("Invalid Login")) {
                lblStatus.ForeColor = Color.Red;
                lblStatus.Text = "Invalid Login.";
            } else {
                SaveSettings();
                DialogResult = DialogResult.OK;
            }

            EnableChildren(true);
        }
Exemple #2
0
        public StashForm(ApplicationSettings settings, PoESiteClient client) {
            _settings = settings;
            _client = client;
            _stashFetcher = new StashFetcher(_client);
            _stashFetcher.StashTabReceived += _stashFetcher_StashTabReceived;
            _stashFetcher.StashReceived += _stashFetcher_StashReceived;
            _stashFetcher.Begin += _stashFetcher_Begin;
            _stashFetcher.End += _stashFetcher_End;
            _stashFetcher.NoStashError += _stashFetcher_NoStashError;
            _stashFetcher.ServerError += _stashFetcher_ServerError;

            InitializeComponent();
        }
Exemple #3
0
 public StashFetcher(PoESiteClient client) {
     _client = client;
 }