mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-26 03:59:34 +08:00
V1.2 新构架
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
namespace System.Text
|
||||
{
|
||||
public abstract class StringBuilderBase : IStringBuilder
|
||||
{
|
||||
public abstract IStringBuilder Append(string? value);
|
||||
|
||||
public virtual IStringBuilder AppendLine()
|
||||
{
|
||||
Append(Environment.NewLine);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IStringBuilder AppendLine(string? value)
|
||||
{
|
||||
Append(value);
|
||||
AppendLine();
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IStringBuilder AppendFormat(string format, params object?[] args)
|
||||
{
|
||||
Append(string.Format(format, args));
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IStringBuilder AppendFormatLine(string format, params object?[] args)
|
||||
{
|
||||
StringBuilderExtensions.AppendFormatLine((f, a) => AppendFormat(f, a), () => AppendLine(), format, args);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IStringBuilder AppendDateTimeNowLine(DateTime? now = null)
|
||||
{
|
||||
StringBuilderExtensions.AppendDateTimeNowLine((format, args) => AppendFormatLine(format, args), now);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user