public void Start() { MsgShow.ShowWarning("正在接收消息。。。"); IsSelected = true; foreach (var item in _device429.ReceiveComponents) { Channe429Receive chanelReceive = (Channe429Receive)item; chanelReceive.IsFileSaveAllow = IsFileSaveAllow; //是否进行文件保存 chanelReceive.isSend = true; //开始接收,为什么??因为在login的时候在后台多开了一个线程在不停的调用接收和发送,那么只需要将它的标识设置为true就ok了 receiveLabelUi = new ReceiveLabelUi(DateTime.Now); receiveLabelUi.chanel = chanelReceive; Labellist.Add(receiveLabelUi); //将新的记录保存到ui中 if (_curSelectedChannel == chanelReceive) //如果选中的chanel与这个chanel一样的话,执行下面的操作 { Label = receiveLabelUi; } } }
//这里我的想法是直接将count置为0,并且将存在本地的文件改个名字, public void ClearData() { Labellist = null; //直接将数据源的数据置为null Label = null; //我也不知道,顺便将它也置为null }