protected override void OnFillerStateChanged(FillBase fill) { if (fill.FillState == FillState.Running) { if (_detector == null) { _detector = new PrivateDetector(fill.Browser, FileHelper.GetFillRuleFile(this.Version, this.FillType, this.Standard, this.CarType), attrList); } else { _detector.Browser = fill.Browser; } string uri = fill.CurrentUrl.AbsolutePath; if (_detected.ContainsKey(uri) == false) { fill.Reset(); _detected.Add(uri, ""); UrlParameter parameter = base.Uris[uri] as UrlParameter; _detector.Detect(parameter.LabelName); fill.Resume(); } } else if (fill.FillState == FillState.Exception) { WebFillManager.ShowMessageBox(fill.Exception.Message, "错误", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } else if (fill.CurrentUrl.OriginalString == base.EndPageUri) { OnFinished(EventArgs.Empty); } }
public void Reset() { _detector.Save(); _detector.Dispose(); _detected.Clear(); _detector = null; base.EndFill(); }