/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Group == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Group");
     }
     if (Names == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Names");
     }
     if (Scope == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Scope");
     }
     if (Version == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Version");
     }
     if (Names != null)
     {
         Names.Validate();
     }
     if (Subresources != null)
     {
         Subresources.Validate();
     }
     if (Validation != null)
     {
         Validation.Validate();
     }
 }
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Group == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Group");
     }
     if (Names == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Names");
     }
     if (Scope == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Scope");
     }
     if (AdditionalPrinterColumns != null)
     {
         foreach (var element in AdditionalPrinterColumns)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (Conversion != null)
     {
         Conversion.Validate();
     }
     if (Names != null)
     {
         Names.Validate();
     }
     if (Subresources != null)
     {
         Subresources.Validate();
     }
     if (Versions != null)
     {
         foreach (var element1 in Versions)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
 }
Exemplo n.º 3
0
 public void AddSubresource(string key, IResource subresource)
 {
     subresource.Source = new SubresourceResourceSource(this, key);
     Subresources.Add(key, subresource);
 }