public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } return(node.getAttribute("disabled") == null && node.getAttribute("readonly") == null); }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } // Get the value: string value = node.getAttribute("value"); // Required and blank is invalid: return(node.getAttribute("required") != null && string.IsNullOrEmpty(value)); }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } return(node.getAttribute("visited") != null); }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } return(node.getAttribute("indeterminate") == "1"); }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } if (node.getAttribute("required") == null) { // Not required. return(true); } // Get the value: string value = node.getAttribute("value"); // Not blank: return(!string.IsNullOrEmpty(value)); }
public override bool TryMatch(Dom.Node context) { if (context == null) { return(false); } // Read it: string value = context.getAttribute(Attribute); if (value == null) { return(false); } if (Value == null) { // Attribute must just exist. return(true); } if (CaseInsensitive) { value = value.ToLower(); } switch (MatchMode) { default: case 0: // Equals: (=) return(value == Value); case 1: // Starts with: (^=) return(value.StartsWith(Value)); case 2: // Ends with: ($=) return(value.EndsWith(Value)); case 3: // Contains substring: (*=) return(value.Contains(Value)); case 4: // Contains word: (~=) return((value == Value) || value.Contains(" " + Value + " ") || value.StartsWith(Value + " ") || value.EndsWith(" " + Value)); case 5: // Starts with value and - (|=) return((value == Value) || value.StartsWith(Value + "-")); } }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } // Blank strings and '1' mean it's checked: string check = node.getAttribute("checked"); return(check == "1" || check == ""); }
public override bool TryMatch(Dom.Node node) { if (node == null) { return(false); } // Get the value: int value; if (int.TryParse(node.getAttribute("value"), out value)) { // Get min: int min; int.TryParse(node.getAttribute("min"), out min); if (value < min) { return(false); } // Get max: int max; if (!int.TryParse(node.getAttribute("max"), out max)) { max = int.MaxValue; } if (value > max) { return(false); } // In range! return(true); } return(false); }