本文整理汇总了C#中Stetic.ObjectWrapper.DropObject方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectWrapper.DropObject方法的具体用法?C# ObjectWrapper.DropObject怎么用?C# ObjectWrapper.DropObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stetic.ObjectWrapper
的用法示例。
在下文中一共展示了ObjectWrapper.DropObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Drop
// Call this from a DragDrop event to receive the dragged widget
public static void Drop(Gdk.DragContext ctx, uint time, ObjectWrapper targetWrapper, string dropData)
{
if (dropCallback == null) {
Gtk.Widget w = Drop (ctx, (Gtk.Widget) targetWrapper.Wrapped, time);
targetWrapper.DropObject (dropData, w);
return;
}
Cancel ();
Gtk.Drag.Finish (ctx, true, true, time);
Gtk.Application.Invoke (delegate {
IProject project = targetWrapper.Project;
string uid = targetWrapper.UndoId;
string tname = ((Wrapper.Widget)targetWrapper).GetTopLevel ().Wrapped.Name;
// This call may cause the project to be reloaded
dragWidget = dropCallback ();
if (dragWidget == null)
return;
if (targetWrapper.IsDisposed) {
// The project has been reloaded. Find the wrapper again.
Gtk.Widget twidget = project.GetTopLevel (tname);
ObjectWrapper ow = ObjectWrapper.Lookup (twidget);
if (ow != null)
targetWrapper = ow.FindObjectByUndoId (uid);
else
targetWrapper = null;
if (targetWrapper == null) {
// Target wrapper not found. Just ignore the drop.
return;
}
}
targetWrapper.DropObject (dropData, dragWidget);
});
}