//private ObjectSender OnObjectSend; //internal event ObjectSender OnOnbjectRecive //{ // add { OnObjectSend += new ObjectSender(value); } // remove { OnObjectSend -= new ObjectSender(value); } //} private void OnObjectRecived(object o) { if (o.GetType() == typeof(OverviewInfo)) { info = (OverviewInfo)o; } else if (o.GetType() == typeof(ArrayList)) { balls = (ArrayList)o; } else if (o.GetType() == typeof(ProductivityInfo)) { pi = (ProductivityInfo)o; } Object[] list = { this, System.EventArgs.Empty }; this.outputArea.BeginInvoke(new EventHandler(ShowInfo2), list); }
internal static void overview(object o) { ArrayList balls = new ArrayList(); ha = OverviewInfo.PrepareHttpAccesser(universe); string baseurl = ha.AccessUrl; ha.Cookies = ccold; IEnumerator i = ccnew.GetEnumerator(); while (i.MoveNext()) { ha.Cookies.Add((Cookie)i.Current); } ccold = ha.Cookies; ccnew = ha.access(); //取得第一个星球的总星球列表 OverviewInfo ovf = OverviewInfo.AnalyzHtml(); foreach (OverviewInfo.Ball ball in ovf.Balllist) { ha.Referer = ha.AccessUrl; ha.AccessUrl = baseurl + ball.AccessParm; ha.Cookies = ccold; IEnumerator ie = ccnew.GetEnumerator(); while (ie.MoveNext()) { ha.Cookies.Add((Cookie)ie.Current); } ccnew = ha.access(); //取得每一个星球 OverviewInfo ovfloop = OverviewInfo.AnalyzHtml(); balls.Add(ovfloop); } referer = ha.AccessUrl; ObjectEventHandler(ovf); Thread.Sleep(200); ObjectEventHandler(balls); Thread.Sleep(200); }