private static void OnRecv(RecvEventArgs e) { EventHandler <RecvEventArgs> temp = Volatile.Read(ref recvEvent); if (temp != null) { temp(null, e); } }
private void RecvMsg(object sender, RecvEventArgs e) { if (!e.IsErr) { if (e.RemoteSocketObj.Parent is UdpServerSocketObject) { SocketObject obj = (SocketObject)e.RemoteSocketObj.Parent; bool isSelected = false; if (socketModels[index1] == (SocketModel)obj.Parent && obj.Parent.Children[index2] == obj) { isSelected = true; } ((SocketModel)obj.Parent).UpdateSubTreeView(obj, isSelected); } Dispatcher.Invoke(Refresh); Dispatcher.Invoke(RefreshTree); } else { ObjNeedRm = e.RemoteSocketObj; Dispatcher.Invoke(RemoveRemoteItem); } }