// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
// Boston, MA 02110-1301, USA.
+#nullable enable
+
using System;
using System.Collections.Generic;
using System.Linq;
private ShortcutCommand()
{
this.Shortcuts = Array.Empty<Keys>();
- this.command = () => Task.FromResult(0);
+ this.command = () => Task.CompletedTask;
this.onlyWhen = () => true;
this.FocusedOn = FocusedControl.None;
this.NotFocusedOn = FocusedControl.None;
return this.instance;
}
- /// <summary>何もしないタスク</summary>
- private static Task noOpTask = Task.FromResult(0);
-
/// <summary>
/// Action を Func<Task> に変換します
/// </summary>
private static Func<Task> SynchronousTask(Action action)
- => () => { action(); return noOpTask; };
+ => () => { action(); return Task.CompletedTask; };
}
}
}