Exemplo n.º 1
0
        /// <summary>
        ///     Instructs the renderer to render to the supplied proxy.
        /// </summary>
        /// <param name="proxy">The proxy to render to.</param>
        /// <param name="arg">The object to render.</param>
        /// <param name="culture">The culture to use for the render.</param>
        public override void Render(IConsoleProxy proxy, object arg, CultureInfo culture)
        {
            proxy.GetPosition(out var consoleProxy);
            if (consoleProxy.Left != 0)
            {
                proxy.WriteLine();
            }

            proxy.Write(new string('-', proxy.WindowWidth));
        }
Exemplo n.º 2
0
        public int Add(string numbers)
        {
            var result = 0;

            if (!string.IsNullOrEmpty(numbers))
            {
                var delimiters      = GetDelimiters(numbers);
                var numbersAsString = GetClearNumbersString(numbers);
                result = GetSum(numbersAsString, delimiters);
            }

            try
            {
                _logger.Write(string.Format("Result = {0}", result));
            }
            catch (Exception ex)
            {
                _webService.Notify(string.Format("Logger throwed an exception with message: {0}", ex.Message));
            }

            _consoleProxy.WriteLine(string.Format("The result is {0}", result));

            return(result);
        }
 /// <summary>
 ///     Instructs the renderer to render to the supplied proxy.
 /// </summary>
 /// <param name="proxy">The proxy to render to.</param>
 /// <param name="arg">The object to render.</param>
 /// <param name="culture">The culture to use for the render.</param>
 public override void Render(IConsoleProxy proxy, object arg, CultureInfo culture)
 {
     proxy.WriteLine();
 }