コード例 #1
0
 private void setContextToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_AppClient != null)
     {
         AppTestInputForm aInput = new AppTestInputForm();
         aInput.Text   = "Set Context";
         aInput.Prompt = "Context Name:";
         if (aInput.ShowDialog() == DialogResult.OK)
         {
             _AppClient.ContextName = aInput.Value;
         }
     }
     else
     {
         uStatusError.Text = "Set context failed: Not connected.";
     }
 }
コード例 #2
0
 private void openSessionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_AppClient != null)
     {
         AppTestInputForm aInput = new AppTestInputForm();
         aInput.Text   = "Open Session";
         aInput.Prompt = "Context Name:";
         if (aInput.ShowDialog() == DialogResult.OK)
         {
             _AppClient.OpenSession(_DefaultReceiver, aInput.Value);
         }
     }
     else
     {
         uStatusError.Text = "Open session failed: Not connected.";
     }
 }
コード例 #3
0
 private void connectSessionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (_AppClient != null)
     {
         AppTestInputForm aInput = new AppTestInputForm();
         aInput.Text   = "Connect Session";
         aInput.Prompt = "Session Id:";
         if (aInput.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 _AppClient.ConnectSession(_DefaultReceiver, int.Parse(aInput.Value));
             }
             catch (Exception)
             {
                 uStatusError.Text = "Connect session failed: Invalid Session Id.";
             }
         }
     }
     else
     {
         uStatusError.Text = "Connect session failed: Not connected.";
     }
 }