Summary description for InterlinearExportDialog.
Inheritance: SIL.FieldWorks.XWorks.ExportDialog
Esempio n. 1
0
        public bool OnExportInterlinear(object argument)
        {
            // If the currently selected text is from Scripture, then we need to give the dialog
            // the list of Scripture texts that have been selected for interlinearization.
            var parent = Parent;

            while (parent != null && !(parent is InterlinMaster))
            {
                parent = parent.Parent;
            }
            var master = parent as InterlinMaster;

            if (master != null)
            {
                var clerk = master.Clerk as InterlinearTextsRecordClerk;
                if (clerk != null)
                {
                    clerk.GetScriptureIds();                     // initialize the InterestingTextList to include Scripture (prevent a crash trying later)
                }
            }
            bool      fFocusBox = TryHideFocusBoxAndUninstall();
            ICmObject objRoot   = m_objRepo.GetObject(m_hvoRoot);

            using (var dlg = new InterlinearExportDialog(m_mediator, m_propertyTable, objRoot, m_vc))
            {
                dlg.ShowDialog(this);
            }
            if (fFocusBox)
            {
                CreateFocusBox();
            }

            return(true);            // we handled this
        }
        public bool OnExportInterlinear(object argument)
        {
            // If the currently selected text is from Scripture, then we need to give the dialog
            // the list of Scripture texts that have been selected for interlinearization.
            var parent = this.Parent;

            while (parent != null && !(parent is InterlinMaster))
            {
                parent = parent.Parent;
            }
            var           master       = parent as InterlinMaster;
            var           selectedObjs = new List <ICmObject>();
            IBookImporter bookImporter = null;

            if (master != null)
            {
                bookImporter = master.Clerk as IBookImporter;
                var clerk = master.Clerk as InterlinearTextsRecordClerk;
                if (clerk != null)
                {
                    foreach (int hvo in clerk.GetScriptureIds())
                    {
                        selectedObjs.Add(m_objRepo.GetObject(hvo));
                    }
                }
            }
            //AnalysisOccurrence analOld = OccurrenceContainingSelection();
            bool      fFocusBox = TryHideFocusBoxAndUninstall();
            ICmObject objRoot   = m_objRepo.GetObject(m_hvoRoot);

            using (var dlg = new InterlinearExportDialog(m_mediator, objRoot, m_vc, bookImporter))
            {
                dlg.ShowDialog(this);
            }
            if (fFocusBox)
            {
                CreateFocusBox();
                //int hvoAnalysis = m_fdoCache.MainCacheAccessor.get_ObjectProp(oldAnnotation, CmAnnotationTags.kflidInstanceOf);
                //TriggerAnnotationSelected(oldAnnotation, hvoAnalysis, false);
            }

            return(true);            // we handled this
        }
		public bool OnExportInterlinear(object argument)
		{
			// If the currently selected text is from Scripture, then we need to give the dialog
			// the list of Scripture texts that have been selected for interlinearization.
			var parent = Parent;
			while (parent != null && !(parent is InterlinMaster))
				parent = parent.Parent;
			var master = parent as InterlinMaster;
			IBookImporter bookImporter = null;
			if (master != null)
			{
				bookImporter = master.Clerk as IBookImporter;
				var clerk = master.Clerk as InterlinearTextsRecordClerk;
				if (clerk != null)
				{
					clerk.GetScriptureIds(); // initialize the InterestingTextList to include Scripture (prevent a crash trying later)
				}
			}
			bool fFocusBox = TryHideFocusBoxAndUninstall();
			ICmObject objRoot = m_objRepo.GetObject(m_hvoRoot);
			using (var dlg = new InterlinearExportDialog(m_mediator, objRoot, m_vc, bookImporter))
			{
				dlg.ShowDialog(this);
			}
			if (fFocusBox)
			{
				CreateFocusBox();
			}

			return true; // we handled this
		}
Esempio n. 4
0
		public bool OnExportInterlinear(object argument)
		{
			// If the currently selected text is from Scripture, then we need to give the dialog
			// the list of Scripture texts that have been selected for interlinearization.
			Control parent = this.Parent;
			while (parent != null && !(parent is InterlinMaster))
				parent = parent.Parent;
			InterlinMaster master = parent as InterlinMaster;
			List<int> selectedHvos = null;
			if (master != null)
			{
				InterlinearTextsRecordClerk clerk = master.Clerk as InterlinearTextsRecordClerk;
				if (clerk != null)
					selectedHvos = clerk.GetScriptureIds();
			}
			int oldAnnotation = HvoAnnotation;
			HideAndDestroyFocusBox(true);
			using (InterlinearExportDialog dlg = new InterlinearExportDialog(m_mediator, m_hvoRoot, m_vc, selectedHvos))
			{
				dlg.ShowDialog(this);
			}
			if (oldAnnotation != 0)
			{
				int hvoAnalysis = m_fdoCache.MainCacheAccessor.get_ObjectProp(oldAnnotation, (int)CmAnnotation.CmAnnotationTags.kflidInstanceOf);
				TriggerAnnotationSelected(oldAnnotation, hvoAnalysis, false);
			}

			return true; // we handled this
		}