예제 #1
0
        public void Print()
        {
            Id accountId = cardReader.Authenticate();
            List <HistoryLine> historyOfAccount = history.Get(accountId);
            string             formattedHistory = stringFormatter.Format(historyOfAccount);

            printer.Print(formattedHistory);
        }
        /// <param name="formatter"><see cref="IStringFormatter"/> instance.</param>
        /// <inheritdoc cref="IStringFormatter.Format(string, IDataRecord, IFormatProvider)"/>
        public static string Format(this IStringFormatter formatter, string format, IDataRecord record)
        {
            _ = formatter ?? throw new ArgumentNullException(nameof(formatter));
            _ = format ?? throw new ArgumentNullException(nameof(format));
            _ = record ?? throw new ArgumentNullException(nameof(record));

            return(formatter.Format(format, record, CultureInfo.InvariantCulture));
        }
예제 #3
0
        public string GetAssetString(string id, object values)
        {
            string result;

            if (_assetStrings.TryGetValue(id, out result))
            {
                if (values != null)
                {
                    result = _stringFormatter.Format(result, values);
                }
            }
            else
            {
                result = $"Asset string {id} not found.";
            }

            return(result);
        }
예제 #4
0
 public string Handle(string input)
 {
     return(_formatter.Format(input));
 }
예제 #5
0
 protected override byte[] Encode(string text)
 {
     return(base.Encode(_stringFormatter.Format(text)));
 }
예제 #6
0
 public IHttpActionResult Get()
 {
     return(Ok(_formatter.Format("Hello")));
 }