void btnDisConnection_Click(object sender, RoutedEventArgs e) { client.CloseAsync(); client = null; this.btnDisConnection.IsEnabled = false; this.btnConnection.IsEnabled = true; }
/// <summary> /// 连接聊天服务器 /// </summary> public void ConnectionChatService() { if (null == client) { var end = new EndpointAddress("http://localhost:6667/PlatformChat.svc"); var binding = new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll); client = new PlatformChatClient(new InstanceContext(this), binding, end); } }
static void Connection() { client = new PlatformChatClient(new InstanceContext(InstanceContext), binding, end); }
public void Initialize(PlatformChatClient proxy) { this.proxy = proxy; }