public void OnDragDrop(DragList.DragData data, DragList dropList) { if (data.SourceList == dropList || !IsDragAllowed(data, dropList)) { return; } var sourceListType = data.SourceList.ListType; var dropListType = dropList.ListType; DraggedDroppedListEntries(sourceListType, dropListType, data.Entries); }
public bool IsDragAllowed(DragList.DragData data, DragList list) { var sourceListType = data.SourceList.ListType; var dropListType = list.ListType; if (sourceListType == dropListType) { return(true); } switch (dropListType) { case DragListTypes.Package: { return(sourceListType == DragListTypes.Release || sourceListType == DragListTypes.AssetItem || sourceListType == DragListTypes.PluginItem); } case DragListTypes.Release: { return(false); } case DragListTypes.AssetItem: { return(sourceListType == DragListTypes.Package || sourceListType == DragListTypes.PluginItem); } case DragListTypes.PluginItem: { return(sourceListType == DragListTypes.Package || sourceListType == DragListTypes.AssetItem); } case DragListTypes.VsSolution: { return(sourceListType == DragListTypes.AssetItem || sourceListType == DragListTypes.PluginItem); } } Assert.Throw(); return(true); }