TextParser.Parser.LoadFilters C# (CSharp) Method

LoadFilters() public method

Load the filters from the given IParserFilters object.
public LoadFilters ( IParserFilters filters ) : void
filters IParserFilters The IParserFilters derived class from where to load the filters.
return void
        public void LoadFilters(IParserFilters filters)
        {
            Debug.AssertNotNull(filters, "Parser filters parameter is null");

            // load each type of filter
            if(filters.Keywords != null) {
                foreach(string s in filters.Keywords) {
                    keywords.Add(s);
                }
            }

            if(filters.Fields != null) {
                foreach(string s in filters.Fields) {
                    fields.Add(s);
                }
            }

            if(filters.Operators != null) {
                foreach(string s in filters.Operators) {
                    operators.Add(s);
                }
            }

            if(filters.Separators != null) {
                foreach(char c in filters.Separators) {
                    separators.Add(c);
                }
            }

            if(filters.StringSeparators != null) {
                foreach(TextSeparator ts in filters.StringSeparators) {
                    stringSeparators.Add(ts);
                }
            }

            if(filters.CommentSeparators != null) {
                foreach(TextSeparator ts in filters.CommentSeparators) {
                    commentSeparators.Add(ts);
                }
            }
        }