Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoadBalancerVirtualAddress"/> class
        /// with the specified virtual address type and family.
        /// </summary>
        /// <param name="type">The virtual address type.</param>
        /// <param name="version">The address family for this virtual address, or <see langword="null"/> to not specify the address family.</param>
        /// <exception cref="ArgumentNullException">If <paramref name="type"/> is <see langword="null"/>.</exception>
        /// <exception cref="NotSupportedException">If <paramref name="version"/> is not <see cref="AddressFamily.InterNetwork"/> or <see cref="AddressFamily.InterNetworkV6"/>.</exception>
        public LoadBalancerVirtualAddress(LoadBalancerVirtualAddressType type, AddressFamily?version)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            _type = type;
            if (version.HasValue)
            {
                switch (version)
                {
                case AddressFamily.InterNetwork:
                    _ipVersion = "IPV4";
                    break;

                case AddressFamily.InterNetworkV6:
                    _ipVersion = "IPV6";
                    break;

                default:
                    throw new NotSupportedException("The specified address family is not supported by this service.");
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadBalancerVirtualAddress"/> class
 /// with the specified virtual address type.
 /// </summary>
 /// <param name="type">The virtual address type.</param>
 /// <exception cref="ArgumentNullException">If <paramref name="type"/> is <see langword="null"/>.</exception>
 public LoadBalancerVirtualAddress(LoadBalancerVirtualAddressType type)
     : this(type, null)
 {
 }
 /// <inheritdoc/>
 protected override LoadBalancerVirtualAddressType FromName(string name)
 {
     return(LoadBalancerVirtualAddressType.FromName(name));
 }