Exemple #1
0
        /// <summary>
        ///     The factory method for constructing the MetadataProperty object.
        /// </summary>
        /// <param name="name">The name of the metadata property.</param>
        /// <param name="typeUsage">The type usage of the metadata property.</param>
        /// <param name="value">The value of the metadata property.</param>
        /// <exception cref="System.NullReferenceException">
        ///     Thrown <paramref name="typeUsage" /> is <c>null</c>.
        /// </exception>
        /// <notes>The newly created MetadataProperty will be read only.</notes>
        public static MetadataProperty Create(string name, TypeUsage typeUsage, object value)
        {
            Check.NotNull(typeUsage, "typeUsage");

            var metadataProperty = new MetadataProperty(name, typeUsage, value);

            metadataProperty.SetReadOnly();
            return(metadataProperty);
        }
Exemple #2
0
        /// <summary>
        /// The factory method for constructing the MetadataProperty object.
        /// </summary>
        /// <param name="name">The name of the metadata property.</param>
        /// <param name="typeUsage">The type usage of the metadata property.</param>
        /// <param name="value">The value of the metadata property.</param>
        /// <returns>The MetadataProperty object.</returns>
        /// <exception cref="T:System.NullReferenceException">
        /// Thrown <paramref name="typeUsage" /> is <c>null</c>.
        /// </exception>
        /// <remarks>The newly created MetadataProperty will be read only.</remarks>
        public static MetadataProperty Create(
            string name,
            TypeUsage typeUsage,
            object value)
        {
            Check.NotEmpty(name, nameof(name));
            Check.NotNull <TypeUsage>(typeUsage, nameof(typeUsage));
            MetadataProperty metadataProperty = new MetadataProperty(name, typeUsage, value);

            metadataProperty.SetReadOnly();
            return(metadataProperty);
        }
        /// <summary>
        /// The factory method for constructing the MetadataProperty object.
        /// </summary>
        /// <param name="name">The name of the metadata property.</param>
        /// <param name="typeUsage">The type usage of the metadata property.</param>
        /// <param name="value">The value of the metadata property.</param>
        /// <returns>The MetadataProperty object.</returns>
        /// <exception cref="System.NullReferenceException">
        /// Thrown <paramref name="typeUsage" /> is <c>null</c>.
        /// </exception>
        /// <remarks>The newly created MetadataProperty will be read only.</remarks>
        public static MetadataProperty Create(string name, TypeUsage typeUsage, object value)
        {
            Check.NotEmpty(name, "name");
            Check.NotNull(typeUsage, "typeUsage");

            var metadataProperty = new MetadataProperty(name, typeUsage, value);
            metadataProperty.SetReadOnly();
            return metadataProperty;
        }