ValidateByteString() public static method

public static ValidateByteString ( string s ) : void
s string
return void
Beispiel #1
0
 public void Set(string name, IEnumerable <string> values)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Grammar.ValidateToken(name);
     foreach (string value in values)
     {
         if (value != null)
         {
             Grammar.ValidateByteString(value);
         }
     }
     if (IsReadOnly)
     {
         throw new InvalidOperationException("SessionDescription is read-only");
     }
     if (ContainsKey(name))
     {
         throw new ArgumentException("An element with the same name already exists");
     }
     foreach (var value in values)
     {
         Add(name, value);
     }
 }
Beispiel #2
0
 public void Add(string name, string value)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Grammar.ValidateToken(name);
     if (value != null)
     {
         Grammar.ValidateByteString(value);
     }
     if (IsReadOnly)
     {
         throw new InvalidOperationException("SessionDescription is read-only");
     }
     _values.Add(new KeyValuePair <string, string>(name, value));
 }