public TypeInfo Type(ITypeDeclaration type, ModuleInfo module)
        {
            if (type == null)
            {
                return null;
            }

            if (_typeCorrespondence.ContainsKey(type))
            {
                return _typeCorrespondence[type];
            }

            var methods = type.Methods.OfType<IMethodDeclaration>()
                   .Where(m => !m.Name.Contains("get_")
                               && !m.Name.Contains("set_")
                               && !m.Name.Contains("add_")
                               && !m.Name.Contains("remove_"))
                   .ToArray();

            var typeInfo = new TypeInfo
            {
                BaseTypeRetriever = () => Type(type.BaseType),
                Name = type.Name,
                Events = type.Events.OfType<IEventDeclaration>().Select(e => Event(e)),
                Properties = type.Properties.OfType<IPropertyDeclaration>().Select(p => Property(p)),
                MembersCount = methods.Count() + type.Events.Count + type.Properties.Count + type.Fields.Count,
                IsInternal = type.Visibility == TypeVisibility.Private
                             || type.Visibility == TypeVisibility.NestedPrivate
                             || type.Visibility == TypeVisibility.NestedFamilyAndAssembly
                             || type.Visibility == TypeVisibility.NestedAssembly,
                IsPublic = type.Visibility == TypeVisibility.Public
                           || type.Visibility == TypeVisibility.NestedPublic
                           || type.Visibility == TypeVisibility.NestedFamilyOrAssembly
                           || type.Visibility == TypeVisibility.NestedFamily,
                MemberReference = type,
                IsEnum = IsEnum(type),
                IsInterface = type.Interface,
                IsValueType = type.ValueType,
                IsSealed = type.Sealed,
                IsAbstract = type.Abstract
            };
            typeInfo.FullName = GetFullName(type.Namespace, typeInfo.Name);
            typeInfo.Methods = methods.Select(m => Method(m, typeInfo));
            typeInfo.Accessors = type.Methods.OfType<IMethodDeclaration>().Except(methods).Select(m => Method(m, typeInfo));
            typeInfo.Fields = type.Fields.OfType<IFieldDeclaration>().Select(f => Field(f, typeInfo));

            foreach (var eventInfo in typeInfo.Events)
            {
                eventInfo.DeclaringType = typeInfo;
            }
            foreach (var propertyInfo in typeInfo.Properties)
            {
                propertyInfo.DeclaringType = typeInfo;
            }

            _typeCorrespondence.Add(type, typeInfo);
            typeInfo.Module = module ?? Module(GetModuleForType(type));

            typeInfo.Icon = Images.Images.GetTypeIcon(typeInfo);

            return typeInfo;
        }
        public ModuleInfo Module(IModule module)
        {
            if (_moduleCorrespondence.ContainsKey(module))
            {
                return _moduleCorrespondence[module];
            }

            var moduleInfo = new ModuleInfo();
            _moduleCorrespondence.Add(module, moduleInfo);
            moduleInfo.Assembly = Assembly(module.Assembly);
            moduleInfo.Types = GetTypeDeclarations(module).Select(t => Type(t, moduleInfo));

            return moduleInfo;
        }