ImportExclusions() 공개 메소드

import exclusion list from file.
public ImportExclusions ( string file ) : void
file string .
리턴 void
예제 #1
0
 /// <summary>Adds string property to descriptor with previously chained name.</summary>
 /// <param name="splitType">How to split string.</param>
 /// <param name="separator">(Optional) Separator to use.</param>
 /// <param name="exclusions">(Optional) file describing strings to exclude.</param>
 /// <returns>descriptor with added property.</returns>
 public Descriptor AsString(StringSplitType splitType, string separator = " ", string exclusions = null)
 {
     StringProperty p = new StringProperty();
     p.Name = _name;
     p.SplitType = splitType;
     p.Separator = separator;
     p.ImportExclusions(exclusions);
     p.AsEnum = _label;
     AddProperty(p);
     return _descriptor;
 }
예제 #2
0
        /// <summary>Adds string property to descriptor with previously chained name.</summary>
        /// <param name="splitType">How to split string.</param>
        /// <param name="separator">(Optional) Separator to use.</param>
        /// <param name="exclusions">(Optional) file describing strings to exclude.</param>
        /// <returns>descriptor with added property.</returns>
        public Descriptor AsString(StringSplitType splitType, string separator = " ", string exclusions = null)
        {
            StringProperty p = new StringProperty();

            p.Name      = _name;
            p.SplitType = splitType;
            p.Separator = separator;
            p.ImportExclusions(exclusions);
            p.AsEnum = _label;
            AddProperty(p);
            return(_descriptor);
        }
예제 #3
0
        /// <summary>Adds string property to descriptor with previously chained name.</summary>
        /// <param name="splitType">How to split string.</param>
        /// <param name="separator">(Optional) Separator to use.</param>
        /// <param name="exclusions">(Optional) file describing strings to exclude.</param>
        /// <returns>descriptor with added property.</returns>
        public Descriptor AsString(StringSplitType splitType, string separator = " ", string exclusions = null)
        {
            var p = new StringProperty
            {
                Name      = _name,
                SplitType = splitType,
                Separator = separator,
                AsEnum    = _label
            };

            p.ImportExclusions(exclusions);
            AddProperty(p);
            return(_descriptor);
        }
예제 #4
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 = this.SplitType, Separator = this.Separator,
                AsEnum = this.AsEnum, Discrete = true
            };

            sp.ImportExclusions(this.ExclusionFile);

            return(sp);
        }
예제 #5
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);
        }
예제 #6
0
        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
            };

            sp.ImportExclusions(ExclusionFile);

            return sp;
        }