Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadAllTextAsync() [2/2]

static Task< string > System.IO.File.ReadAllTextAsync ( string path,
Encoding encoding,
CancellationToken cancellationToken = default(CancellationToken) )
inlinestatic

Definition at line 642 of file File.cs.

643 {
644 if (path == null)
645 {
646 throw new ArgumentNullException("path");
647 }
648 if (encoding == null)
649 {
650 throw new ArgumentNullException("encoding");
651 }
652 if (path.Length == 0)
653 {
654 throw new ArgumentException(SR.Argument_EmptyPath, "path");
655 }
656 if (!cancellationToken.IsCancellationRequested)
657 {
659 }
660 return Task.FromCanceled<string>(cancellationToken);
661 }
static async Task< string > InternalReadAllTextAsync(string path, Encoding encoding, CancellationToken cancellationToken)
Definition File.cs:663
static Task FromCanceled(CancellationToken cancellationToken)
Definition Task.cs:3363

References System.SR.Argument_EmptyPath, System.cancellationToken, System.Threading.Tasks.Task< TResult >.FromCanceled(), and System.IO.File.InternalReadAllTextAsync().