当前位置: 首页>>代码示例>>C#>>正文


C# StringBuilder.AddSpacesInFront方法代码示例

本文整理汇总了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();
        }
开发者ID:brnleehng,项目名称:azure-powershell,代码行数:18,代码来源:Extensions.cs

示例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();
        }
开发者ID:Azure,项目名称:azure-powershell,代码行数:18,代码来源:PSToStringExtensions.cs

示例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();
        }
开发者ID:devigned,项目名称:azure-powershell,代码行数:27,代码来源:PSToStringExtensions.cs

示例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();
 }
开发者ID:docschmidt,项目名称:azure-powershell,代码行数:18,代码来源:PSDictionaryElement.cs


注:本文中的System.Text.StringBuilder.AddSpacesInFront方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。