Add comment regarding the reasoning for encapsulating the task in another

This commit is contained in:
Dean Herbert 2020-12-14 18:03:01 +09:00
parent f3e6c586f7
commit c5112edd08
1 changed files with 3 additions and 0 deletions

View File

@ -429,8 +429,11 @@ public void PresentScore(ScoreInfo score, ScorePresentType presentType = ScorePr
public override Task Import(Stream stream, string filename) public override Task Import(Stream stream, string filename)
{ {
// encapsulate task as we don't want to begin the import process until in a ready state.
var importTask = new Task(async () => await base.Import(stream, filename)); var importTask = new Task(async () => await base.Import(stream, filename));
waitForReady(() => this, _ => importTask.Start()); waitForReady(() => this, _ => importTask.Start());
return importTask; return importTask;
} }