Example #1
0
        public void OpenContextMenu(DragList dropList)
        {
            var itemGetter = _contextMenuHandlers.TryGetValue(dropList.ListType);

            if (itemGetter != null)
            {
                ImguiUtil.OpenContextMenu(itemGetter());
            }
        }
Example #2
0
        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);
        }
Example #3
0
 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();
     //}
     //}
 }
Example #4
0
        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);
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
        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);
            }
        }
Example #7
0
        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);
            }
        }
Example #8
0
        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);
        }
Example #9
0
        public void OpenContextMenu(DragList dropList)
        {
            var itemGetter = _contextMenuHandlers.TryGetValue(dropList.ListType);

            if (itemGetter != null)
            {
                ImguiUtil.OpenContextMenu(itemGetter());
            }
        }
Example #10
0
        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);
        }
Example #11
0
        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;
        }
Example #12
0
 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();
         //}
     //}
 }