/// <summary> /// Creates a condition for the current rule. /// </summary> /// <returns>The condition base of the rule.</returns> protected override ConditionBase CreateCondition() { TextCompareType contains; switch (this.Operator) { case TextComparisonOperator.Contains: contains = TextCompareType.Contains; break; case TextComparisonOperator.DoesNotContain: contains = TextCompareType.DoesNotContain; break; case TextComparisonOperator.BeginsWith: contains = TextCompareType.BeginsWith; break; case TextComparisonOperator.EndsWith: contains = TextCompareType.EndsWith; break; default: contains = TextCompareType.EqualsTo; break; } TextCondition condition = TextCondition.FromString(contains, this.text); condition.IgnoreCase = true; return(condition); }
/// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// <returns> /// A new object that is a copy of this instance. /// </returns> public override object Clone() { TextCondition condition = base.Clone() as TextCondition; condition.compareType = this.compareType; condition.useWildCards = this.useWildCards; condition.ignoreCase = this.ignoreCase; condition.forceValue2Text = this.forceValue2Text; return(condition); }