private async void OnPaste(object sender, PasteEventArgs e)
 {
     if (OwnerEditor.AutoFormat)
     {
         await OwnerEditor.FormatText();
     }
 }
Example #2
0
 protected void OnPasteTriggered(PasteEventArgs e)
 {
     if (OnPaste != null)
     {
         OnPaste(this, e);
     }
 }
Example #3
0
        protected virtual void OnPasteRejected(PasteEventArgs e)
        {
            EventHandler <PasteEventArgs> handler = PasteRejected;

            if (handler != null)
            {
                handler(this, e);
            }
        }
    protected internal void RaiseOnPaste(PasteEventArgs e)
    {
        if (IsLockEvents)
        {
            return;
        }
        var handler = (PasteEventHandler)Events[EventPaste];

        handler?.Invoke(GetEventSender(), e);
    }
 protected override void WndProc(ref Message msg)
 {
     if (msg.Msg == WM_PASTE)
     {
         var e = new PasteEventArgs();
         OnPaste?.Invoke(this, e);
         if (e.Cancel)
         {
             return;
         }
     }
     base.WndProc(ref msg);
 }
Example #6
0
 protected override void WndProc(ref Message m)
 {
     if (m.Msg == WM_PASTE)
     {
         PasteEventArgs e = CheckPasteValid();
         if (e.RejectReason != PasteRejectReasons.Accepted)
         {
             m.Result = IntPtr.Zero;
             OnPasteRejected(e);
             return;
         }
     }
     base.WndProc(ref m);
 }
 private void PasteHandlerMaskBox_OnPaste(object sender, PasteEventArgs e) => Properties.RaiseOnPaste(e);
 /// <summary>
 /// Raises the PasteRejected event.
 /// </summary>
 /// <param name="e">Event arguments.</param>
 protected virtual void OnPasteRejected(PasteEventArgs e)
 {
     EventHandler<PasteEventArgs> handler = PasteRejected;
     if (handler != null)
         handler(this, e);
 }
 protected void OnPasteTriggered(PasteEventArgs e)
 {
     if (OnPaste != null)
         OnPaste(this, e);
 }