Exemplo n.º 1
0
        public static XamlName FromPrefixedName(string prefixedName, XamlNamespaces namespaces)
        {
            string typeName            = prefixedName;
            string typeNamespacePrefix = String.Empty;

            int namespaceSeparatorIndex = prefixedName.IndexOf(":");

            if (namespaceSeparatorIndex != -1)
            {
                typeNamespacePrefix = prefixedName.Substring(0, namespaceSeparatorIndex);
                typeName            = prefixedName.Substring(namespaceSeparatorIndex + 1);
            }

            return(namespaces.Contains(typeNamespacePrefix) ? new XamlName(typeName, namespaces.Get(typeNamespacePrefix)) : XamlName.Empty);
        }
Exemplo n.º 2
0
        public static XamlName FromPrefixedName(string prefixedName, XamlNamespaces namespaces)
        {
            string typeName = prefixedName;
            string typeNamespacePrefix = String.Empty;

            int namespaceSeparatorIndex = prefixedName.IndexOf(":");
            if (namespaceSeparatorIndex != -1)
            {
                typeNamespacePrefix = prefixedName.Substring(0, namespaceSeparatorIndex);
                typeName = prefixedName.Substring(namespaceSeparatorIndex + 1);
            }

            return namespaces.Contains(typeNamespacePrefix) ? new XamlName(typeName, namespaces.Get(typeNamespacePrefix)) : XamlName.Empty;
        }
        internal static XamlType LookupXamlType(string typeNamespace, string typeName)
        {
            if (XamlNamespaces.Contains(typeNamespace))
            {
                switch (typeName)
                {
                case "Array":
                case "ArrayExtension":
                    return(Array);

                case "Member":
                    return(Member);

                case "Null":
                case "NullExtension":
                    return(Null);

                case "Property":
                    return(Property);

                case "Reference":
                case "ReferenceExtension":
                    return(Reference);

                case "Static":
                case "StaticExtension":
                    return(Static);

                case "Type":
                case "TypeExtension":
                    return(Type);

                case "String":
                    return(String);

                case "Double":
                    return(Double);

                case "Int16":
                    return(Int16);

                case "Int32":
                    return(Int32);

                case "Int64":
                    return(Int64);

                case "Boolean":
                    return(Boolean);

                case "XData":
                    return(XData);

                case "Object":
                    return(Object);

                case "Char":
                    return(Char);

                case "Single":
                    return(Single);

                case "Byte":
                    return(Byte);

                case "Decimal":
                    return(Decimal);

                case "Uri":
                    return(Uri);

                case "TimeSpan":
                    return(TimeSpan);
                }
            }
            return(null);
        }
Exemplo n.º 4
0
 public static bool ContainsDefault(this XamlNamespaces @this)
 {
     return(@this.Contains(String.Empty));
 }