bool Download(string identifier, string name, string next,
                      ref byte[] data, Action <string> setStatus)
        {
            DownloadedItem item;

            if (downloader.TryGetItem(identifier, out item))
            {
                Console.WriteLine("got resource " + identifier);
                if (item.Data == null)
                {
                    setStatus("&cFailed to download " + name);
                    return(false);
                }

                if (next != null)
                {
                    setStatus(MakeNext(next));
                }
                else
                {
                    setStatus("&eCreating default.zip..");
                }
                data = (byte[])item.Data;
                return(true);
            }
            return(true);
        }
Beispiel #2
0
        bool Download(string identifier, ref byte[] data, Action <string> setStatus)
        {
            Request item;

            if (downloader.TryGetItem(identifier, out item))
            {
                FilesToDownload.RemoveAt(0);
                Utils.LogDebug("got resource " + identifier);

                if (item.Data == null)
                {
                    if (item.WebEx != null)
                    {
                        ErrorHandler.LogError("ResourceFetcher.Download " + identifier, item.WebEx);
                    }

                    setStatus("&cFailed to download " + identifier);
                    return(false);
                }

                setStatus(MakeNext());
                data = (byte[])item.Data;
                return(true);
            }
            return(true);
        }