//网络定时获取数据委托测试 public void NetDataControllerStartRefreshTest() { NetDataController NDC = new NetDataController(); NetDataController.sync s=new NetDataController.sync(sync); NDC.StockRefreshAdd("0600001",ref s);//添加委托 NDC.StartRefresh(1);//刷新时间1s Thread.Sleep(3000);//等待3s看是否成功 Assert.AreEqual("邯郸钢铁", SIE.name); }
public static void setNetDataController(ref NetDataController NDC_) { NDC = NDC_; }
private void setNetDataController(string name) { if (NDCmark != null) NDCmark.StopRefresh(); NetDataController NDC; if (NetDict.ContainsKey(name)) { NDC = NetDict[name]; NetSyncController.setNetDataController(ref NDC); } else { NDC = new NetDataController(); NetDict.Add(name, NDC); NetSyncController.setNetDataController(ref NDC); } NDC.StartRefresh(); NDCmark = NDC; }