Ejemplo n.º 1
0
		protected bool OnFileExportUsfmParatext(object args)
		{
			AdjustScriptureAnnotations();

			ScrText assocProj = ParatextHelper.GetAssociatedProject(Cache.ProjectId);
			if (assocProj != null)
			{
				MessageBox.Show(this, String.Format(TeResourceHelper.GetResourceString("kstidParatextExportNotAvailable"),
					assocProj.JoinedNameAndFullName), FwUtils.ksTeAppName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				return true;
			}

			using (ExportPtxDialog dlg = new ExportPtxDialog(m_cache, m_bookFilter,
				m_app.ProjectSpecificSettingsKey, m_app, m_app))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					using (ExportUsfm exporter = new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec,
						m_app, dlg.FileNameFormat))
					{
						exporter.OverwriteWithoutAsking = dlg.OverwriteConfirmed;
						exporter.MarkupSystem = MarkupType.Paratext;
						exporter.ExportScriptureDomain = dlg.ExportScriptureDomain;
						exporter.ExportBackTranslationDomain = dlg.ExportBackTranslationDomain;
						if (exporter.ExportBackTranslationDomain)
							exporter.RequestedAnalysisWss = dlg.RequestedAnalWs;
						exporter.ExportNotesDomain = dlg.ExportNotesDomain;
						exporter.ParatextProjectShortName = dlg.ShortName;
						exporter.ParatextProjectFolder = dlg.ParatextProjectFolder;
						exporter.Run(this);
					}
				}
			}
			return true;
		}
Ejemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handle the File/Export/Usfm Paratext menu command
		/// </summary>
		/// <param name="args"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		protected bool OnFileExportUsfmParatext(object args)
		{
			AdjustScriptureAnnotations();
			using (ExportPtxDialog dlg = new ExportPtxDialog(m_cache, m_bookFilter,
					   SettingsKeyEx))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					using (ExportUsfm exporter = new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec,
								dlg.FileNameFormat))
					{
						exporter.OverwriteWithoutAsking = dlg.OverwriteConfirmed;
						exporter.MarkupSystem = MarkupType.Paratext;
						exporter.ExportScriptureDomain = dlg.ExportScriptureDomain;
						exporter.ExportBackTranslationDomain = dlg.ExportBackTranslationDomain;
						if (exporter.ExportBackTranslationDomain)
							exporter.RequestedAnalysisWss = dlg.RequestedAnalWs;
						exporter.ExportNotesDomain = dlg.ExportNotesDomain;
						exporter.ParatextProjectShortName = dlg.ShortName;
						exporter.ParatextProjectFolder = dlg.ParatextProjectFolder;
						exporter.Run();
					}
				}
			}
			return true;
		}