public void CloseChannel() { EnsureChannelExists(); _channel.Close(); _channel = null; }
private void EnsureChannelExists() { if (_channel != null) return; // First, try to get the notification channel for this app _channel = _channelFactory.GetNotificationChannel(_channelName); // Ensure that we're listening to the correct event handlers SetupChannelEventHandlers(); }