Esempio n. 1
0
        async void download(ActionDownloadFileArg arg)
        {
            HttpClient wclient = new HttpClient();

            byte[] data = await wclient.GetByteArrayAsync(arg.FileUrl);

            using (Stream s = await FileManager.GetFileStreamForWrite(arg.FileSaveName))
            {
                s.Write(data, 0, data.Length);
                s.Dispose();

                Done(arg);
                return;
            }
            Cancel(arg);
        }
Esempio n. 2
0
        public override bool precheckToDo(ActionArgs e)
        {
            ActionDownloadFileArg arg = e as ActionDownloadFileArg;

            return(arg != null && arg.FileUrl.Length > 0 && arg.FileSaveName.Length > 0);
        }