Example #1
0
        /// <summary>
        /// Adds XML summary documentation to the enum member.
        /// </summary>
        /// <param name="summary">
        /// The content of the summary documentation.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the specified <paramref name="summary"/> is <c>null</c>.
        /// </exception>
        public EnumMemberBuilder WithSummary(string summary)
        {
            if (summary is null)
            {
                throw new ArgumentNullException(nameof(summary));
            }

            EnumerationMember = EnumerationMember.With(summary: Option.Some(summary));
            return(this);
        }
Example #2
0
        /// <summary>
        /// Sets the name of the enum member.
        /// </summary>
        /// <param name="name">
        /// The name of the member. Used as-is.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the specified <paramref name="name"/> is <c>null</c>.
        /// </exception>
        public EnumMemberBuilder WithName(string name)
        {
            if (name is null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            EnumerationMember = EnumerationMember.With(name: Option.Some(name));
            return(this);
        }
Example #3
0
 /// <summary>
 /// Specifies whether the enum member has an explicit value, and the value itself.
 /// </summary>
 /// <param name="value">
 /// Use <c>null</c> to specify that the enum member should not have an explicit value (default).
 /// Otherwise provide the value of the enum member.
 /// </param>
 public EnumMemberBuilder WithValue(int?value = null)
 {
     EnumerationMember = EnumerationMember.With(value: value.ToOption());
     return(this);
 }
Example #4
0
 internal EnumMemberBuilder(string name, Option <int> value)
 {
     EnumerationMember = new EnumerationMember(
         name: Option.Some(name),
         value: value);
 }