コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: AppKeeper.cs プロジェクト: uDEV2019/Monitorian
        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);
        }