private void __dragEnd(EventContext evt) { if (_agent.parent == null) //cancelled { return; } GRoot.inst.RemoveChild(_agent); object sourceData = _sourceData; _sourceData = null; GObject obj = GRoot.inst.touchTarget; while (obj != null) { if (obj is GComponent) { if (!((GComponent)obj).onDrop.isEmpty) { obj.RequestFocus(); ((GComponent)obj).onDrop.Call(sourceData); return; } } obj = obj.parent; } }
private void __dragEnd(EventContext evt) { if (_agent.parent == null) //cancelled { return; } GRoot.inst.RemoveChild(_agent); object sourceData = _sourceData; _sourceData = null; GObject obj = GRoot.inst.touchTarget; while (obj != null) { if (obj.hasEventListeners("onDrop")) { obj.RequestFocus(); obj.DispatchEvent("onDrop", sourceData); return; } obj = obj.parent; } }
void __dragEnd(EventContext evt) { mAgent.visible = false; GObject obj = GRoot.inst.touchTarget; while (obj != null) { if (obj is GComponent) { bool flag = true; if (mDropTargetFunc != null) { flag = mDropTargetFunc(obj); } if (flag) { dropTarget = true; if (!((GComponent)obj).onDrop.isEmpty) { obj.RequestFocus(); ((GComponent)obj).onDrop.Call(mAgent); } mAgent.visible = false; return; } } obj = obj.parent; } }