ImportExclusions() public method

import exclusion list from file.
public ImportExclusions ( string file ) : void
file string .
return void
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
        }