當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。