diff options
author | nosami <jasonimison@gmail.com> | 2019-11-06 17:22:53 +0300 |
---|---|---|
committer | nosami <jasonimison@gmail.com> | 2019-11-06 17:22:53 +0300 |
commit | cfcd350e819814ff2e748656aaef94461076dc0c (patch) | |
tree | 3690dbb793217342816cd5188049c483caa0ac59 /main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs | |
parent | a415aae778b29ded030fb8675af4f540f1f50ff8 (diff) |
Check if token is cancelled
Diffstat (limited to 'main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs index 5c5cde257c..d487a06490 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/ScaffolderTemplateConfigurePage.cs @@ -75,15 +75,20 @@ namespace MonoDevelop.AspNetCore.Scaffolding Task.Run (async () => { var options = await comboField.Options; - await Runtime.RunInMainThread (() => - Xwt.Toolkit.NativeEngine.Invoke (() => { - foreach (var option in options) { - comboBox.Items.Add (option); - } - comboField.SelectedValue = options.FirstOrDefault (); - if (comboBox.Items.Count > 0) - comboBox.SelectedIndex = 0; - })); + await Runtime.RunInMainThread (() => { + if (Args.CancellationToken.IsCancellationRequested) { + return; + } + Xwt.Toolkit.NativeEngine.Invoke (() => { + foreach (var option in options) { + comboBox.Items.Add (option); + } + comboField.SelectedValue = options.FirstOrDefault (); + if (comboBox.Items.Count > 0) + comboBox.SelectedIndex = 0; + }); + + }); }, Args.CancellationToken); label.Text = comboField.DisplayName; |