Exemple #1
0
        public void Execute()
        {
            var model = PackageManagerConfig.GetModel <IPackageManagerModel>();

            var categories = model.Repositories.Select(p => p.type).Distinct()
                             .Select(t => PackageTypeHelper.TryGetFullName(t))
                             .ToList();

            categories.Insert(0, "all");
            PackageManagerState.Categories.Value = categories;
        }
Exemple #2
0
        public void Execute()
        {
            var model  = PackageManagerConfig.GetModel <IPackageManagerModel>();
            var server = PackageManagerConfig.GetModel <IPackageManagerServer>();

            PackageManagerState.PackageRepositories.Value = model.Repositories.OrderBy(p => p.name).ToList();
            PackageManagerConfig.SendCommand <UpdateCategoriesFromModelCommand>();

            server.GetAllRemotePackageInfoV5((list, categories) =>
            {
                model.Repositories = list.OrderBy(p => p.name).ToList();
                PackageManagerState.PackageRepositories.Value = model.Repositories;
                PackageManagerConfig.SendCommand <UpdateCategoriesFromModelCommand>();
            });
        }
Exemple #3
0
        public void Execute()
        {
            var model            = PackageManagerConfig.GetModel <IPackageManagerModel>();
            var categoryIndex    = PackageManagerState.CategoryIndex.Value;
            var categories       = PackageManagerState.Categories.Value;
            var accessRightIndex = PackageManagerState.AccessRightIndex.Value;

            var repositories = model
                               .Repositories
                               .Where(p => p.name.ToLower().Contains(mKey))
                               .Where(p => categoryIndex == 0 || p.type.ToString() == categories[categoryIndex])
                               .Where(p => accessRightIndex == 0 ||
                                      accessRightIndex == 1 && p.accessRight == "public" ||
                                      accessRightIndex == 2 && p.accessRight == "private"
                                      )
                               .OrderBy(p => p.name)
                               .ToList();

            PackageManagerState.PackageRepositories.Value = repositories;
        }