System.Xml.Serialization.CodeIdentifier.CheckValidIdentifier C# (CSharp) Method

CheckValidIdentifier() static private method

static private CheckValidIdentifier ( string ident ) : void
ident string
return void
        internal static void CheckValidIdentifier(string ident)
        {
            if (!CSharpHelpers.IsValidLanguageIndependentIdentifier(ident))
                throw new ArgumentException(SR.Format(SR.XmlInvalidIdentifier, ident), nameof(ident));
        }

Usage Example

Example #1
0
        internal string GetStringForEnumCompare(EnumMapping mapping, string memberName, bool useReflection)
        {
            if (!useReflection)
            {
                CodeIdentifier.CheckValidIdentifier(memberName);
                return(mapping.TypeDesc.CSharpName + ".@" + memberName);
            }
            string variable = this.GetStringForEnumMember(mapping.TypeDesc.CSharpName, memberName, useReflection);

            return(this.GetStringForEnumLongValue(variable, useReflection));
        }
All Usage Examples Of System.Xml.Serialization.CodeIdentifier::CheckValidIdentifier