您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

26 行
770 B

  1. using MQTTnet.Extensions.Rpc.Options.TopicGeneration;
  2. using System;
  3. namespace MQTTnet.Extensions.Rpc.Options
  4. {
  5. public sealed class MqttRpcClientOptionsBuilder
  6. {
  7. IMqttRpcClientTopicGenerationStrategy _topicGenerationStrategy = new DefaultMqttRpcClientTopicGenerationStrategy();
  8. public MqttRpcClientOptionsBuilder WithTopicGenerationStrategy(IMqttRpcClientTopicGenerationStrategy value)
  9. {
  10. _topicGenerationStrategy = value ?? throw new ArgumentNullException(nameof(value));
  11. return this;
  12. }
  13. public IMqttRpcClientOptions Build()
  14. {
  15. return new MqttRpcClientOptions
  16. {
  17. TopicGenerationStrategy = _topicGenerationStrategy
  18. };
  19. }
  20. }
  21. }