Пример #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handle the File/Export/Usfm Toolbox menu command
		/// </summary>
		/// <param name="args"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		protected bool OnFileExportUsfmToolbox(object args)
		{
			AdjustScriptureAnnotations();
			using (ExportTbxDialog dlg = new ExportTbxDialog(m_cache, m_bookFilter,
				m_app.ProjectSpecificSettingsKey, m_app, m_app))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					using (ExportUsfm exporter = dlg.ExportSplitByBook ?
						new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec, m_app, dlg.FileNameFormat) :
						new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec, m_app))
					{
						exporter.MarkupSystem = MarkupType.Toolbox;
						exporter.ExportScriptureDomain = dlg.ExportScriptureDomain;
						exporter.ExportBackTranslationDomain = dlg.ExportBackTranslationDomain;
						exporter.ExportNotesDomain = dlg.ExportNotesDomain;
						exporter.RequestedAnalysisWss = dlg.RequestedAnalWs;
						Application.DoEvents(); // REVIEW (TimS): why is this here?
						exporter.Run(this);
					}
				}
			}
			return true;
		}
Пример #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handle the File/Export/Usfm Toolbox menu command
		/// </summary>
		/// <param name="args"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		protected bool OnFileExportUsfmToolbox(object args)
		{
			AdjustScriptureAnnotations();
			using (ExportTbxDialog dlg = new ExportTbxDialog(m_cache, m_bookFilter, SettingsKeyEx))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					ExportUsfm exporter = null;
					try
					{
						if (!dlg.ExportSplitByBook)
						{
							exporter = new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec);
						}
						else
						{
							exporter = new ExportUsfm(m_cache, m_bookFilter, dlg.OutputSpec,
								dlg.FileNameFormat);
						}
						exporter.MarkupSystem = MarkupType.Toolbox;
						exporter.ExportScriptureDomain = dlg.ExportScriptureDomain;
						exporter.ExportBackTranslationDomain = dlg.ExportBackTranslationDomain;
						exporter.ExportNotesDomain = dlg.ExportNotesDomain;
						exporter.RequestedAnalysisWss = dlg.RequestedAnalWs;
						Application.DoEvents();
						exporter.Run();
					}
					finally
					{
						if (exporter != null)
						{
							exporter.Dispose();
							exporter = null;
						}
					}
				}
			}
			return true;
		}