internal AzureServiceBusClientFactory(ServiceBusConnection connection)
     : base()
 {
     Connection       = connection.RejectIf().IsNull(nameof(connection)).TargetArgument;
     ManagementClient = new ManagementClient(Connection.Endpoint.ToString(), Connection.TokenProvider);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureServiceBusSubscriptionClient" />.
 /// </summary>
 /// <param name="connection">
 /// A connection that governs interaction with Azure Service Bus entities.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="connection" /> is <see langword="null" />.
 /// </exception>
 public AzureServiceBusSubscriptionClient(ServiceBusConnection connection)
     : base()
 {
     Connection        = connection.RejectIf().IsNull(nameof(connection)).TargetArgument;
     LazyClientManager = new Lazy <AzureServiceBusClientManager>(CreateClientManager, LazyThreadSafetyMode.ExecutionAndPublication);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureServiceBusSubscriptionClient" />.
 /// </summary>
 /// <param name="connection">
 /// A connection that governs interaction with Azure Service Bus entities.
 /// </param>
 /// <param name="messageSerializationFormat">
 /// Gets the format that is used to serialize and deserialize messages. The default value is
 /// <see cref="SerializationFormat.Binary" />.
 /// </param>
 /// <param name="stateControlMode">
 /// The concurrency control mode that is used to manage state. The default value is
 /// <see cref="ConcurrencyControlMode.ProcessorCountSemaphore" />.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="connection" /> is <see langword="null" />.
 /// </exception>
 /// <exception cref="ArgumentOutOfRangeException">
 /// <paramref name="messageSerializationFormat" /> is equal to <see cref="SerializationFormat.Unspecified" /> -or-
 /// <paramref name="stateControlMode" /> is equal to <see cref="ConcurrencyControlMode.Unspecified" />.
 /// </exception>
 public AzureServiceBusSubscriptionClient(ServiceBusConnection connection, SerializationFormat messageSerializationFormat, ConcurrencyControlMode stateControlMode)
     : base(messageSerializationFormat, stateControlMode)
 {
     Connection        = connection.RejectIf().IsNull(nameof(connection)).TargetArgument;
     LazyClientManager = new Lazy <AzureServiceBusClientManager>(CreateClientManager, LazyThreadSafetyMode.ExecutionAndPublication);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureServiceBusPublishingClient" />.
 /// </summary>
 /// <param name="connection">
 /// A connection that governs interaction with Azure Service Bus entities.
 /// </param>
 /// <param name="messageSerializationFormat">
 /// Gets the format that is used to serialize and deserialize messages. The default value is
 /// <see cref="SerializationFormat.Binary" />.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="connection" /> is <see langword="null" />.
 /// </exception>
 /// <exception cref="ArgumentOutOfRangeException">
 /// <paramref name="messageSerializationFormat" /> is equal to <see cref="SerializationFormat.Unspecified" />.
 /// </exception>
 public AzureServiceBusPublishingClient(ServiceBusConnection connection, SerializationFormat messageSerializationFormat)
     : base(messageSerializationFormat)
 {
     Connection        = connection.RejectIf().IsNull(nameof(connection)).TargetArgument;
     LazyClientManager = new Lazy <AzureServiceBusClientManager>(CreateClientManager, LazyThreadSafetyMode.ExecutionAndPublication);
 }