ACAT.Extensions.Default.FunctionalAgents.LectureManager.LectureManagerMainForm.loadFile C# (CSharp) Method

loadFile() private method

Load the file asynchronously so as to not tie up the ui
private loadFile ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        private async Task loadFile()
        {
            Task t = Task.Factory.StartNew(() =>
            {
                if (LoadFromFile)
                {
                    if (!String.IsNullOrEmpty(LectureFile))
                    {
                        LectureText = _textDocumentReader.GetText(LectureFile);
                        FileLoaded = true;
                    }
                }
                else
                {
                    FileLoaded = true;
                }

                updateFileName(LectureFile);

                parseAndDisplayText();

                _formLoadComplete = true;
            });
            await t;
        }