public void OpenContextMenu(DragList dropList) { var itemGetter = _contextMenuHandlers.TryGetValue(dropList.ListType); if (itemGetter != null) { ImguiUtil.OpenContextMenu(itemGetter()); } }
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 List <DragListEntry> SortList(DragList list, List <DragListEntry> entries) { return(entries.OrderBy(x => x.Name).ToList()); //switch (list.ListType) //{ //case DragListTypes.Release: //{ //} //default: //{ //return entries.OrderBy(x => x.Name).ToList(); //} //} }
public PmView( Model model, PmSettings settings) { _settings = settings.View; _pmSettings = settings; _model = model; for (int i = 0; i < (int)DragListTypes.Count; i++) { var list = new DragList( this, (DragListTypes)i, _model.ListModels[i], settings); _lists.Add(list); } }
public PmView( Model model, PmSettings settings) { _settings = settings.View; _pmSettings = settings; _model = model; for (int i = 0; i < (int)DragListTypes.Count; i++) { Assert.That(i <= _model.ListModels.Count - 1, "Could not find drag list type '{0}' in model", (DragListTypes)i); var list = new DragList( this, (DragListTypes)i, _model.ListModels[i], settings); _lists.Add(list); } }
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); }
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; }
public List<DragListEntry> SortList(DragList list, List<DragListEntry> entries) { return entries.OrderBy(x => x.Name).ToList(); //switch (list.ListType) //{ //case DragListTypes.Release: //{ //} //default: //{ //return entries.OrderBy(x => x.Name).ToList(); //} //} }