public void FileMove(Game g, string sourceFile, string destFile) { Running = true; _game = g; FileCopyDelegate del = new FileCopyDelegate(FMove); IAsyncResult result = del.BeginInvoke(sourceFile, destFile, CallBackAfterFileCopied, null); while (Running) { Thread.Sleep(100); } del.EndInvoke(result); }
public static void AsynFileCopy(string sourceFile, string destFile) { FileCopyDelegate del = new FileCopyDelegate(FileCopy); IAsyncResult result = del.BeginInvoke(sourceFile, destFile, CallBackAfterFileCopied, null); }