TypeDeclaration ToProtocolDeclaration(TypeDefinition definition)
        {
            var name       = TypeAggregator.ProtocolAttributeName(definition) ?? definition.Name;
            var moduleName = definition.Namespace;

            // FIXME: these cases don't have a clear resolution
            // don't know what to do about this, so skip I guess?
            if (name == "NSDraggingDestination" || name == "NSDraggingInfo")
            {
                return(null);
            }

            TypeAggregator.RemapModuleAndName(platform, ref moduleName, ref name, TypeType.Interface);


            var protocolDeclaration = new ProtocolDeclaration {
                Name              = name,
                Access            = ToAccessibility(definition),
                Module            = ToModuleDeclaration(moduleName),
                ParentExtension   = null,
                Kind              = TypeKind.Protocol,
                Members           = new List <Member> (),
                IsObjC            = true,
                IsFinal           = definition.IsSealed,
                IsDeprecated      = false,
                IsUnavailable     = false,
                IsImportedBinding = true
            };

            protocolDeclaration.Inheritance.AddRange(ToInheritance(definition));
            return(protocolDeclaration.MakeUnrooted());
        }
        TypeDeclaration ToStructDeclaration(TypeDefinition definition)
        {
            var name       = TypeAggregator.ProtocolAttributeName(definition) ?? definition.Name;
            var moduleName = definition.Namespace;

            if (TypeAggregator.FilterModuleAndName(platform, moduleName, ref name))
            {
                TypeAggregator.RemapModuleAndName(platform, ref moduleName, ref name, TypeType.Struct);
                var module            = ToModuleDeclaration(moduleName);
                var structDeclaration = new StructDeclaration {
                    Name            = name,
                    Access          = ToAccessibility(definition),
                    Module          = module,
                    ParentExtension = null,
                    Kind            = TypeKind.Struct,
                    Members         = new List <Member> (),
                    IsObjC          = true,
                    IsFinal         = true,
                    IsDeprecated    = false,
                    IsUnavailable   = false
                };
                return(structDeclaration.MakeUnrooted());
            }
            return(null);
        }