public override void ShowError(string message) { base.ShowError(message); this._currentImageTask = null; this._currentStringTask = null; }
public void RefreshImage() { if (this._currentStringTask != null) { this._currentStringTask.Cancel(); } if (this._currentImageTask != null) { this._currentImageTask.Cancel(); } string checkUri = this._urlBuilder.BuildCaptchaCheckUrl(); this._currentStringTask = new HttpGetStringTask(checkUri, this.OnCheckStringLoaded); this._currentStringTask.OnError = this.ShowError; this.ShowLoading(); this._currentStringTask.Execute(); }
private void OnCheckStringLoaded(string str) { this.Key = str.Substring(str.IndexOf('\n') + 1); this.LoadCaptcha(this.Key); this._currentStringTask = null; }