示例#1
0
 public Form1()
 {
     InitializeComponent();
     cancellationTokenSource = new CancellationTokenSource();
     token = cancellationTokenSource.Token;
     proxy = new ChatServiceReference.ChatContractClient();
 }
示例#2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (userID != 0 && sessionID != 0)
     {
         proxy.Exit(userID, sessionID);
     }
     proxy.Close();
     proxy = null;
     cancellationTokenSource.Cancel();
     cancellationTokenSource.Dispose();
 }