public static async Task Main(string[] args) { string appPath = ApplicationBase.GetEntryApplicationPath(); using (var context = new CommandContext(appPath)) using (var app = new HelperApplication(context)) { if (args.Length == 0) { await Gui.ShowWindow(() => new TesterWindow(), IntPtr.Zero); return; } app.RegisterCommand(new CredentialsCommandImpl(context)); app.RegisterCommand(new OAuthCommandImpl(context)); int exitCode = app.RunAsync(args) .ConfigureAwait(false) .GetAwaiter() .GetResult(); Environment.Exit(exitCode); } }
private static void AppMain(object o) { string[] args = (string[])o; string appPath = ApplicationBase.GetEntryApplicationPath(); using (var context = new CommandContext(appPath)) using (var app = new HelperApplication(context)) { app.RegisterCommand(new CredentialsCommandImpl(context)); int exitCode = app.RunAsync(args) .ConfigureAwait(false) .GetAwaiter() .GetResult(); Environment.Exit(exitCode); } }