//FIXME: report errors
        SyncObjcBackJob ReadTypeFromXcode(FilePath hFile, ref NSObjectProjectInfo pinfo)
        {
            var parsed = NSObjectInfoService.ParseHeader(hFile);

            if (pinfo == null)
            {
                pinfo = NSObjectInfoService.GetProjectInfo(dnp);
            }

            var objcType = pinfo.GetType(hFile.FileNameWithoutExtension);

            if (objcType == null)
            {
                Console.WriteLine("Missing objc type {0}", hFile.FileNameWithoutExtension);
                return(null);
            }
            if (parsed.ObjCName != objcType.ObjCName)
            {
                Console.WriteLine("Parsed type name {0} does not match original {1}", parsed.ObjCName, objcType.ObjCName);
                return(null);
            }
            if (!objcType.IsUserType)
            {
                Console.WriteLine("Parsed type {0} is not a user type", objcType);
                return(null);
            }

            //FIXME: fix data loss when there are multiple designer types in one designer file, like MT templates
            var designerFile = objcType.GetDesignerFile();

            //FIXME: add a designer file if there are any designer outlets and actions
            if (designerFile == null)
            {
                return(null);
            }

            //FIXME: detect unresolved types
            parsed.MergeCliInfo(objcType);
            pinfo.ResolveTypes(parsed);

            return(new SyncObjcBackJob()
            {
                HFile = hFile,
                DesignerFile = designerFile,
                Type = parsed,
            });
        }
 bool UpdateTypes(IProgressMonitor monitor, bool force)
 {
     monitor.BeginTask(GettextCatalog.GetString("Updating Objective-C type information"), 0);
     try {
         var pinfo = infoService.GetProjectInfo(dnp);
         if (pinfo == null)
         {
             throw new Exception("Did not get project info");
         }
         //FIXME: report progress
         pinfo.Update(force);
         userTypes = pinfo.GetTypes().Where(t => t.IsUserType).ToList();
         return(true);
     } catch (Exception ex) {
         monitor.ReportError(GettextCatalog.GetString("Error updating Objective-C type information"), ex);
         return(false);
     }
 }
        void UpdateTypes(bool rescan)
        {
            var pinfo = NSObjectInfoService.GetProjectInfo(dnp);

            pinfo.Update(rescan);

            var currentUTs = new Dictionary <string, NSObjectTypeInfo> ();

            foreach (var ut in pinfo.GetTypes().Where(t => t.IsUserType))
            {
                currentUTs.Add(ut.ObjCName, ut);
            }

            foreach (var removed in this.userClasses.Where(c => !currentUTs.ContainsKey(c)).ToList())
            {
                RemoveUserType(removed);
            }

            foreach (var ut in currentUTs)
            {
                UpdateUserType(ut.Value);
            }
        }