/// <summary> /// Метод отключения /// </summary> void DisConnect() { if (online) { tb_outmsg.ReadOnly = true; uclient.DisConnect(idUser); uclient = null; tb_name.ReadOnly = false; cdnnect.Text = "Connect"; online = false; } }
/// <summary> /// Метод подключения /// </summary> void Connect() { if (!online) { tb_outmsg.ReadOnly = false; uclient = new HostServise.Service_WCFClient(new System.ServiceModel.InstanceContext(this)); uclient.DisConnect(idUser); idUser = uclient.Connect(tb_name.Text); tb_name.ReadOnly = true; cdnnect.Text = "Disconnect"; online = true; } }