예제 #1
0
        public void CopyPlainTextToWindowsClipboard(TextControlCopyingToClipboardEventArgs args)
        {
            if (args != null)
            {
                args.Handled = true;
            }

            DataPackage dataPackage = new DataPackage {
                RequestedOperation = DataPackageOperation.Copy
            };

            dataPackage.SetText(Document.Selection.Text);
            Clipboard.SetContent(dataPackage);
        }
예제 #2
0
 void ITextControlCopyingToClipboardEventArgsResolver.Handled(TextControlCopyingToClipboardEventArgs e, bool handled) => e.Handled = handled;
예제 #3
0
 bool ITextControlCopyingToClipboardEventArgsResolver.Handled(TextControlCopyingToClipboardEventArgs e) => e.Handled;
예제 #4
0
 /// <summary>
 /// Sets a value that marks the routed event as handled.
 /// A <c>true</c> value for Handled prevents most handlers along the event route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="TextControlCopyingToClipboardEventArgs"/>.</param>
 /// <param name="handled">
 /// <c>true</c> to mark the routed event handled.
 /// <c>false</c> to leave the routed event unhandled, which causes the default copy action to be performed.
 /// The default is <c>false</c>.
 /// </param>
 public static void Handled(this TextControlCopyingToClipboardEventArgs e, bool handled) => Resolver.Handled(e, handled);
예제 #5
0
 /// <summary>
 /// Gets a value that marks the routed event as handled.
 /// A <c>true</c> value for Handled prevents most handlers along the event route from handling the same event again.
 /// </summary>
 /// <param name="e">The requested <see cref="TextControlCopyingToClipboardEventArgs"/>.</param>
 /// <returns>
 /// <c>true</c> to mark the routed event handled.
 /// <c>false</c> to leave the routed event unhandled, which causes the default copy action to be performed.
 /// The default is <c>false</c>.
 /// </returns>
 public static bool Handled(this TextControlCopyingToClipboardEventArgs e) => Resolver.Handled(e);