UnityEditor.AssetStoreContext.GetPackageList C# (CSharp) Method

GetPackageList() public method

public GetPackageList ( ) : PackageList
return PackageList
        public PackageList GetPackageList()
        {
            Dictionary<string, Package> dictionary = new Dictionary<string, Package>();
            foreach (PackageInfo info in PackageInfo.GetPackageList())
            {
                Package package = new Package();
                if (info.jsonInfo == string.Empty)
                {
                    package.title = Path.GetFileNameWithoutExtension(info.packagePath);
                    package.id = info.packagePath;
                    if (this.IsBuiltinStandardAsset(info.packagePath))
                    {
                        LabelAndId id = new LabelAndId {
                            label = "Unity Technologies",
                            id = "1"
                        };
                        package.publisher = id;
                        id = new LabelAndId {
                            label = "Prefab Packages",
                            id = "4"
                        };
                        package.category = id;
                        package.version = "3.5.0.0";
                    }
                }
                else
                {
                    JSONValue json = JSONParser.SimpleParse(info.jsonInfo);
                    if (json.IsNull())
                    {
                        continue;
                    }
                    package.Initialize(json);
                    if (package.id == null)
                    {
                        JSONValue value3 = json.Get("link.id");
                        if (!value3.IsNull())
                        {
                            package.id = value3.AsString();
                        }
                        else
                        {
                            package.id = info.packagePath;
                        }
                    }
                }
                package.local_icon = info.iconURL;
                package.local_path = info.packagePath;
                if (((!dictionary.ContainsKey(package.id) || (dictionary[package.id].version_id == null)) || (dictionary[package.id].version_id == "-1")) || (((package.version_id != null) && (package.version_id != "-1")) && (int.Parse(dictionary[package.id].version_id) <= int.Parse(package.version_id))))
                {
                    dictionary[package.id] = package;
                }
            }
            Package[] packageArray = dictionary.Values.ToArray<Package>();
            return new PackageList { results = packageArray };
        }