Inheritance: AbstractNamespace
Exemplo n.º 1
0
        private void CatalogPublicTypes(IEnumerable <Type> types)
        {
            string lastNs = "!!not a namespace!!";
            ReflectionNamespace lastNsEntity = null;

            foreach (Type type in types)
            {
#if DNXCORE50
                if (!type.GetTypeInfo().IsPublic)
                {
                    continue;
                }
#else
                if (!type.IsPublic)
                {
                    continue;
                }
#endif

                string ns = type.Namespace ?? string.Empty;
                //retrieve the namespace only if we don't have it handy already
                //usually we'll have it since GetExportedTypes() seems to export
                //types in a sorted fashion.
                if (ns != lastNs)
                {
                    lastNs       = ns;
                    lastNsEntity = GetNamespace(ns);
                    lastNsEntity.Add(type);
                }
                else
                {
                    lastNsEntity.Add(type);
                }
            }
        }
Exemplo n.º 2
0
        public ReflectionNamespace GetNamespace(string ns)
        {
            if (ns.Length == 0)
            {
                return(_root);
            }

            string[]            namespaceHierarchy = ns.Split('.');
            ReflectionNamespace current            = _root;

            foreach (string namespacePart in namespaceHierarchy)
            {
                current = current.Produce(namespacePart);
            }
            return(current);
        }
Exemplo n.º 3
0
 public ChildReflectionNamespace(ReflectionNamespace parent, string name) : base(parent._provider)
 {
     _parent = parent;
     _name   = name;
 }
Exemplo n.º 4
0
 public ReflectionNamespaceBuilder(IReflectionTypeSystemProvider provider, Assembly assembly)
 {
     _root     = new ReflectionNamespace(provider);
     _assembly = assembly;
 }
Exemplo n.º 5
0
			public ChildReflectionNamespace(ReflectionNamespace parent, string name) : base(parent._provider)
			{
				_parent = parent;
				_name = name;
			}
Exemplo n.º 6
0
		public ReflectionNamespaceBuilder(IReflectionTypeSystemProvider provider, Assembly assembly)
		{
			_root = new ReflectionNamespace(provider);
			_assembly = assembly;
		}