Пример #1
0
        /// <summary>
        /// Spec section 2.4.2 says that identifiers are compared without regard
        /// to leading "@" characters or unicode formatting characters.  As in dev10,
        /// this is actually accomplished by dropping such characters during parsing.
        /// Unfortunately, metadata names can still contain these characters and will
        /// not be referenceable from source if they do (lookup will fail since the
        /// characters will have been dropped from the search string).
        /// See DevDiv #14432 for more.
        /// </summary>
        internal static bool ContainsDroppedIdentifierCharacters(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(false);
            }
            if (name[0] == '@')
            {
                return(true);
            }

            int nameLength = name.Length;

            for (int i = 0; i < nameLength; i++)
            {
                if (SyntaxFacts.IsFormattingChar(name[i]))
                {
                    return(true);
                }
            }

            return(false);
        }