SIL.FieldWorks.Common.Controls.ObtainProjectMethod.CreateProjectFromLift C# (CSharp) Method

CreateProjectFromLift() private static method

Create a new Fieldworks project and import a lift file into it. Return the .fwdata path.
private static CreateProjectFromLift ( Form parent, IHelpTopicProvider helpTopicProvider, string liftPath ) : string
parent System.Windows.Forms.Form
helpTopicProvider IHelpTopicProvider
liftPath string
return string
		private static string CreateProjectFromLift(Form parent, IHelpTopicProvider helpTopicProvider, string liftPath)
		{
			string projectPath;
			FdoCache cache;

			var anthroListFile = CallPickAnthroList(helpTopicProvider);

			using (var progressDlg = new ProgressDialogWithTask(parent))
			{
				progressDlg.Title = FwControls.ksCreatingLiftProject;
				var cacheReceiver = new FdoCache[1]; // a clumsy way of handling an out parameter, consistent with RunTask
				projectPath = (string)progressDlg.RunTask(true, CreateProjectTask,
					new object[] { liftPath, parent, anthroListFile, cacheReceiver });
				cache = cacheReceiver[0];
			}

			CallImportObtainedLexicon(cache, liftPath, parent);

			ProjectLockingService.UnlockCurrentProject(cache); // finish all saves and completely write the file so we can proceed to open it
			cache.Dispose();

			return projectPath;
		}