/// <summary>
        /// Determines whether the specified left is equal.
        /// </summary>
        /// <param name="left">The left.</param>
        /// <param name="right">The right.</param>
        /// <param name="compareType">Type of the compare.</param>
        /// <param name="operator">The operator.</param>
        /// <returns><c>true</c> if the specified left is equal; otherwise, <c>false</c>.</returns>
        public static bool IsEqual(string left, string right, ComparisonTypeEnum compareType, OperatorEnums @operator, string ignoreChars, int leftZone, int rightZone)
        {
            right       = string.IsNullOrEmpty(right) ? string.Empty : right;
            left        = string.IsNullOrEmpty(left) ? string.Empty : left;
            ignoreChars = string.IsNullOrEmpty(ignoreChars) ? string.Empty : ignoreChars;

            ignoreChars.ToList().ForEach(@char => right = right.Replace(@char, ' '));
            ignoreChars.ToList().ForEach(@char => left  = left.Replace(@char, ' '));

            if (@operator == OperatorEnums.In)
            {
                return(CompareIn(left, right, compareType));
            }

            if (@operator == OperatorEnums.Table)
            {
                return(CompareTable(left, right, compareType, leftZone, rightZone));
            }

            if (@operator == OperatorEnums.Equals)
            {
                return(CompareEqual(left, right, compareType, leftZone, rightZone));
            }

            if (@operator == OperatorEnums.StartsWidth)
            {
                return(right.StartsWith(left));
            }

            if (@operator == OperatorEnums.EndsWidth)
            {
                return(right.EndsWith(left));
            }

            if (@operator == OperatorEnums.Contains)
            {
                return(right.Contains(left));
            }

            return(false);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompareParameters" /> class.
 /// </summary>
 /// <param name="operator">The operator.</param>
 public CompareParameters(OperatorEnums @operator)
 {
     this.Operator = @operator;
     Parameters    = new List <object>();
 }