/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (VirtualNetworkGateway1 == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1");
     }
     if (ConnectionType == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType");
     }
     if (VirtualNetworkGateway1 != null)
     {
         VirtualNetworkGateway1.Validate();
     }
     if (VirtualNetworkGateway2 != null)
     {
         VirtualNetworkGateway2.Validate();
     }
     if (LocalNetworkGateway2 != null)
     {
         LocalNetworkGateway2.Validate();
     }
     if (IpsecPolicies != null)
     {
         foreach (var element in IpsecPolicies)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (VirtualNetworkGateway1 == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkGateway1");
     }
     if (ConnectionType == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionType");
     }
     if (VirtualNetworkGateway1 != null)
     {
         VirtualNetworkGateway1.Validate();
     }
     if (VirtualNetworkGateway2 != null)
     {
         VirtualNetworkGateway2.Validate();
     }
     if (LocalNetworkGateway2 != null)
     {
         LocalNetworkGateway2.Validate();
     }
     if (GatewayCustomBgpIpAddresses != null)
     {
         foreach (var element in GatewayCustomBgpIpAddresses)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (IpsecPolicies != null)
     {
         foreach (var element1 in IpsecPolicies)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (TrafficSelectorPolicies != null)
     {
         foreach (var element2 in TrafficSelectorPolicies)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
 }