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; }
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>(); }); }
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; }