private bool IsValidAttribute(string attributeName) { if (!ValidAttributes.Contains(attributeName)) { return(false); } return(true); }
protected void addAttributes() { foreach (KeyValuePair <string, string> kvp in Attributes) { string key = kvp.Key; string val = kvp.Value; int posn = ValidAttributes.FindIndex(k => k == key); if (posn >= 0) { Element.SetAttributeValue(key, _convert_values(val)); } else { throw new PlivoXMLException($"Invalid attribute {key} for {GetType().Name}"); } } }
/// <summary> /// Checks if an attribute flag is valid. /// </summary> /// <param name="attribute">The attribute to test.</param> /// <returns>True if the attribute is value.</returns> public bool HasValidAttribute(AlpcMessageAttributeFlags attribute) { return(ValidAttributes.HasFlag(attribute)); }