private bool IsValidAttribute(string attributeName)
        {
            if (!ValidAttributes.Contains(attributeName))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 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}");
         }
     }
 }
Beispiel #3
0
 /// <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));
 }