protected override void InternalAssignFrom(DefaultableMulti other) { base.InternalAssignFrom(other); PropertyRegexConstraint otherConstraint = other as PropertyRegexConstraint; if (otherConstraint != null) { this.Pattern = otherConstraint.Pattern; this.Options = otherConstraint.Options; } }
protected override bool InternalEqualsTo(DefaultableMulti other) { bool equals = base.InternalEqualsTo(other); PropertyRegexConstraint otherConstraint = other as PropertyRegexConstraint; if (equals && otherConstraint != null) { equals = Util.StringEqual(this.Pattern, otherConstraint.Pattern, false) && this.Options == otherConstraint.Options; } return(equals); }
protected override void InternalMergeChanges(ref PropertyConstraint mergedConstraint, PropertyConstraint otherConstraint, MergeConflictAction mergeConflictAction) { PropertyRegexConstraint other = (PropertyRegexConstraint)otherConstraint; PropertyRegexConstraint merged = (PropertyRegexConstraint)mergedConstraint; Defaultable <string> mergedPattern = this.GetPatternAsDefaultable().Merge(other.GetPatternAsDefaultable(), mergeConflictAction); merged.Pattern = mergedPattern.IsCustom() ? mergedPattern.Value : string.Empty; Defaultable <RegexOptions> mergedOptions = this.GetOptionsAsDefaultable().Merge(other.GetOptionsAsDefaultable(), mergeConflictAction); merged.Options = mergedOptions.IsCustom() ? mergedOptions.Value : RegexOptions.Compiled; }