Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Updates the updateTime on the specified note. This method deletes the mark in the
        /// undo stack. If fStartNewMark is true then a new mark is created.
        /// </summary>
        /// <param name="noteHvo">The hvo of the note to be updated, or 0 to ignore</param>
        /// ------------------------------------------------------------------------------------
        public void SetNoteUpdateTime(int noteHvo)
        {
            CheckDisposed();

            IActionHandler handler = m_fdoCache.ActionHandlerAccessor;

            if (m_fIgnoreTmStmpUpdate || handler == null || handler.CurrentDepth > 0 ||
                handler.TopMarkHandle == 0)
            {
                return;
            }

            if (!handler.get_TasksSinceMark(true))
            {
                handler.DiscardToMark(0);
            }
            else
            {
                // Can happen... just continue on
                if (noteHvo != 0 && m_fdoCache.IsValidObject(noteHvo))
                {
                    ScrScriptureNote ann = new ScrScriptureNote(m_fdoCache, noteHvo);
                    ann.DateModified = DateTime.Now;
                    m_fdoCache.PropChanged(null, PropChangeType.kpctNotifyAll, noteHvo,
                                           (int)CmAnnotation.CmAnnotationTags.kflidDateModified, 0, 1, 1);
                }

                string sUndo;
                string sRedo;
                TeResourceHelper.MakeUndoRedoLabels("kstidDiffDlgUndoRedoEditNote",
                                                    out sUndo, out sRedo);
                handler.CollapseToMark(0, sUndo, sRedo);
                // If no tasks since the mark actually change the data, they should all get
                // deleted when we collapse.
            }
        }