示例#1
0
        public async static Task LoadTextFile(ITextContainer textModel, string path)
        {
            using (StreamReader streamReader = new StreamReader
                                               (
                       new FileStream(path, FileMode.Open, FileAccess.Read),
                       textModel.TextEncoding
                                               )
                   )
            {
                string myText = await streamReader.ReadToEndAsync();

                textModel.SetNewText(myText);
            }
        }