internal void Update()
        {
            if (!needsUpdating)
            {
                return;
            }
            foreach (DotNetProject r in dom.ReferencedProjects)
            {
                var info = infoService.GetProjectInfo(r);
                if (info != null)
                {
                    info.Update();
                }
            }
            TypeSystemService.ForceUpdate(dom);
            objcTypes.Clear();
            cliTypes.Clear();
            refObjcTypes.Clear();
            refCliTypes.Clear();

            foreach (var type in infoService.GetRegisteredObjects(dom, dom.Compilation.MainAssembly))
            {
                if (objcTypes.ContainsKey(type.ObjCName))
                {
                    var other = objcTypes[type.ObjCName];
                    throw new ArgumentException(string.Format("Multiple types ({0} and {1}) registered with the same Objective-C name: {2}", type.CliName, other.CliName, type.ObjCName));
                }

                objcTypes.Add(type.ObjCName, type);
                cliTypes.Add(type.CliName, type);
            }

            foreach (var refAssembly in dom.Compilation.ReferencedAssemblies)
            {
                foreach (var type in infoService.GetRegisteredObjects(dom, refAssembly))
                {
                    if (refObjcTypes.ContainsKey(type.ObjCName))
                    {
                        var other = refObjcTypes[type.ObjCName];
                        throw new ArgumentException(string.Format("Multiple types ({0} and {1}) registered with the same Objective-C name: {2}", type.CliName, other.CliName, type.ObjCName));
                    }

                    refObjcTypes.Add(type.ObjCName, type);
                    refCliTypes.Add(type.CliName, type);
                }
            }

            foreach (var type in cliTypes.Values)
            {
                ResolveCliToObjc(type);
            }

            needsUpdating = false;
        }
Example #2
0
        internal void Update()
        {
            if (!needsUpdating)
            {
                return;
            }

            foreach (var r in dom.References)
            {
                var info = NSObjectInfoService.GetProjectInfo(r);
                if (info != null)
                {
                    info.Update();
                }
            }

            objcTypes.Clear();
            cliTypes.Clear();

            foreach (var type in NSObjectInfoService.GetRegisteredObjects(dom))
            {
                objcTypes.Add(type.ObjCName, type);
                cliTypes.Add(type.CliName, type);
            }

            foreach (var type in objcTypes.Values)
            {
                ResolveTypes(type);
            }

            needsUpdating = false;
        }