bool IsNSObject(TypeReference reference) { if (reference == null) { return(false); } if (reference.FullName == TypeAggregator.kNSObject) { return(true); } if (reference.Module != null) { return(IsNSObject(reference.Resolve())); } if (peerDatabase == null) { return(false); } var entity = peerDatabase.EntityForDotNetName(new DotNetName(reference.Namespace, reference.Name)); if (entity != null) { return(entity.Type.IsObjC); } return(false); }
BindingImporter(string assemblyPath, ErrorHandling errors, TypeDatabase peerDatabase = null) { Ex.ThrowOnNull(assemblyPath, nameof(assemblyPath)); this.errors = Ex.ThrowOnNull(errors, nameof(errors)); this.peerDatabase = peerDatabase; aggregator = new TypeAggregator(assemblyPath); aggregator.IsObjCChecker = (nameSpace, typeName) => { if (peerDatabase == null) { return(false); } var entity = peerDatabase.EntityForDotNetName(new DotNetName(nameSpace, typeName)); if (entity != null) { return(entity.Type.IsObjC); } return(false); }; }