Ejemplo n.º 1
0
        void OnResponseV5(EditorHttpResponse response, Action <List <PackageRepository>, List <string> > onResponse)
        {
            if (response.Type == ResponseType.SUCCEED)
            {
                var responseJson =
                    JsonUtility.FromJson <QFrameworkServerResultFormat <ListPackageResponseResult> >(response.Text);

                if (responseJson.code == 1)
                {
                    var listPackageResponseResult = responseJson.data;


                    foreach (var packageRepository in listPackageResponseResult.repositories)
                    {
                        packageRepository.type = PackageTypeHelper.TryGetFullName(packageRepository.type);
                    }

                    new PackageInfosRequestCache()
                    {
                        PackageRepositories = listPackageResponseResult.repositories
                    }.Save();

                    onResponse(listPackageResponseResult.repositories, listPackageResponseResult.categories);
                }
            }
            else
            {
                onResponse(null, null);
            }
        }
Ejemplo n.º 2
0
        void UpdateCategoriesFromModel()
        {
            var categories = Model.Repositories.Select(p => p.type).Distinct()
                             .Select(t => PackageTypeHelper.TryGetFullName(t))
                             .ToList();

            categories.Insert(0, "all");
            Categories = categories;
        }