IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags) { foreach (IFluentAttributeRule rule in this) { rule.As(flags); } return(this); }
protected HtmlAttributeRule GetAttributeRule(HtmlElementRule parent, string attribute) { bool isInternal = ((parent.Options & HtmlElementOptions.Generated) == HtmlElementOptions.Generated); HtmlAttributeOptions flags = (_settings.Mode == HtmlFilteringMode.AllowByDefault || isInternal) ? HtmlAttributeOptions.Allowed : HtmlAttributeOptions.Denied; return(parent.Attributes[attribute] ?? _settings.Document.Attributes[attribute] ?? new HtmlAttributeRule(_settings.Document, attribute, flags)); }
private IFluentAttributeRule SetDefaultValue(string defaultValue) { _defaultValue = defaultValue; if (!String.IsNullOrEmpty(defaultValue)) { _options |= HtmlAttributeOptions.Default; } return(this); }
public HtmlAttributeRule(HtmlElementRule element, string name, HtmlAttributeOptions flags, string pattern, string defaultValue) { Precondition.Require(element, () => Error.ArgumentNull("element")); Precondition.Defined(name, () => Error.ArgumentNull("name")); _element = element; _name = name; _options = flags; _pattern = pattern; _defaultValue = defaultValue; }
public HtmlAttributeRule(HtmlElementRule element, string name, HtmlAttributeOptions flags, string pattern) : this(element, name, flags, pattern, null) { }
IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags) { _options = flags; return this; }
private IFluentAttributeRule SetDefaultValue(string defaultValue) { _defaultValue = defaultValue; if (!String.IsNullOrEmpty(defaultValue)) _options |= HtmlAttributeOptions.Default; return this; }
IFluentAttributeRule IFluentAttributeRule.As(HtmlAttributeOptions flags) { _options = flags; return(this); }