Пример #1
0
            public override NSDragOperation ValidateDrop(NSOutlineView outlineView, NSDraggingInfo info, NSObject item, nint index)
            {
                var h = Handler;

                if (h == null)
                {
                    return(NSDragOperation.None);
                }
                var etoInfo = GetDragInfo(info, item, index);
                var e       = h.GetDragEventArgs(info, etoInfo);

                h.Callback.OnDragOver(h.Widget, e);
                if (e.AllowedEffects.HasFlag(e.Effects))
                {
                    if (etoInfo.Position == GridDragPosition.Over)
                    {
                        outlineView.SetDropItem(h.GetCachedItem(etoInfo.Item), -1);
                    }
                    else
                    {
                        outlineView.SetDropItem(h.GetCachedItem(etoInfo.Parent), etoInfo.InsertIndex);
                    }

                    return(e.Effects.ToNS());
                }
                else
                {
                    return(NSDragOperation.None);
                }
            }