public override void SyncBack (XcodeSyncBackContext context) { var hFile = context.ProjectDir.Combine (Type.ObjCName + ".h"); var objcType = context.ProjectInfo.GetType (Type.ObjCName); if (objcType == null) { context.ReportError ("Missing objc type {0}", Type.ObjCName); return; } if (!objcType.IsUserType) { context.ReportError ("Parsed type {0} is not a user type", objcType); return; } var parsed = NSObjectInfoService.ParseHeader (hFile); if (parsed == null) { context.ReportError ("Error parsing objc type {0}", Type.ObjCName); return; } if (parsed.ObjCName != objcType.ObjCName) { context.ReportError ("Parsed type name {0} does not match original {1}", parsed.ObjCName, objcType.ObjCName); return; } parsed.MergeCliInfo (objcType); context.TypeSyncJobs.Add (XcodeSyncObjcBackJob.UpdateType (parsed, objcType.GetDesignerFile ())); }
public override void SyncBack (XcodeSyncBackContext context) { var hFile = context.ProjectDir.Combine (Type.ObjCName + ".h"); var parsed = NSObjectInfoService.ParseHeader (hFile); var objcType = context.ProjectInfo.GetType (Type.ObjCName); if (objcType == null) { context.ReportError ("Missing objc type {0}", Type.ObjCName); return; } if (parsed.ObjCName != objcType.ObjCName) { context.ReportError ("Parsed type name {0} does not match original {1}", parsed.ObjCName, objcType.ObjCName); return; } if (!objcType.IsUserType) { context.ReportError ("Parsed type {0} is not a user type", objcType); return; } //FIXME: detect unresolved types parsed.MergeCliInfo (objcType); context.ProjectInfo.ResolveTypes (parsed); if (!context.ProjectInfo.ContainsErrors) { context.TypeSyncJobs.Add (new XcodeSyncObjcBackJob () { HFile = hFile, DesignerFile = objcType.GetDesignerFile (), Type = parsed, }); } else { context.SetSyncTimeToNow (Type.ObjCName + ".h"); LoggingService.LogWarning ("Sync back skipped because of errors in project info."); } }
public override void SyncBack(IProgressMonitor monitor, XcodeSyncBackContext context) { monitor.Log.WriteLine("Queueing sync-back of changes made to the {0} class from Xcode.", Type.CliName); var objcType = context.ProjectInfo.GetType(Type.ObjCName); var hFile = GetObjCHeaderPath(context); if (objcType == null) { context.ReportError("Missing Objective-C type: {0}", Type.ObjCName); return; } if (!objcType.IsUserType) { context.ReportError("Parsed Objective-C type '{0}' is not a user type", objcType); return; } var parsed = NSObjectInfoService.ParseHeader(hFile); if (parsed == null) { context.ReportError("Error parsing Objective-C type: {0}", Type.ObjCName); return; } if (parsed.ObjCName != objcType.ObjCName) { context.ReportError("Parsed type name '{0}' does not match original: {1}", parsed.ObjCName, objcType.ObjCName); return; } parsed.MergeCliInfo(objcType); context.TypeSyncJobs.Add(XcodeSyncObjcBackJob.UpdateType(parsed, objcType.GetDesignerFile())); }
public override void SyncBack(XcodeSyncBackContext context) { var hFile = context.ProjectDir.Combine(Type.ObjCName + ".h"); var objcType = context.ProjectInfo.GetType(Type.ObjCName); if (objcType == null) { context.ReportError("Missing objc type {0}", Type.ObjCName); return; } if (!objcType.IsUserType) { context.ReportError("Parsed type {0} is not a user type", objcType); return; } var parsed = NSObjectInfoService.ParseHeader(hFile); if (parsed == null) { context.ReportError("Error parsing objc type {0}", Type.ObjCName); return; } if (parsed.ObjCName != objcType.ObjCName) { context.ReportError("Parsed type name {0} does not match original {1}", parsed.ObjCName, objcType.ObjCName); return; } parsed.MergeCliInfo(objcType); context.TypeSyncJobs.Add(XcodeSyncObjcBackJob.UpdateType(parsed, objcType.GetDesignerFile())); }
public override void SyncBack (IProgressMonitor monitor, XcodeSyncBackContext context) { monitor.Log.WriteLine ("Queueing sync-back of changes made to the {0} class from Xcode.", Type.CliName); var objcType = context.ProjectInfo.GetType (Type.ObjCName); var hFile = GetObjCHeaderPath (context); if (objcType == null) { context.ReportError ("Missing Objective-C type: {0}", Type.ObjCName); return; } if (!objcType.IsUserType) { context.ReportError ("Parsed Objective-C type '{0}' is not a user type", objcType); return; } var parsed = NSObjectInfoService.ParseHeader (hFile); if (parsed == null) { context.ReportError ("Error parsing Objective-C type: {0}", Type.ObjCName); return; } if (parsed.ObjCName != objcType.ObjCName) { context.ReportError ("Parsed type name '{0}' does not match original: {1}", parsed.ObjCName, objcType.ObjCName); return; } parsed.MergeCliInfo (objcType); context.TypeSyncJobs.Add (XcodeSyncObjcBackJob.UpdateType (parsed, objcType.GetDesignerFile ())); }