예제 #1
0
        /// <summary>
        ///     Retrieves configuration builder for particular enumeration value
        /// </summary>
        /// <param name="conf">Configuration builder</param>
        /// <param name="propertyName">String enum property name</param>
        /// <returns>Configuration builder</returns>
        public static EnumValueExportConfiguration Value(this IEnumConfigurationBuidler conf, string propertyName)
        {
            var field = conf.EnumType._GetField(propertyName);
            var c     = conf.ValueExportConfigurations.GetOrCreate(field, () => new EnumValueExportConfiguration(field));

            return(c);
        }
예제 #2
0
        /// <summary>
        ///     Retrieves configuration builder for particular enumeration value
        /// </summary>
        /// <param name="conf">Configuration builder</param>
        /// <param name="propertyName">String enum property name</param>
        /// <returns>Configuration builder</returns>
        public static EnumValueExportConfiguration Value(this IEnumConfigurationBuidler conf, string propertyName)
        {
            var field = conf.EnumType._GetField(propertyName);
            var c     = new EnumValueExportConfiguration(field, conf.Context.Project.Blueprint(conf.EnumType));

            return(c);
        }
예제 #3
0
        /// <summary>
        ///     Retrieves configuration builder for particular enumeration value
        /// </summary>
        /// <typeparam name="T">Enumeration type</typeparam>
        /// <param name="conf">Configuration builder</param>
        /// <param name="value">Enum value</param>
        /// <returns>Configuration builder</returns>
        public static EnumValueExportConfiguration Value <T>(this EnumConfigurationBuilder <T> conf, T value)
            where T : struct
        {
            var n     = Enum.GetName(typeof(T), value);
            var field = typeof(T)._GetField(n);
            IEnumConfigurationBuidler ecb = conf;
            var c = ecb.ValueExportConfigurations.GetOrCreate(field, () => new EnumValueExportConfiguration(field));

            return(c);
        }