示例#1
0
        /// <summary>
        /// Create a new <see cref="EnumConvertOptions"/> instance
        /// </summary>
        /// <param name="undefinedNames">Controls how undefined values are treated</param>
        /// <param name="undefinedValues">Controls how undefined names are treated</param>
        public EnumConvertOptions(UndefinedValueOption undefinedNames, UndefinedValueOption undefinedValues)
        {
            if (undefinedNames == UndefinedValueOption.Coerce)
            {
                throw new ArgumentException("Cannot coerce undefined enum names");
            }

            this.UndefinedValues = undefinedValues;
            this.UndefinedNames  = undefinedNames;

            this.IgnoreUndefinedNames  = this.UndefinedNames == UndefinedValueOption.Ignore;
            this.CoerceUndefinedValues = this.UndefinedValues == UndefinedValueOption.Coerce;
            this.IgnoreUndefinedValues = this.UndefinedValues == UndefinedValueOption.Ignore;
        }
 /// <summary>
 /// Set or update the <see cref="EnumConvertOptions"/> with the provider parameters
 /// </summary>
 /// <param name="undefinedNames"></param>
 /// <param name="undefinedValues"></param>
 /// <returns>A new <see cref="ConvertOptionsBuilder"/> with updated settings</returns>
 /// <seealso cref="EnumConvertOptions"/>
 public ConvertOptionsBuilder WithEnumOptions(UndefinedValueOption undefinedNames, UndefinedValueOption undefinedValues)
 => new ConvertOptionsBuilder(this, new EnumConvertOptions(undefinedNames, undefinedValues));
示例#3
0
 public ConvertOptionsBuilder WithEnumOptions(UndefinedValueOption undefinedNames, UndefinedValueOption undefinedValues) => throw null;
示例#4
0
 public EnumConvertOptions(UndefinedValueOption undefinedNames, UndefinedValueOption undefinedValues)
 {
 }