Пример #1
0
        /// <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();
        }
Пример #2
0
        /// <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);
        }