System.Security.SecurityElement.IsValidAttributeValue C# (CSharp) Method

IsValidAttributeValue() public static method

public static IsValidAttributeValue ( string value ) : bool
value string
return bool
        public static bool IsValidAttributeValue(string value)
        {
            if (value == null)
                return false;

            return value.IndexOfAny(s_valueIllegalCharacters) == -1;
        }

Usage Example

 public SecurityAttribute(string name, string value)
 {
     if (!SecurityElement.IsValidAttributeName(name))
     {
         throw new ArgumentException(Locale.GetText("Invalid XML attribute name") + ": " + name);
     }
     if (!SecurityElement.IsValidAttributeValue(value))
     {
         throw new ArgumentException(Locale.GetText("Invalid XML attribute value") + ": " + value);
     }
     this._name  = name;
     this._value = SecurityElement.Unescape(value);
 }
All Usage Examples Of System.Security.SecurityElement::IsValidAttributeValue