public bool Check(XmlLocationType locationType, string name) { if (locationType.HasFlag(XmlLocationType.Element)) { if (ElementAllowedNames.Contains(name)) { return(true); } } if (locationType.HasFlag(XmlLocationType.Attribute)) { if (AttributeAllowedNames.Contains(name)) { return(true); } } return(false); }
public XmlLocationAttribute(XmlLocationType locationType, params string[] allowedNames) { LocationType = locationType; AllowedNames = allowedNames.ToList(); }
public bool Check(XmlLocationType locationType, string name) { if (locationType.HasFlag(XmlLocationType.Element)) { if (ElementAllowedNames.Contains(name)) return true; } if (locationType.HasFlag(XmlLocationType.Attribute)) { if (AttributeAllowedNames.Contains(name)) return true; } return false; }