Exemple #1
0
        public Type GetTypeByFullAddress(Address address)
        {
            Type typ;

            try
            {
                typ = inner.GetTypeByFullAddress(address);

                if (typ == null)
                {
                    typ = nuiTypeDirectory.GetTypeByFullAddress(address);
                }
            }
            catch (TypeLocationException)
            {
                typ = nuiTypeDirectory.GetTypeByFullAddress(address);
            }

            return(typ);
        }
Exemple #2
0
        public Type GetTypeByPrefix(ConstructionNode node, string prefixedType)
        {
            var p        = prefixedType.Dicotomize(':');
            var prefix   = p.Item2 == null ? "": p.Item1;
            var typeName = p.Item2 ?? p.Item1;

            var availablePrefixes = GetAvailableFrom(Root, node);

            var prefixRegistration = availablePrefixes.First(registration => registration.Prefix == prefix);

            return(typeDirectory.GetTypeByFullAddress(new Address(prefixRegistration.NamespaceName, typeName)));
        }
Exemple #3
0
        public Type LocateType(XName typeXName)
        {
            var ns       = typeXName.NamespaceName;
            var typeName = typeXName.LocalName;

            var type = typeDirectory.GetTypeByFullAddress(new Address(ns, typeName));

            if (type == null)
            {
                var extensionType = typeDirectory.GetTypeByFullAddress(new Address(ns, typeName + ExtensionSuffix));

                if ((extensionType != null) && extensionType.IsExtension())
                {
                    type = extensionType;
                }
            }

            if (type == null)
            {
                throw new TypeNotFoundException($"Cannot not find the type {typeXName}");
            }

            return(type);
        }
 public Type GetTypeByFullAddress(Address address)
 {
     return(inner.GetTypeByFullAddress(address));
 }