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


C# this.AppendFormat方法代码示例

本文整理汇总了C#中this.AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C# this.AppendFormat方法的具体用法?C# this.AppendFormat怎么用?C# this.AppendFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在this的用法示例。


在下文中一共展示了this.AppendFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Filter

        public static void Filter(this StringBuilder builder, string field, string value, bool and = true)
        {
            if (builder.Length > 0)
                builder.AppendFormat(" {0} ", and ? "and" : "or");

            builder.AppendFormat("{0} eq '{1}'", field, value);
        }
开发者ID:adwardliu,项目名称:vc-community,代码行数:7,代码来源:StringBuilderExtensions.cs

示例2: WriteHttpTrace

        public static void WriteHttpTrace(this StringBuilder stringBuilder, HttpMessageHeader messageHeader)
        {
            if (messageHeader == null)
            {
                return;
            }

            stringBuilder
                .AppendFormat("StartLine: {0}", messageHeader.StartLine)
                .AppendLine();

            var headers = messageHeader.Headers.Lines.ToList();

            if (headers.Count == 0)
            {
                return;
            }

            stringBuilder.AppendLine("Headers:");

            foreach (var header in headers)
            {
                stringBuilder
                    .AppendFormat("    {0}", header)
                    .AppendLine();
            }
        }
开发者ID:hanswolff,项目名称:FryProxy,代码行数:27,代码来源:TraceUtils.cs

示例3: Filter

        public static void Filter(this StringBuilder builder, string field, DateTime value, string op, bool and = true)
        {
            if (builder.Length > 0) builder.AppendFormat(" {0} ", and ? "and" : "or");

            builder.AppendFormat("(");
            builder.AppendFormat("{0} {1} {2}", field, op, AzureSearchHelper.ConvertToOffset(value).ToString("u").Replace(" ", "T"));
            builder.AppendFormat(")");
        }
开发者ID:gitter-badger,项目名称:vc-community-1.x,代码行数:8,代码来源:StringBuilderExtensions.cs

示例4: AppendTriggerable

        private static void AppendTriggerable(this StringBuilder builder, Triggerable triggerable)
        {
            builder.AppendLine("   [TRIGGERABLE]");

            builder.AppendFormat("      <STRING>Name:{0}\r\n", triggerable.Name);
            builder.AppendFormat("      <STRING>File:{0}\r\n", triggerable.File);

            builder.AppendLine("   [/TRIGGERABLE]");
        }
开发者ID:andreberg,项目名称:TLII.IO,代码行数:9,代码来源:TriggerableDataConverter.cs

示例5: AppendSkill

        private static void AppendSkill(this StringBuilder builder, Skill skill)
        {
            builder.AppendLine("   [SKILL]");

            builder.AppendFormat("      <INTEGER64>GUID:{0}\r\n", skill.GUID);
            builder.AppendFormat("      <STRING>Name:{0}\r\n", skill.Name);
            builder.AppendFormat("      <STRING>File:{0}\r\n", skill.File);

            builder.AppendLine("   [/SKILL]");
        }
开发者ID:andreberg,项目名称:TLII.IO,代码行数:10,代码来源:SkillDataConverter.cs

示例6: AppendAffix

        private static void AppendAffix(this StringBuilder builder, Affix affix)
        {
            builder.AppendLine("   [AFFIX]");

            builder.AppendFormat("      <STRING>Name:{0}\r\n", affix.Name);
            builder.AppendFormat("      <STRING>File:{0}\r\n", affix.File);
            builder.AppendFormat("      <INTEGER>MinSpawnRange:{0}\r\n", affix.MinSpawnRange);
            builder.AppendFormat("      <INTEGER>MaxSpawnRange:{0}\r\n", affix.MaxSpawnRange);
            builder.AppendFormat("      <INTEGER>Weight:{0}\r\n", affix.Weight);
            builder.AppendFormat("      <INTEGER>DifficultiesAllowed:{0}\r\n", affix.DifficultiesAllowed);

            if (affix.UnitTypes.Count > 0)
            {
                builder.AppendLine("      [UNITTYPES]");
                foreach (var unitType in affix.UnitTypes)
                {
                    builder.AppendFormat("         <STRING>{0}\r\n", unitType);
                }
                builder.AppendLine("      [/UNITTYPES]");
            }

            if (affix.NotUnitTypes.Count > 0)
            {
                builder.AppendLine("      [NOTUNITTYPES]");
                foreach (var unitType in affix.NotUnitTypes)
                {
                    builder.AppendFormat("         <STRING>{0}\r\n", unitType);
                }
                builder.AppendLine("      [/NOTUNITTYPES]");
            }
            builder.AppendLine("   [/AFFIX]");
        }
