Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 void ITextControlCopyingToClipboardEventArgsResolver.Handled(TextControlCopyingToClipboardEventArgs e, bool handled) => e.Handled = handled;
Ejemplo n.º 3
0
 bool ITextControlCopyingToClipboardEventArgsResolver.Handled(TextControlCopyingToClipboardEventArgs e) => e.Handled;
Ejemplo n.º 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);
Ejemplo n.º 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);