Ejemplo n.º 1
0
        /// <summary>
        /// Prevent a CTRL+V pasting when we have the Paste button disabled, e.g. when pictures are on the clipboard
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnDomKeyPress(object sender, GeckoDomKeyEventArgs e)
        {
            if (e.CtrlKey && e.KeyChar == 'v')
            {
                Debug.WriteLine("Ctrl-v pressed.");
                if (_pasteCommand == null /*happend in calendar config*/ || !_pasteCommand.Enabled)
                {
                    Debug.WriteLine("Paste not enabled, so ignoring.");
                    e.PreventDefault();
                }
                else if (_browser.CanPaste && Clipboard.ContainsText())
                {
                    e.PreventDefault();                     //we'll take it from here, thank you very much


                    PasteFilteredText();
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Prevent a CTRL+V pasting when we have the Paste button disabled, e.g. when pictures are on the clipboard
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OnDomKeyPress(object sender, GeckoDomKeyEventArgs e)
 {
     const uint DOM_VK_INSERT = 0x2D;
     if ((e.CtrlKey && e.KeyChar == 'v') || (e.ShiftKey && e.KeyCode == DOM_VK_INSERT)) //someone was using shift-insert to do the paste
     {
         if (_pasteCommand==null /*happend in calendar config*/ || !_pasteCommand.Enabled)
         {
             Debug.WriteLine("Paste not enabled, so ignoring.");
             e.PreventDefault();
         }
         else if(_browser.CanPaste && Clipboard.ContainsText())
         {
             e.PreventDefault(); //we'll take it from here, thank you very much
             PasteFilteredText();
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Prevent a CTRL+V pasting when we have the Paste button disabled, e.g. when pictures are on the clipboard
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnDomKeyPress(object sender, GeckoDomKeyEventArgs e)
        {
            if (e.CtrlKey && e.KeyChar == 'v')
            {
                Debug.WriteLine("Ctrl-v pressed.");
                if (_pasteCommand==null /*happend in calendar config*/ || !_pasteCommand.Enabled)
                {
                    Debug.WriteLine("Paste not enabled, so ignoring.");
                    e.PreventDefault();
                }
                else if(_browser.CanPaste && Clipboard.ContainsText())
                {
                    e.PreventDefault(); //we'll take it from here, thank you very much

                    PasteFilteredText();
                }
            }
        }