예제 #1
0
        void OpenMoreInfoPopupForSelected()
        {
            var selected = GetSelectedItems();

            Assert.IsEqual(selected.Count, 1);

            var info = selected.Single();

            _asyncProcessor.Process(OpenMoreInfoPopup(info));
        }
예제 #2
0
        void DeleteSelected()
        {
            foreach (var group in _view.GetSelected().GroupBy(x => x.ListType))
            {
                switch (group.Key)
                {
                case DragListTypes.AssetItem:
                {
                    foreach (var entry in group)
                    {
                        _model.RemoveAssetItem((string)entry.Model);
                    }
                    break;
                }

                case DragListTypes.PluginItem:
                {
                    foreach (var entry in group)
                    {
                        _model.RemovePluginItem((string)entry.Model);
                    }
                    break;
                }

                case DragListTypes.Package:
                {
                    _asyncProcessor.Process(
                        _packageHandler.DeletePackages(group.Select(x => (PackageInfo)x.Model).ToList()), true, "Deleting Packages");
                    break;
                }
                }
            }
        }
예제 #3
0
 void DisplayErrorInternal(string message)
 {
     // Do not display errors on top of each other
     // In those cases it will still be in the log and that's enough
     if (!_isDisplayingError)
     {
         _asyncProcessor.Process(
             DisplayErrorInternalAsync(message));
     }
 }
예제 #4
0
 public void OnClickedProjectType(ProjectConfigTypes desiredConfigType)
 {
     _asyncProcessor.Process(
         TryChangeProjectType(desiredConfigType));
 }
예제 #5
0
 void OnContextMenuAddAsRegex()
 {
     _asyncProcessor.Process(AddAsRegexAsync());
 }
예제 #6
0
 public void Initialize()
 {
     _asyncProcessor.Process(InitializeAsync(), "Initializing Projeny");
 }
예제 #7
0
 public void OnClickedRefreshPackages()
 {
     _asyncProcessor.Process(_packageHandler.RefreshPackagesAsync(), "Refreshing Packages");
 }
예제 #8
0
 public void Initialize(bool isFirstLoad)
 {
     _asyncProcessor.Process(InitializeAsync(isFirstLoad), true, "Initializing Projeny");
 }
 public void ShowCreateNewProjectPopup()
 {
     _asyncProcessor.Process(ShowCreateNewProjectPopupAsync(), "Creating Project");
 }
예제 #10
0
        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;
            }
            }
        }