internal static IAsyncResult Create(AsyncCallback ac) { var result = new LocalAsyncResult(); Task.Delay(100).Wait(); ac.Invoke(result); return(result); }
public IAsyncResult BeginUploadFile(Stream stream, string path, AsyncCallback callback, Action <ulong> progress) { ColoredConsole.WriteLine(ConsoleColor.Cyan, "LocalFile: Beginning upload of file {0}...", path); DelayTransfer(stream); var result = LocalAsyncResult.Create(callback); ColoredConsole.WriteLine(ConsoleColor.Green, "LocalFile: File {0} is being uploaded.", path); return(result); }
public IAsyncResult BeginExecute(AsyncCallback callback) { return(LocalAsyncResult.Create(callback)); }