예제 #1
0
 /// <summary>
 /// Handles the click event of the subscribe button.
 /// </summary>
 /// <param name="sender">The sender of the event.</param>
 /// <param name="e">Event arguments.</param>
 private void SubscribeButtonClick(object sender, RoutedEventArgs e)
 {
     try
     {
         UnsubscribeSidsIfNeeded();
         InitializeClient(Address.Text);
         notificationServiceClient.BeginSubscribe();
         foreach (SidConstants.SID subscribedSid in subscribedSids)
         {
             notificationServiceClient.Subscribe(subscribedSid.ToString());
         }
         notificationServiceClient.EndSubscribe();
     }
     catch (Exception ex)
     {
         MessageBox.Show("ERROR:\n\n" + ex.Message, "Error", MessageBoxButton.OK);
     }
 }