Esempio n. 1
0
        public override bool Satisfies(DataElement obj)
        {
            bool result;

            string val;
            bool   applicable = obj.GetStringFromDataPath(dpath, out val);

            if (!applicable)
            {
                result = false;
            }
            else
            {
                switch (FilterType)
                {
                case StringFilterType.EQUAL:
                {
                    if (IgnoreCase)
                    {
                        result = val.ToLower() == RefValueLowerCase;
                    }
                    else
                    {
                        result = val == RefValue;
                    }
                }
                break;

                case StringFilterType.CONTAINS:
                {
                    if (IgnoreCase)
                    {
                        result = (val.ToLower()).Contains(RefValueLowerCase);
                    }
                    else
                    {
                        result = val.Contains(RefValue);
                    }
                }
                break;

                default:
                    result = false;
                    break;
                }
            }

            return(result ^ NegateResult);
        }