Exemplo n.º 1
0
        /// <summary>
        /// Creates a new <see cref="OptionProperty"/> from a property.
        /// </summary>
        /// <param name="property">The property to create the <see cref="OptionProperty"/> from.</param>
        /// <returns>A new <see cref="OptionProperty"/> instance.</returns>
        public static OptionProperty FromProperty(PropertyInfo property)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            var specification = OptionSpecification.FromProperty(property);

            return(new OptionProperty(property, specification));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new <see cref="OptionProperty"/> instance.
 /// </summary>
 /// <param name="property">The property.</param>
 /// <param name="specification">The option specification.</param>
 private OptionProperty(PropertyInfo property, OptionSpecification specification)
 {
     Property      = property;
     Specification = specification;
 }