/// <summary> /// overriden to handle the special case where user hits ENTER in a paragraph. /// </summary> /// <param name="e"></param> /// <param name="modifiers"></param> /// <param name="graphics"></param> public override void OnKeyPress(KeyPressEventArgs e, Keys modifiers, IVwGraphics graphics) { RawTextPane rtp = Callbacks as RawTextPane; if (rtp == null) { return; } try { using (m_amh = new RawTextPane.AnnotationMoveHelper(rtp, e)) { if (m_amh.CanEdit()) { m_annotationAdjuster.StartKeyPressed(e, modifiers); } base.OnKeyPress(e, modifiers, graphics); // in general we don't want to reload the primary clerk // while we are editing, since that can be expensive. if (rtp.Clerk != null && rtp.Clerk.IsPrimaryClerk) { m_amh.TriggerPendingReloadOnDispose = false; // in some cases we may also want to do Clerk.RemoveInvalidItems() // to help prevent the user from crashing when they click on it. } if (m_amh.CanEdit()) { m_annotationAdjuster.EndKeyPressed(); } } } finally { m_amh = null; } }
/// <summary> /// overriden to handle the special case where user hits ENTER in a paragraph. /// </summary> /// <param name="e"></param> /// <param name="modifiers"></param> /// <param name="graphics"></param> public override void OnKeyPress(KeyPressEventArgs e, Keys modifiers, IVwGraphics graphics) { RawTextPane rtp = Callbacks as RawTextPane; if (rtp == null) return; try { using (m_amh = new RawTextPane.AnnotationMoveHelper(rtp, e)) { if (m_amh.CanEdit()) m_annotationAdjuster.StartKeyPressed(e, modifiers); base.OnKeyPress(e, modifiers, graphics); // in general we don't want to reload the primary clerk // while we are editing, since that can be expensive. if (rtp.Clerk != null && rtp.Clerk.IsPrimaryClerk) { m_amh.TriggerPendingReloadOnDispose = false; // in some cases we may also want to do Clerk.RemoveInvalidItems() // to help prevent the user from crashing when they click on it. } if (m_amh.CanEdit()) m_annotationAdjuster.EndKeyPressed(); } } finally { m_amh = null; } }