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; } }
private void __dragEnd(EventContext evt) { if (_agent.parent == null) //cancelled { return; } var source = _source; object sourceData = _sourceData; GObject obj = GRoot.inst.touchTarget; while (obj != null) { if (obj is GComponent) { if (!((GComponent)obj).onDrop.isEmpty) { obj.RequestFocus(); ((GComponent)obj).onDrop.Call(sourceData, source); break; } } obj = obj.parent; } _agent.RemoveChild(_source, true); GRoot.inst.RemoveChild(_agent); _source = null; _sourceData = null; }
private void __dragEnd(EventContext evt) { if (_agent.parent == null) //cancelled { return; } GRoot.inst.RemoveChild(_agent); object sourceData = _sourceData; _sourceData = null; GObject obj = GRoot.inst.objectUnderMouse; while (obj != null) { EventListener listener = obj.GetEventListener(DROP_EVENT); if (listener != null) { obj.RequestFocus(); listener.Call(sourceData); return; } obj = obj.parent; } }