コード例 #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Prepare for and perform the OXES import.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 protected void ImportXml()
 {
     // Prevent creation of unnecessary multiple undo tasks.
     using (new SuppressSubTasks(m_cache))
     {
         // Display ImportDialog
         using (ImportXmlDialog importDlg = new ImportXmlDialog(m_cache))
         {
             importDlg.ShowDialog(m_mainWnd);
             if (importDlg.DialogResult == DialogResult.Cancel)
             {
                 Logger.WriteEvent("User canceled import XML dialog");
                 return;
             }
             m_sOXESFile = importDlg.FileName;
         }
         // Encouraging backup is always a good idea!
         if (!m_importCallbacks.EncourageBackup())
         {
             Logger.WriteEvent("Import XML canceled in encourage backup dialog");
             return;
         }
     }
     DoImport(null, "ImportXml");
 }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Prepare for and perform the OXES import.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected void ImportXml()
        {
            // Prevent creation of unnecessary multiple undo tasks.
            // Display ImportDialog
            using (var importDlg = new ImportXmlDialog(m_cache, m_helpTopicProvider))
            {
                importDlg.ShowDialog(m_mainWnd);
                if (importDlg.DialogResult == DialogResult.Cancel)
                {
                    Logger.WriteEvent("User canceled import XML dialog");
                    return;
                }
                m_sOXESFile = importDlg.FileName;
            }

            DoImport(null, "ImportXml");
        }
コード例 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Prepare for and perform the OXES import.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected void ImportXml()
		{
			// Prevent creation of unnecessary multiple undo tasks.
			// Display ImportDialog
			using (var importDlg = new ImportXmlDialog(m_cache, m_helpTopicProvider))
			{
				importDlg.ShowDialog(m_mainWnd);
				if (importDlg.DialogResult == DialogResult.Cancel)
				{
					Logger.WriteEvent("User canceled import XML dialog");
					return;
				}
				m_sOXESFile = importDlg.FileName;
			}

			DoImport(null, "ImportXml");
		}
コード例 #4
0
ファイル: TeImportManager.cs プロジェクト: sillsdev/WorldPad
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Prepare for and perform the OXES import.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected void ImportXml()
		{
			// Prevent creation of unnecessary multiple undo tasks.
			using (new SuppressSubTasks(m_cache))
			{
				// Display ImportDialog
				using (ImportXmlDialog importDlg = new ImportXmlDialog(m_cache))
				{
					importDlg.ShowDialog(m_mainWnd);
					if (importDlg.DialogResult == DialogResult.Cancel)
					{
						Logger.WriteEvent("User canceled import XML dialog");
						return;
					}
					m_sOXESFile = importDlg.FileName;
				}
				// Encouraging backup is always a good idea!
				if (!m_importCallbacks.EncourageBackup())
				{
					Logger.WriteEvent("Import XML canceled in encourage backup dialog");
					return;
				}
			}
			DoImport(null, "ImportXml");
		}