Exemple #1
0
        /// <summary>
        /// Adds a <see cref="IMetadatumDefinition"/> with the
        /// <paramref name="values"/> provided.
        /// </summary>
        /// <param name="values">A series of varied type values and possible names.</param>
        /// <returns>A <see cref="IMetadatumDefinition"/> instance with the
        /// <paramref name="values"/> provided.</returns>
        /// <exception cref="System.ArgumentException">thrown when the <paramref name="values"/> points to a compiled attribute type
        /// which has no public constructor that matches the values given, or a property referenced in the named value series did not exist.</exception>
        /// <exception cref="System.ArgumentNullException"><paramref name="values"/>' <see cref="MetadatumDefinitionParameterValueCollection.MetadatumType"/> is null.</exception>
        public IMetadatumDefinition Add(MetadatumDefinitionParameterValueCollection values)
        {
            MetadatumDefinition definition = new MetadatumDefinition(this, values);

            this.baseList.Add(definition);
            return(definition);
        }
 internal void AddSeries(MetadatumDefinitionParameterValueCollection values)
 {
     if (values.Count() > 0)
     {
         this.CheckParameters();
         this.parameters.AddSeries(values);
     }
 }
 /// <summary>
 /// Creates a new <see cref="MetadatumDefinition"/>
 /// with the <paramref name="declarationPoint"/> provided.
 /// </summary>
 /// <param name="parent">The <see cref="MetadataDefinition"/>
 /// on which the current <see cref="MetadatumDefinition"/>
 /// is declared.</param>
 /// <param name="data">The <see cref="MetadatumDefinitionParameterValueCollection"/>
 /// which contains the information about the <see cref="MetadatumDefinition"/>.</param>
 /// <exception cref="System.ArgumentException">thrown when the <paramref name="data"/> points to a compiled attribute type
 /// which has no public constructor that matches the values given, or a property referenced in the named value series did not exist.-or-
 /// <paramref name="data"/>'s <see cref="MetadatumDefinitionParameterValueCollection.MetadatumType"/> contains a type
 /// which does not have properties, or is not an attribute.</exception>
 /// <exception cref="System.ArgumentNullException"><paramref name="declarationPoint"/> is null; -or-
 /// <paramref name="data"/>'s <see cref="MetadatumDefinitionParameterValueCollection.MetadatumType"/> is null.</exception>
 public MetadatumDefinition(MetadataDefinition parent, MetadatumDefinitionParameterValueCollection data)
 {
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (data.MetadatumType == null)
     {
         throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, Resources.Exception_ArgumentNull_CustomAttribute_ctor_data, "data"), "data");
     }
     this.parent = parent;
     if ((this.OwningAssembly.IdentityManager.MetadatumHandler.GetTypeMetadatumRepresentation(data.MetadatumType) & TypeMetadatumRepresentation.IsMetadata) != TypeMetadatumRepresentation.IsMetadata)
     {
         throw new ArgumentException(Resources.Exception_Argument_CustomAttribute_Type_MustBeAttribute, "value");
     }
     this.type = data.MetadatumType;
     this.AddSeries(data);
 }
Exemple #4
0
 public IMetadatumDefinitionParameter[] AddSeries(MetadatumDefinitionParameterValueCollection values)
 {
     return(values.AddInternal(this));
 }