public DragList( PmView manager, DragListTypes listType, Model model, PmSettings pmSettings) { _model = model; _manager = manager; _listType = listType; _settings = pmSettings.DragList; _pmSettings = pmSettings; }
public DragList( PmView manager, DragListTypes listType, Model model, PmSettings pmSettings) { _model = model; _manager = manager; _listType = listType; _settings = pmSettings.DragList; _pmSettings = pmSettings; }
public void ClearOtherListSelected(DragListTypes type) { foreach (var list in _lists) { if (list.ListType != type) { list.ClearSelected(); } } }
public DragList GetList(DragListTypes listType) { return(_lists[(int)listType]); }
public void SetListItems( DragListTypes listType, List <DragList.ItemDescriptor> items) { GetList(listType).SetItems(items); }
public List <DragListEntry> GetSelected(DragListTypes listType) { return(GetSelected().Where(x => x.ListType == listType).ToList()); }
public void RemoveContextMenuHandler(DragListTypes listType) { _contextMenuHandlers.RemoveWithConfirm(listType); }
public void AddContextMenuHandler(DragListTypes listType, Func <IEnumerable <ContextMenuItem> > handler) { _contextMenuHandlers.Add(listType, handler); }
void OnDraggedDroppedListEntries(DragListTypes sourceType, DragListTypes dropType, List<DragListEntry> entries) { switch (dropType) { case DragListTypes.Package: { switch (sourceType) { case DragListTypes.PluginItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemovePluginItem(name); } break; } case DragListTypes.AssetItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemoveAssetItem(name); } break; } case DragListTypes.Release: { _asyncProcessor.Process( InstallReleasesAsync( entries.Select(x => (ReleaseInfo)x.Model).ToList()), true, "Installing Releases"); break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.PluginItem: { switch (sourceType) { case DragListTypes.AssetItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemoveAssetItem(name); _model.AddPluginItem(name); } break; } case DragListTypes.PluginItem: { // Do nothing break; } case DragListTypes.Package: { foreach (var entry in entries) { var info = (PackageInfo)entry.Model; if (!_model.HasPluginItem(info.Name)) { if (_model.HasAssetItem(info.Name)) { _model.RemoveAssetItem(info.Name); } _model.AddPluginItem(info.Name); } } break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.AssetItem: { switch (sourceType) { case DragListTypes.AssetItem: { // Do nothing break; } case DragListTypes.PluginItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemovePluginItem(name); _model.AddAssetItem(name); } break; } case DragListTypes.Package: { foreach (var entry in entries) { var info = (PackageInfo)entry.Model; if (!_model.HasAssetItem(info.Name)) { if (_model.HasPluginItem(info.Name)) { _model.RemovePluginItem(info.Name); } _model.AddAssetItem(info.Name); } } break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.Release: { // nothing can drag to releases break; } case DragListTypes.VsSolution: { if (sourceType == DragListTypes.AssetItem || sourceType == DragListTypes.PluginItem) { foreach (var entry in entries) { var name = (string)entry.Model; if (!_model.HasVsProject(name)) { _model.AddVsProject(name); } } } break; } default: { Assert.Throw(); break; } } }
public DragList GetList(DragListTypes listType) { return _lists[(int)listType]; }
void OnDraggedDroppedListEntries(DragListTypes sourceType, DragListTypes dropType, List <DragListEntry> entries) { switch (dropType) { case DragListTypes.Package: { switch (sourceType) { case DragListTypes.PluginItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemovePluginItem(name); } break; } case DragListTypes.AssetItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemoveAssetItem(name); } break; } case DragListTypes.Release: { _asyncProcessor.Process( InstallReleasesAsync( entries.Select(x => (ReleaseInfo)x.Model).ToList()), true, "Installing Releases"); break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.PluginItem: { switch (sourceType) { case DragListTypes.AssetItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemoveAssetItem(name); _model.AddPluginItem(name); } break; } case DragListTypes.PluginItem: { // Do nothing break; } case DragListTypes.Package: { foreach (var entry in entries) { var info = (PackageInfo)entry.Model; if (!_model.HasPluginItem(info.Name)) { if (_model.HasAssetItem(info.Name)) { _model.RemoveAssetItem(info.Name); } _model.AddPluginItem(info.Name); } } break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.AssetItem: { switch (sourceType) { case DragListTypes.AssetItem: { // Do nothing break; } case DragListTypes.PluginItem: { foreach (var entry in entries) { var name = (string)entry.Model; _model.RemovePluginItem(name); _model.AddAssetItem(name); } break; } case DragListTypes.Package: { foreach (var entry in entries) { var info = (PackageInfo)entry.Model; if (!_model.HasAssetItem(info.Name)) { if (_model.HasPluginItem(info.Name)) { _model.RemovePluginItem(info.Name); } _model.AddAssetItem(info.Name); } } break; } default: { Assert.Throw(); break; } } break; } case DragListTypes.Release: { // nothing can drag to releases break; } case DragListTypes.VsSolution: { if (sourceType == DragListTypes.AssetItem || sourceType == DragListTypes.PluginItem) { foreach (var entry in entries) { var name = (string)entry.Model; if (!_model.HasVsProject(name)) { _model.AddVsProject(name); } } } break; } default: { Assert.Throw(); break; } } }
public void SetListItems( DragListTypes listType, List<DragList.ItemDescriptor> items) { GetList(listType).SetItems(items); }
public void ClearOtherListSelected(DragListTypes type) { foreach (var list in _lists) { if (list.ListType != type) { list.ClearSelected(); } } }
public List<DragListEntry> GetSelected(DragListTypes listType) { return GetSelected().Where(x => x.ListType == listType).ToList(); }
public void RemoveContextMenuHandler(DragListTypes listType) { _contextMenuHandlers.RemoveWithConfirm(listType); }
public void AddContextMenuHandler(DragListTypes listType, Func<IEnumerable<ContextMenuItem>> handler) { _contextMenuHandlers.Add(listType, handler); }