本文整理匯總了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);
});
}