ValidateToken() public static method

public static ValidateToken ( string s ) : void
s string
return void
コード例 #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;
 }
コード例 #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);
     }
 }
コード例 #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));
 }
コード例 #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);
 }
コード例 #5
0
ファイル: StringCollection.cs プロジェクト: bbc/sdp-test
 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);
     }
 }
コード例 #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);
 }