示例#1
0
    private static void OnPackages(JSONValue jv, PackageDataSource packageDataSource)
    {
        IList <Package> allPackages         = packageDataSource.GetAllPackages();
        Dictionary <string, JSONValue> strs = jv.AsDict(false);
        string empty = string.Empty;

        allPackages.Clear();
        foreach (KeyValuePair <string, JSONValue> keyValuePair in strs)
        {
            int       num     = int.Parse(keyValuePair.Key);
            JSONValue value   = keyValuePair.Value;
            Package   package = packageDataSource.FindByID(num) ?? new Package(num);
            empty = string.Concat(empty, AssetStoreAPI.OnPackageReceived(value, package));
            empty = string.Concat(empty, AssetStoreAPI.RefreshMainAssets(value, package));
            allPackages.Add(package);
        }

        packageDataSource.OnDataReceived(empty);
    }
示例#2
0
    private static void OnPackages(JSONValue jv, PackageDataSource packageDataSource)
    {
        IList <Package> allPackages = packageDataSource.GetAllPackages();
        Dictionary <string, JSONValue> dictionary = jv.AsDict(false);
        string text = string.Empty;

        foreach (KeyValuePair <string, JSONValue> current in dictionary)
        {
            int       num     = int.Parse(current.Key);
            JSONValue value   = current.Value;
            Package   package = packageDataSource.FindByID(num);
            if (package == null)
            {
                package = new Package(num);
            }
            text += AssetStoreAPI.OnPackageReceived(value, package);
            text += AssetStoreAPI.RefreshMainAssets(value, package);
            allPackages.Add(package);
        }
        packageDataSource.OnDataReceived(text);
    }