/// <summary> /// Start saving file /// </summary> /// <param name="fileName"></param> private void StartSaveFile(string fileName) { //Update cursor ((UserControl)editorControl).Cursor = Cursors.WaitCursor; //Disable controls editorControl.DisableControls(); //Reset progress editorControl.UpdateProgress(0, null); isWrite = true; FileOperationArgument foa = new FileOperationArgument(fileName, isWrite, editorControl.BodyContentText); bgWorker.RunWorkerAsync(foa); //Free memory foa.Dispose(); GC.Collect(); }
/// <summary> /// Start reading file /// </summary> /// <param name="fileName"></param> private void StartReadFile(string fileName) { //Update cursor ((UserControl)editorControl).Cursor = Cursors.WaitCursor; //Clear text editorControl.BodyContentText = String.Empty; //Disable controls editorControl.DisableControls(); //Reset progress editorControl.UpdateProgress(0, null); //Create params isWrite = false; FileOperationArgument foa = new FileOperationArgument(fileName, isWrite, String.Empty); bgWorker.RunWorkerAsync(foa); }