25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
748 B

  1. using System;
  2. using System.Threading.Tasks;
  3. namespace MQTTnet.Core.ManagedClient
  4. {
  5. public static class ManagedMqttClientExtensions
  6. {
  7. public static Task SubscribeAsync(this IManagedMqttClient managedClient, params TopicFilter[] topicFilters)
  8. {
  9. if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
  10. return managedClient.SubscribeAsync(topicFilters);
  11. }
  12. public static Task UnsubscribeAsync(this IManagedMqttClient managedClient, params TopicFilter[] topicFilters)
  13. {
  14. if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
  15. return managedClient.UnsubscribeAsync(topicFilters);
  16. }
  17. }
  18. }