/// <summary> /// Callback to receive subscription status change events. /// </summary> /// <param name="subscription">The source of the event.</param> /// <param name="e">The new status of the subscription.</param> private void Subscription_StatusChanged(Subscription subscription, SubscriptionStatusChangedEventArgs e) { // need to make sure this method is called on the UI thread because it updates UI controls. if (InvokeRequired) { BeginInvoke(new SubscriptionStatusChangedEventHandler(Subscription_StatusChanged), subscription, e); return; } try { // XXX ToDo - show in the GUI e.g. disable monitoring view // Deleted, // Created, // Transferred, // Error } catch (Exception exception) { ExceptionDlg.Show("Error in Subscription_StatusChanged callback", exception); } }
/// <summary> /// When a subscription is recycled or keep-alive is done this event hander will be triggered. Logging has to be implemented /// for diagnostics /// </summary> /// <param name="subscription">Current subscription</param> /// <param name="e">Use SubscriptionConnectionStatus.CurrentStatus and SubscriptionConnectionStatus.OldStatus to write meaningful log</param> public void Subscription_StatusChanged(Subscription subscription, SubscriptionStatusChangedEventArgs e) { //log this }