开发者ID:andreberg,项目名称:TLII.IO,代码行数:32,代码来源:AffixDataConverter.cs

示例7: AppendLine

        public static void AppendLine(this StringBuilder self, String format, params Object[] args)
        {
            Check.Argument(self, "self");

            self.AppendFormat(format, args);
            self.AppendLine();
        }
开发者ID:Pondidum,项目名称:Ambry,代码行数:7,代码来源:StringBuilderExtensions.cs

示例8: AppendFormatIfNotNull

		public static void AppendFormatIfNotNull(this StringBuilder sb, object parameter, string value, params object[] args)
		{
			if (parameter != null)
			{
				sb.AppendFormat(value, args);
			}
		}
开发者ID:charreal,项目名称:Jq.Grid,代码行数:7,代码来源:StringBuilderExtensions.cs

示例9: AppendFormatIfNotNullOrEmpty

		public static void AppendFormatIfNotNullOrEmpty(this StringBuilder sb, string parameter, string value)
		{
			if (!string.IsNullOrEmpty(parameter))
			{
				sb.AppendFormat(value, parameter);
			}
		}
开发者ID:charreal,项目名称:Jq.Grid,代码行数:7,代码来源:StringBuilderExtensions.cs

示例10: AppendFormatIfFalse

		public static void AppendFormatIfFalse(this StringBuilder sb, bool parameter, string value, params object[] args)
		{
			if (!parameter)
			{
				sb.AppendFormat(value, args);
			}
		}
开发者ID:charreal,项目名称:Jq.Grid,代码行数:7,代码来源:StringBuilderExtensions.cs

示例11: AppendFormatIfNotZero

        public static void AppendFormatIfNotZero(this TextBoxBase textbox, string format, float arg)
        {
            Contract.Requires(format != null);

            if (arg != 0.0f)
                textbox.AppendFormat(format, arg);
        }
开发者ID:azuritus,项目名称:spellwork,代码行数:7,代码来源:RichTextBoxExtensions.cs

示例12: AppendProperty

 private static void AppendProperty(this StringBuilder sb, string addition)
 {
     if (sb.Length > 0)
         sb.AppendFormat(",{0}", addition);
     else
         sb.Append(addition);
 }
开发者ID:prabirshrestha,项目名称:opengraph.net,代码行数:7,代码来源:SubscriberParser.cs

示例13: AppendNonNullOrEmpty

 public static StringBuilder AppendNonNullOrEmpty(this StringBuilder sb, string format, object arg0, int padLeftWidth = 0)
 {
     if (arg0 == null) return sb;
     if (arg0.GetType().FullName == "System.String" && string.IsNullOrWhiteSpace(arg0.ToString()))
         return sb;
     return sb.AppendFormat(format, arg0).PadLeft(padLeftWidth);
 }
开发者ID:nazmoonnoor,项目名称:FluentJqGrid,代码行数:7,代码来源:StringBuilderExtensions.cs

示例14: AppendFormatLineIfNotNull

 public static void AppendFormatLineIfNotNull(this RichTextBox builder, string format, uint arg, object s)
 {
     if (arg != 0)
     {
          builder.AppendFormat(format+Environment.NewLine, arg,s);
     }
 }
开发者ID:Warlord123,项目名称:spellwork_cs,代码行数:7,代码来源:RichTextBoxExtensions.cs

示例15: AppendLineFormat

    public static StringBuilder AppendLineFormat(this StringBuilder builder, string format, params object[] args)
    {
        builder.AppendFormat(format, args);
        builder.AppendLine();

        return builder;
    }
开发者ID:TormentedEmu,项目名称:OpenUO,代码行数:7,代码来源:StringBuilderExtensions.cs


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