Exemple #1
0
        internal static bool SplitTypeName(XamlParserContext parserContext, ITextLocation lineInformation, string prefixAndTypeName, out XmlnsPrefix prefix, out string typeName)
        {
            int length = prefixAndTypeName.IndexOf(':');

            if (length >= 0)
            {
                if (length == 0 || length == prefixAndTypeName.Length - 1)
                {
                    parserContext.ReportError(XamlParseErrors.InvalidPrefixQualifiedTypeName(lineInformation, prefixAndTypeName));
                    prefix   = (XmlnsPrefix)null;
                    typeName = (string)null;
                    return(false);
                }
                prefix   = XmlnsPrefix.ToPrefix(prefixAndTypeName.Substring(0, length));
                typeName = prefixAndTypeName.Substring(length + 1);
                return(true);
            }
            prefix   = XmlnsPrefix.EmptyPrefix;
            typeName = prefixAndTypeName;
            return(true);
        }