public ChatRoom EndOpenChat(IAsyncResult res) { if (openChatDel == null) { throw new InvalidOperationException("Something bad happened"); } OpenChatDel tmp = openChatDel; openChatDel = null; return(tmp.EndInvoke(res)); }