/// <summary> /// Get a new FW project from some Mercurial repository. /// The repo may be a lift or full FW repo, but it can be from any source source, as long as the code can create an FW project from it. /// </summary> /// <returns>Null if the operation was cancelled or otherwise did not work. The full pathname of an fwdata file, if it did work.</returns> public static string ObtainProjectFromAnySource(Form parent, IHelpTopicProvider helpTopicProvider, out ObtainedProjectType obtainedProjectType) { bool dummy; string fwdataFileFullPathname; var success = FLExBridgeHelper.LaunchFieldworksBridge(FwDirectoryFinder.ProjectsDirectory, null, FLExBridgeHelper.Obtain, null, FDOBackendProvider.ModelVersion, "0.13", null, null, out dummy, out fwdataFileFullPathname); if (!success) { ReportDuplicateBridge(); obtainedProjectType = ObtainedProjectType.None; return null; } if (string.IsNullOrWhiteSpace(fwdataFileFullPathname)) { obtainedProjectType = ObtainedProjectType.None; return null; // user canceled. } obtainedProjectType = ObtainedProjectType.FieldWorks; if (fwdataFileFullPathname.EndsWith("lift")) { fwdataFileFullPathname = CreateProjectFromLift(parent, helpTopicProvider, fwdataFileFullPathname); obtainedProjectType = ObtainedProjectType.Lift; } EnsureLinkedFoldersExist(fwdataFileFullPathname); return fwdataFileFullPathname; }
/// <summary> /// Get a new FW project from some Mercurial repository. /// The repo may be a lift or full FW repo, but it can be from any source source, as long as the code can create an FW project from it. /// </summary> /// <returns>Null if the operation was cancelled or otherwise did not work. The full pathname of an fwdata file, if it did work.</returns> public static string ObtainProjectFromAnySource(Form parent, IHelpTopicProvider helpTopicProvider, out ObtainedProjectType obtainedProjectType) { bool dummy; string fwdataFileFullPathname; var success = FLExBridgeHelper.LaunchFieldworksBridge(FwDirectoryFinder.ProjectsDirectory, null, FLExBridgeHelper.Obtain, null, FDOBackendProvider.ModelVersion, "0.13", null, null, out dummy, out fwdataFileFullPathname); if (!success) { ReportDuplicateBridge(); obtainedProjectType = ObtainedProjectType.None; return(null); } if (string.IsNullOrWhiteSpace(fwdataFileFullPathname)) { obtainedProjectType = ObtainedProjectType.None; return(null); // user canceled. } obtainedProjectType = ObtainedProjectType.FieldWorks; if (fwdataFileFullPathname.EndsWith("lift")) { fwdataFileFullPathname = CreateProjectFromLift(parent, helpTopicProvider, fwdataFileFullPathname); obtainedProjectType = ObtainedProjectType.Lift; } EnsureLinkedFoldersExist(fwdataFileFullPathname); return(fwdataFileFullPathname); }
/// <summary> /// Get a new FW project from some Mercurial repository. /// The repo may be a lift or full FW repo, but it can be from any source source, as long as the code can create an FW project from it. /// </summary> /// <returns>Null if the operation was cancelled or otherwise did not work. The full pathname of an fwdata file, if it did work.</returns> public static string ObtainProjectFromAnySource(Form parent, IHelpTopicProvider helpTopicProvider, out ObtainedProjectType obtainedProjectType) { bool dummy; string fwdataFileFullPathname; var liftVersion = "0.13_ldml3"; var success = FLExBridgeHelper.LaunchFieldworksBridge(FwDirectoryFinder.ProjectsDirectory, null, FLExBridgeHelper.Obtain, null, LcmCache.ModelVersion, liftVersion, null, null, out dummy, out fwdataFileFullPathname); if (!success) { ReportDuplicateBridge(); obtainedProjectType = ObtainedProjectType.None; return(null); } if (string.IsNullOrWhiteSpace(fwdataFileFullPathname)) { obtainedProjectType = ObtainedProjectType.None; return(null); // user canceled. } obtainedProjectType = ObtainedProjectType.FieldWorks; if (fwdataFileFullPathname.EndsWith("lift")) { fwdataFileFullPathname = CreateProjectFromLift(parent, helpTopicProvider, fwdataFileFullPathname); obtainedProjectType = ObtainedProjectType.Lift; } UsageReporter.SendEvent("OpenProject", "SendReceive", string.Format("Create from {0} repo", obtainedProjectType.ToString()), string.Format("vers: {0}, {1}", LcmCache.ModelVersion, liftVersion), 0); EnsureLinkedFoldersExist(fwdataFileFullPathname); return(fwdataFileFullPathname); }