public ByteArrayBlockWriter OpenUploadHere(FSItem item) { Log.Trace($"Upload from Shell"); var result = new ByteArrayBlockWriter(); result.OnClose = async() => { var bytes = result.Content.ToArray(); var str = Encoding.UTF8.GetString(bytes); var list = JsonConvert.DeserializeObject <CloudDokanNetUploadHereInfo>(str); try { await MakeUploads(item, list.Files); } catch (Exception ex) { Log.Error($"UploadHere error: {ex}"); throw; } }; return(result); }
public ByteArrayBlockWriter OpenUploadHere(FSItem item) { Log.Trace("Upload from Shell"); var result = new ByteArrayBlockWriter(); result.OnClose = () => { try { var bytes = result.Content.ToArray(); var str = Encoding.UTF8.GetString(bytes); var list = JsonConvert.DeserializeObject <CloudDokanNetUploadHereInfo>(str); Task.Factory.StartNew(async() => await MakeUploads(item, list.Files), TaskCreationOptions.LongRunning); return(Task.FromResult(0)); } catch (Exception ex) { Log.Error("UploadHere error", ex); throw; } }; return(result); }