public bool Start() { #if DEBUG ConsoleService.TryStartWrite(); #else if (OtherArguments.Any()) { ConsoleService.TryStartWrite(); } #endif SubscribeExceptions(); var(success, response) = StartupAgent.Start(ProductInfo.Product, ProductInfo.StartupTaskId, OtherArguments); if (!success && (response is not null)) { ConsoleService.Write(response.ToString()); } return(success); }
public async Task <bool> StartAsync(StartupEventArgs e, params string[] standardOptions) { // This method must be called before StandardArguments or OtherArguments property is consumed. // An exception thrown in this method will not be handled. await ParseArgumentsAsync(e, standardOptions); #if DEBUG ConsoleService.TryStartWrite(); #else if (OtherArguments.Any()) { ConsoleService.TryStartWrite(); } #endif SubscribeExceptions(); var(success, response) = StartupAgent.Start(ProductInfo.Product, ProductInfo.StartupTaskId, OtherArguments); if (!success && (response is not null)) { ConsoleService.Write(response.ToString()); } return(success); }