internal static new void InvokeHandler(Delegate handler, IntPtr sender, IntPtr args) { DataObjectCopyingEventHandler handler_ = (DataObjectCopyingEventHandler)handler; if (handler_ != null) { handler_(Extend.GetProxy(sender, false), new DataObjectCopyingEventArgs(args, false)); } }
public static void RemoveCopyingHandler(DependencyObject element, DataObjectCopyingEventHandler handler) { throw new NotImplementedException(); }
/// <summary>Removes a DataObject.Copying event handler from a specified element.</summary> public static void RemoveCopyingHandler(DependencyObject d, DataObjectCopyingEventHandler handler) { ((UIElement)d).RemoveHandler(CopyingEvent, handler); }
protected override void OnInitialized(EventArgs e) { base.AllowDrop = true; base.OnInitialized(e); base.Unloaded += new RoutedEventHandler(this.InputBox_Unloaded); this.pastingEventHandler = new DataObjectPastingEventHandler(this.InputBox_Pasting); this.copyingEventHandler = new DataObjectCopyingEventHandler(this.InputBox_Copying); base.AddHandler(DataObject.PastingEvent, this.pastingEventHandler, true); base.AddHandler(DataObject.CopyingEvent, this.copyingEventHandler, true); this.clickedEventHandler = new ImageEx.ClickedEventHandler(this.InputBox_ImageClicked); base.AddHandler(ImageEx.ClickedEvent, this.clickedEventHandler, false); base.FontFamily = defaultFontFamily; base.FontSize = 12.0; this.executedRoutedEventHandler = new ExecutedRoutedEventHandler(this.ExecutedRoutedEvent); this.canExecuteRoutedEventHandler = new CanExecuteRoutedEventHandler(this.CanExecuteRoutedEvent); base.AddHandler(CommandManager.PreviewExecutedEvent, this.executedRoutedEventHandler, true); base.AddHandler(CommandManager.PreviewCanExecuteEvent, this.canExecuteRoutedEventHandler, true); }
//...................................................... // // Events for Clipboard Extensibility // //...................................................... #region Events for Clipboard Extensibility /// <summary> /// Adds a handler for the Copying attached event /// </summary> /// <param name="element">UIElement or ContentElement that listens to this event</param> /// <param name="handler"> /// A handler for DataObject.Copying event. /// The handler is expected to inspect the content of a data object /// passed via event arguments (DataObjectCopyingEventArgs.DataObject) /// and add additional (custom) data format to it. /// It's also possible for the handler to change /// the contents of other data formats already put on DataObject /// or even remove some of those formats. /// All this happens before DataObject is put on /// the Clipboard (in copy operation) or before DragDrop /// process starts. /// The handler can cancel the whole copying event /// by calling DataObjectCopyingEventArgs.CancelCommand method. /// For the case of Copy a command will be cancelled, /// for the case of DragDrop a dragdrop process will be /// terminated in the beginning. /// </param> public static void AddCopyingHandler(DependencyObject element, DataObjectCopyingEventHandler handler) { UIElement.AddHandler(element, CopyingEvent, handler); }
//------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ /// <summary> /// The mechanism used to call the type-specific handler on the target. /// </summary> /// <param name="genericHandler"> /// The generic handler to call in a type-specific way. /// </param> /// <param name="genericTarget"> /// The target to call the handler on. /// </param> protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { DataObjectCopyingEventHandler handler = (DataObjectCopyingEventHandler)genericHandler; handler(genericTarget, this); }
public static void RemoveCopyingHandler (DependencyObject element, DataObjectCopyingEventHandler handler) { throw new NotImplementedException (); }
public static void AddCopyingHandler(DependencyObject element, DataObjectCopyingEventHandler handler) { }