Пример #1
0
        /// <summary>Generates a property.</summary>
        /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
        /// <param name="property">The property.</param>
        /// <returns>The property.</returns>
        public override Property GenerateProperty(PropertyInfo property)
        {
            if (property.PropertyType != typeof(string))
            {
                throw new InvalidOperationException("Must use a string property.");
            }

            var sp = new StringProperty
            {
                Name      = property.Name,
                SplitType = SplitType,
                Separator = Separator,
                AsEnum    = AsEnum,
                Discrete  = true
            };

            if (!string.IsNullOrWhiteSpace(ExclusionFile))
            {
                sp.ImportExclusions(ExclusionFile);
            }


            return(sp);
        }