//private void msgCheck() private void msgCheck(object source, System.Timers.ElapsedEventArgs e) { try { Objects.ReqObject req = new msgCenter.Objects.ReqObject(); req.ReqTime = DateTime.Now; req.ReqType = Objects.ReqObject.REQ_TYPE_NEWMSG; req.ReqContent = (object)currentUser.UserID; byte[] result = req.GetResponse(); List<Objects.MsgObject> msgs = (List<Objects.MsgObject>)Operators.SerializeOperator.DeSerialize(result); if (msgs.Count > 0) { MSGUpdatingEvent(msgs); } } catch (Exception ex) { //newDialog("Connection Error."); } }
private void getContacts_process(object source, System.Timers.ElapsedEventArgs e) { try { Objects.ReqObject req = new msgCenter.Objects.ReqObject(); req.ReqType = Objects.ReqObject.REQ_TYPE_CONTACTS; req.ReqTime = DateTime.Now; req.ReqContent = (object)currentUser.UserID; byte[] result = req.GetResponse(); //currentUser.=Objects.UserObject.deserialize(result).contacts; Objects.UserObject tempUser = (Objects.UserObject)Operators.SerializeOperator.DeSerialize(result); ContactUpdatingEvent(tempUser.contacts); } catch (Exception ex) { //newDialog("Connection Error."); } }