示例#1
0
        internal static bool SplitMemberName(XamlParserContext parserContext, ITextLocation lineInformation, string typeAndMemberName, out string typeName, out string memberName)
        {
            typeName   = (string)null;
            memberName = (string)null;
            int length = typeAndMemberName.LastIndexOf('.');

            if (length >= 0)
            {
                if (length == 0 || length == typeAndMemberName.Length - 1)
                {
                    parserContext.ReportError(XamlParseErrors.InvalidTypeQualifiedMemberName(lineInformation, typeAndMemberName));
                    return(false);
                }
                typeName   = typeAndMemberName.Substring(0, length);
                memberName = typeAndMemberName.Substring(length + 1);
                return(true);
            }
            memberName = typeAndMemberName;
            return(true);
        }