Example #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles OnKeyPress to remove any formatting before passing the keystroke along. This
        /// prevents the gray background used for ORC strings from bleeding over into literal
        /// text.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void OnKeyPress(KeyPressEventArgs e)
        {
            if (EditingHelper == null)
            {
                return;
            }

            IVwSelection vwsel;

            ITsTextProps[]     vttp;
            IVwPropertyStore[] vvps;
            if (!EditingHelper.GetCharacterProps(out vwsel, out vttp, out vvps))
            {
                return;
            }

            EditingHelper.RemoveCharFormatting(vwsel, ref vttp, null, true);
            base.OnKeyPress(e);
        }