microsoft/TypeAgent

Public

mirrored fromhttps://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/fix-shell-and-cli-windows-job

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

dotnet/uiAutomationHelper/src/Program.cs

32lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using System.Text;
5using UiAutomationHelper.Methods;
6using UiAutomationHelper.Rpc;
7
8namespace UiAutomationHelper;
9
10internal static class Program
11{
12 public static async Task<int> Main(string[] args)
13 {
14 Console.InputEncoding = Encoding.UTF8;
15 Console.OutputEncoding = Encoding.UTF8;
16
17 using var cts = new CancellationTokenSource();
18 Console.CancelKeyPress += (_, e) =>
19 {
20 e.Cancel = true;
21 cts.Cancel();
22 };
23
24 var dispatch = new Dispatch();
25 Methods.Register.All(dispatch);
26
27 var server = new JsonRpcServer(Console.In, Console.Out, dispatch);
28 Notifier.Init(server);
29 await server.RunAsync(cts.Token).ConfigureAwait(false);
30 return 0;
31 }
32}
33