예제 #1
0
 private void disconnectChannel()
 {
     if(chan==null)
     {
         if(chkCausal.Checked)
             props += ":CAUSAL";
         chan = new GroupChannel(props);
         chan.setChannelListener(this);
         ad = new PullPushAdapter(chan, this, this);
     }
     if(!chan.isConnected())
     {
         if(String.Compare(txtGroupName.Text.Trim(),"")!=0)
         {
             chan.connect(txtGroupName.Text.Trim());
             ad.start();
         }
         else
         {
             MessageBox.Show(this,"text","caption",MessageBoxButtons.OK);
             return;
         }
         btnConnect.Text = "Disconnect";
         txtGroupName.Enabled = false;
         txtToSend.Enabled = true;
         txtHandle.Enabled = true;
         txtToSend.Text = "";
         btnSendMessage.Enabled = true;
         lstMembers.Enabled = true;
         txtMsgsReceived.Enabled = true;
         txtMsgsReceived.Text = "";
     }
     else
     {
         ad.stop();
         chan.disconnect();
         btnConnect.Text = "Connect";
         txtGroupName.Enabled = true;
         txtToSend.Enabled = false;
         btnSendMessage.Enabled = false;
         txtHandle.Enabled = false;
         lstMembers.Enabled = false;
         txtMsgsReceived.Enabled = false;
     }
 }
예제 #2
0
 public Efficency()
 {
     chan = new GroupChannel(props);
     chan.setChannelListener(this);
 }