/// ------------------------------------------------------------------------------------
        /// <summary>
        /// Shows the category chooser dialog to let the user set the category for the
        /// specified annotation.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void SetAnnotationCategory(IScrScriptureNote ann)
        {
            if (ann == null)
            {
                return;                 // Not much we can do
            }
            m_rootb.DestroySelection();
            string sUndo, sRedo;

            TeResourceHelper.MakeUndoRedoLabels("kstidSetAnnotationCategory", out sUndo, out sRedo);

            using (new WaitCursor(this))
                using (CategoryChooserDlg dlg = new CategoryChooserDlg(m_scr.NoteCategoriesOA,
                                                                       ann.CategoriesRS.ToHvoArray(), m_helpTopicProvider, TheMainWnd.App))
                {
                    if (dlg.ShowDialog(ParentForm) == DialogResult.OK)
                    {
                        using (UndoTaskHelper undoHelper = new UndoTaskHelper(this, sUndo, sRedo))
                        {
                            dlg.GetPossibilities(ann.CategoriesRS);
                            ann.DateModified    = DateTime.Now;
                            undoHelper.RollBack = false;
                        }
                    }
                }
        }
Exemple #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Shows the category chooser dialog to let the user set the category for the
        /// specified annotation.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void SetAnnotationCategory(ScrScriptureNote ann)
        {
            if (ann == null)
            {
                return;                 // Not much we can do
            }
            m_rootb.DestroySelection();
            string sUndo, sRedo;

            TeResourceHelper.MakeUndoRedoLabels("kstidSetAnnotationCategory", out sUndo, out sRedo);

            using (new UndoTaskHelper(this, sUndo, sRedo, true))
                using (new WaitCursor(this))
                    using (CategoryChooserDlg dlg =
                               new CategoryChooserDlg(m_scr.NoteCategoriesOA, ann.CategoriesRS.HvoArray))
                    {
                        if (dlg.ShowDialog(ParentForm) == DialogResult.OK &&
                            !dlg.GetPossibilities(ann.CategoriesRS))
                        {
                            ann.DateModified = DateTime.Now;
                        }
                    }
        }
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Shows the category chooser dialog to let the user set the category for the
		/// specified annotation.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void SetAnnotationCategory(IScrScriptureNote ann)
		{
			if (ann == null)
				return; // Not much we can do

			m_rootb.DestroySelection();
			string sUndo, sRedo;
			TeResourceHelper.MakeUndoRedoLabels("kstidSetAnnotationCategory", out sUndo, out sRedo);

			using (new WaitCursor(this))
			using (CategoryChooserDlg dlg = new CategoryChooserDlg(m_scr.NoteCategoriesOA,
				ann.CategoriesRS.ToHvoArray(), m_helpTopicProvider, TheMainWnd.App))
			{
				if (dlg.ShowDialog(ParentForm) == DialogResult.OK)
				{
					using (UndoTaskHelper undoHelper = new UndoTaskHelper(this, sUndo, sRedo))
					{
						dlg.GetPossibilities(ann.CategoriesRS);
						ann.DateModified = DateTime.Now;
						undoHelper.RollBack = false;
					}
				}
			}
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Shows the category chooser dialog to let the user set the category for the
		/// specified annotation.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void SetAnnotationCategory(ScrScriptureNote ann)
		{
			if (ann == null)
				return; // Not much we can do

			m_rootb.DestroySelection();
			string sUndo, sRedo;
			TeResourceHelper.MakeUndoRedoLabels("kstidSetAnnotationCategory", out sUndo, out sRedo);

			using (new UndoTaskHelper(this, sUndo, sRedo, true))
			using (new WaitCursor(this))
			using (CategoryChooserDlg dlg =
				new CategoryChooserDlg(m_scr.NoteCategoriesOA, ann.CategoriesRS.HvoArray))
			{
				if (dlg.ShowDialog(ParentForm) == DialogResult.OK &&
					!dlg.GetPossibilities(ann.CategoriesRS))
				{
					ann.DateModified = DateTime.Now;
				}
			}
		}