Start() public méthode

待受け開始。
public Start ( CancellationToken ct ) : Task
ct System.Threading.CancellationToken 待ち受けを終了したいときにキャンセルする。
Résultat Task
Exemple #1
0
        static string timeFormat = TIME; // 時刻の表示形式。

        static void Main()
        {
            WriteHelp();

            var cts = new CancellationTokenSource();
            eventLoop = new KeyboardEventLoop(code => OnKeyDown(code, cts));

            Task.WhenAll(
                eventLoop.Start(cts.Token),
                TimerLoop(cts.Token)
                ).Wait();
        }
Exemple #2
0
        static string timeFormat = TIME; // 時刻の表示形式。

        static void Main()
        {
            WriteHelp();

            var cts = new CancellationTokenSource();

            eventLoop = new KeyboardEventLoop(code => OnKeyDown(code, cts));

            Task.WhenAll(
                eventLoop.Start(cts.Token),
                TimerLoop(cts.Token)
                ).Wait();
        }