本文整理汇总了C#中System.Text.StringBuilder.AddSpacesInFront方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AddSpacesInFront方法的具体用法?C# StringBuilder.AddSpacesInFront怎么用?C# StringBuilder.AddSpacesInFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.AddSpacesInFront方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToString
/// <summary>
/// A string representation of the list of MetricAvailability objects including indentation
/// </summary>
/// <param name="metricAvailabilities">The list of MetricAvailability objects</param>
/// <param name="indentationTabs">The number of tabs to insert in front of each member</param>
/// <returns>A string representation of the list of MetricAvailability objects including indentation</returns>
public static string ToString(this IList<MetricAvailability> metricAvailabilities, int indentationTabs)
{
StringBuilder output = new StringBuilder();
foreach (var metricAvailability in metricAvailabilities)
{
output.AppendLine();
output.AddSpacesInFront(indentationTabs).AppendLine("Retention : " + metricAvailability.Retention);
output.AddSpacesInFront(indentationTabs).Append("Values : " + metricAvailability.TimeGrain);
}
return output.ToString();
}
示例2: ToString
/// <summary>
/// A string representation of the Dimension including indentation
/// </summary>
/// <param name="inputString">The input string</param>
/// <param name="indentationTabs">The number of tab chars to insert</param>
/// <returns>A string representation of the LocalizableString</returns>
public static string ToString(this LocalizableString inputString, int indentationTabs)
{
StringBuilder output = new StringBuilder();
if (inputString != null)
{
output.AppendLine();
output.AddSpacesInFront(indentationTabs).AppendLine("LocalizedValue : " + inputString.LocalizedValue);
output.AddSpacesInFront(indentationTabs).AppendLine("Value : " + inputString.Value);
}
return output.ToString();
}
示例3: ToString
/// <summary>
/// A string representation of the ScaleCapacity including indentation
/// </summary>
/// <param name="ruleEventDataSource">The RuleManagementEventDataSource object</param>
/// <param name="indentationTabs">The number of tabs to insert in front of each member</param>
/// <returns>A string representation of the ScaleCapacity including indentation</returns>
public static string ToString(this RuleManagementEventDataSource ruleEventDataSource, int indentationTabs)
{
//RuleManagementEventDataSource
StringBuilder output = new StringBuilder();
if (ruleEventDataSource != null)
{
output.AppendLine();
output.AddSpacesInFront(indentationTabs).AppendLine("EventName : " + ruleEventDataSource.EventName);
output.AddSpacesInFront(indentationTabs).AppendLine("Category : " + ruleEventDataSource.EventSource);
output.AddSpacesInFront(indentationTabs).AppendLine("Level : " + ruleEventDataSource.Level);
output.AddSpacesInFront(indentationTabs).AppendLine("OperationName : " + ruleEventDataSource.OperationName);
output.AddSpacesInFront(indentationTabs).AppendLine("ResourceGroupName : " + ruleEventDataSource.ResourceGroupName);
output.AddSpacesInFront(indentationTabs).AppendLine("ResourceProviderName : " + ruleEventDataSource.ResourceProviderName);
output.AddSpacesInFront(indentationTabs).AppendLine("ResourceId : " + ruleEventDataSource.ResourceUri);
output.AddSpacesInFront(indentationTabs).AppendLine("Status : " + ruleEventDataSource.Status);
output.AddSpacesInFront(indentationTabs).AppendLine("SubStatus : " + ruleEventDataSource.SubStatus);
output.AddSpacesInFront(indentationTabs).Append("Claims : " + ruleEventDataSource.Claims);
}
return output.ToString();
}
示例4: ToString
/// <summary>
/// A string representation of the contained dictionary
/// </summary>
/// <param name="indentationTabs">The number of tabs to insert in front of each member</param>
/// <returns>A string representation of the contained dictionary</returns>
public string ToString(int indentationTabs)
{
var output = new StringBuilder();
if (this.Content != null && this.Content.Count > 0)
{
foreach (var keyValuePair in this.Content)
{
output.AppendLine();
output.AddSpacesInFront(indentationTabs).Append(string.Format(CultureInfo.InvariantCulture, "{0, -15}: {1}", keyValuePair.Key, keyValuePair.Value));
}
}
return output.ToString();
}