/// <summary>Create policy with full paramterers.</summary> /// <param name="old">Old policy to copy from.</param> /// <param name="directives">Directives to override.</param> /// <param name="tagRules">Tag rules to override.</param> protected Policy(Policy old, Dictionary <string, string> directives, Dictionary <string, Tag> tagRules) { commonAttributes = old.commonAttributes; commonRegularExpressions = old.commonRegularExpressions; cssRules = old.cssRules; this.directives = directives; dynamicAttributes = old.dynamicAttributes; globalAttributes = old.globalAttributes; this.tagRules = tagRules; allowedEmptyTagsMatcher = old.allowedEmptyTagsMatcher; requireClosingTagsMatcher = old.requireClosingTagsMatcher; }
/// <summary>Create policy with <see cref="ParseContext"/>.</summary> /// <param name="parseContext">Context with all collections to load the new policy.</param> protected Policy(ParseContext parseContext) { commonAttributes = parseContext.commonAttributes; commonRegularExpressions = parseContext.commonRegularExpressions; cssRules = parseContext.cssRules; directives = parseContext.directives; dynamicAttributes = parseContext.dynamicAttributes; globalAttributes = parseContext.globalAttributes; tagRules = parseContext.tagRules; allowedEmptyTagsMatcher = new TagMatcher(parseContext.allowedEmptyTags); requireClosingTagsMatcher = new TagMatcher(parseContext.requireClosingTags); }