public static string Invariant(FormattableString formattable) { if (formattable == null) { throw new ArgumentNullException(nameof(formattable)); } return formattable.ToString(CultureInfo.InvariantCulture); }
public void Log(LogSeverity severity, string source, FormattableString message, Exception exception = null) { if (severity <= Level) { try { Message(this, new LogMessageEventArgs(severity, source, message.ToString(), exception)); } catch { } //We dont want to log on log errors } }
public static string Invariant(FormattableString formattable) { if (formattable == null) { throw new ArgumentNullException("formattable"); } return(formattable.ToString((IFormatProvider)CultureInfo.InvariantCulture)); }
public static string Invariant(FormattableString formattable) { if (formattable == null) { throw new ArgumentNullException(nameof(formattable)); } return(formattable.ToString(CultureInfo.InvariantCulture)); }
public static string Invariant(FormattableString messageFormat) { return(messageFormat.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Format the given object in the invariant culture. This static method may be /// imported in C# by /// <code> /// using static System.FormattableString; /// </code>. /// Within the scope /// of that import directive an interpolated string may be formatted in the /// invariant culture by writing, for example, /// <code> /// Invariant($""{{ lat = {latitude}; lon = {longitude} }}"") /// </code> /// </summary> public static string Invariant(FormattableString formattable) { if (formattable == null) { throw new ArgumentNullException("formattable"); } return formattable.ToString(Globalization.CultureInfo.InvariantCulture); }
public static string Invariant(FormattableString formattableString) { string str = formattableString.ToString(CultureInfo.InvariantCulture); return(str); }
static string Url(FormattableString str) { return str.ToString(UrlFormatProvider.Instance); }
public static string Invariant(FormattableString formattable) => formattable.ToString(CultureInfo.InvariantCulture);
/// <summary> /// 将一个复合格式字符串转换为 <see cref="ExecuteCommand"/> 的对象实例。 /// </summary> /// <param name="fs">一个复合格式字符串</param> /// <returns><see cref="ExecuteCommand"/> 的对象实例。</returns> public ExecuteCommand Parse(FormattableString fs) { if(fs == null) throw new ArgumentNullException(nameof(fs)); var parameters = new ExecuteParameterCollection(); var sfp = new SqlFormatProvider(parameters, this.Provider); var text = fs.ToString(sfp); return new ExecuteCommand(text, parameters); }
public static string Invariant (FormattableString formattable) => formattable.ToString(CultureInfo.InvariantCulture);
public void Log(FormattableString message) { Console.WriteLine($"{level}: {message.ToString(LoggingCulture)}"); }
public static string Invariant(FormattableString formattable) { return(formattable.ToString(CultureInfo.InvariantCulture)); }
/// <summary> /// Format the given object in the current culture. This static method may be /// imported in C# by /// <code> /// using static System.FormattableString; /// </code>. /// Within the scope /// of that import directive an interpolated string may be formatted in the /// current culture by writing, for example, /// <code> /// CurrentCulture($"{{ lat = {latitude}; lon = {longitude} }}") /// </code> /// </summary> public static string CurrentCulture(FormattableString formattable) { ArgumentNullException.ThrowIfNull(formattable); return(formattable.ToString(Globalization.CultureInfo.CurrentCulture)); }
public static string Invariant(FormattableString formattable) => formattable?.ToString(Globalization.CultureInfo.InvariantCulture);