IsValidIdentifier() 공개 정적인 메소드

Determines whether the given name is a legal identifier.
public static IsValidIdentifier ( string name ) : bool
name string The name to check.
리턴 bool
예제 #1
0
 /// <summary>
 /// Initializes a new instance of a TagParameter.
 /// </summary>
 /// <param name="parameterName">The name of the parameter.</param>
 /// <exception cref="System.ArgumentException">The parameter name is null or an invalid identifier.</exception>
 public TagParameter(string parameterName)
 {
     if (!RegexHelper.IsValidIdentifier(parameterName))
     {
         throw new ArgumentException(Resources.BlankParameterName, "parameterName");
     }
     _name = parameterName;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of a TagDefinition.
 /// </summary>
 /// <param name="tagName">The name of the tag.</param>
 /// <param name="isBuiltIn">Specifies whether the tag is built-in or not. Checks are not performed on the names of built-in tags.</param>
 internal TagDefinition(string tagName, bool isBuiltIn)
 {
     if (!isBuiltIn && !RegexHelper.IsValidIdentifier(tagName))
     {
         throw new ArgumentException(Resources.BlankTagName, "tagName");
     }
     _tagName = tagName;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of a TagDefinition.
 /// </summary>
 /// <param name="tagName">The name of the tag.</param>
 /// <param name="isBuiltIn">Specifies whether the tag is built-in or not. Checks are not performed on the names of built-in tags.</param>
 internal TagDefinition(string tagName, bool isBuiltIn)
 {
     if (!isBuiltIn && !RegexHelper.IsValidIdentifier(tagName))
     {
         throw new ArgumentException("An attempt was made to define a tag with a null or an invalid identifier.", "tagName");
     }
     _tagName = tagName;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of a TagParameter.
 /// </summary>
 /// <param name="parameterName">The name of the parameter.</param>
 /// <exception cref="System.ArgumentException">The parameter name is null or an invalid identifier.</exception>
 public TagParameter(string parameterName)
 {
     if (!RegexHelper.IsValidIdentifier(parameterName))
     {
         throw new ArgumentException("An attempt was made to define a parameter with a null or an invalid identifier.", "parameterName");
     }
     _name = parameterName;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of a TagDefinition.
 /// </summary>
 /// <param name="tagName">The name of the tag.</param>
 /// <param name="isBuiltIn">Specifies whether the tag is built-in or not. Checks are not performed on the names of built-in tags.</param>
 internal TagDefinition(string tagName, bool isBuiltIn)
 {
     if (!isBuiltIn && !RegexHelper.IsValidIdentifier(tagName))
     {
         throw new ArgumentException("blank tag name " + tagName);
     }
     _tagName = tagName;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of a TagParameter.
 /// </summary>
 /// <param name="parameterName">The name of the parameter.</param>
 /// <exception cref="System.ArgumentException">The parameter name is null or an invalid identifier.</exception>
 public TagParameter(string parameterName)
 {
     if (!RegexHelper.IsValidIdentifier(parameterName))
     {
         throw new ArgumentException("invalid argument identifier " + parameterName);
     }
     _name = parameterName;
 }