ValidateToken() public static méthode

public static ValidateToken ( string s ) : void
s string
Résultat void
Exemple #1
0
 public void SetAddress(string networkType, string addressType, string address)
 {
     if (string.IsNullOrEmpty(networkType))
     {
         throw new ArgumentException("networkType");
     }
     if (string.IsNullOrEmpty(addressType))
     {
         throw new ArgumentException("addressType");
     }
     if (string.IsNullOrEmpty(address))
     {
         throw new ArgumentException("address");
     }
     Grammar.ValidateToken(networkType);
     Grammar.ValidateToken(addressType);
     Grammar.ValidateAddress(address);
     if (IsReadOnly)
     {
         throw new InvalidOperationException("SessionDescription is read-only");
     }
     _networkType = networkType;
     _addressType = addressType;
     _address     = address;
 }
Exemple #2
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);
     }
 }
Exemple #3
0
 public void Add(string name)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Grammar.ValidateToken(name);
     if (IsReadOnly)
     {
         throw new InvalidOperationException("SessionDescription is read-only");
     }
     _values.Add(new KeyValuePair <string, string>(name, null));
 }
Exemple #4
0
 public void Set(string name)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Grammar.ValidateToken(name);
     if (IsReadOnly)
     {
         throw new InvalidOperationException("SessionDescription is read-only");
     }
     Set(name, (string)null);
 }
Exemple #5
0
 private void Validate(string item)
 {
     if (_type == Type.EMail)
     {
         Grammar.ValidateEMail(item);
     }
     else if (_type == Type.Phone)
     {
         Grammar.ValidatePhoneNumber(item);
     }
     else if (_type == Type.Format)
     {
         Grammar.ValidateToken(item);
     }
 }
Exemple #6
0
 public bool ContainsKey(string name)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     Grammar.ValidateToken(name);
     foreach (var pair in _values)
     {
         if (pair.Key.Equals(name))
         {
             return(true);
         }
     }
     return(false);
 }