Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
        }