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


C# StringBuilder.AppendMetaPropertyContent方法代码示例

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


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

示例1: ToString

        /// <summary>
        /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        public override void ToString(StringBuilder stringBuilder)
        {
            base.ToString(stringBuilder);

            stringBuilder.AppendMetaPropertyContent("game:points", this.Points);
            stringBuilder.AppendMetaPropertyContentIfNotNull("game:secret", this.IsSecret);
        }
开发者ID:Li-Yanzhi,项目名称:ASP.NET-MVC-Boilerplate,代码行数:11,代码来源:OpenGraphGameAchievement.cs

示例2: ToString

 /// <summary>
 /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
 /// </summary>
 /// <param name="stringBuilder">The string builder.</param>
 public override void ToString(StringBuilder stringBuilder)
 {
     stringBuilder.AppendMetaPropertyContent("og:video", this.Url);
     stringBuilder.AppendMetaPropertyContentIfNotNull("og:video:secure_url", this.UrlSecure);
     stringBuilder.AppendMetaPropertyContentIfNotNull("og:video:type", this.Type);
     stringBuilder.AppendMetaPropertyContentIfNotNull("og:video:width", this.Width);
     stringBuilder.AppendMetaPropertyContentIfNotNull("og:video:height", this.Height);
 }
开发者ID:razormad,项目名称:ASP.NET-MVC-Boilerplate,代码行数:12,代码来源:OpenGraphVideo.cs

示例3: ToString

        /// <summary>
        /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        public override void ToString(StringBuilder stringBuilder)
        {
            base.ToString(stringBuilder);

            stringBuilder.AppendMetaPropertyContentIfNotNull("profile:first_name", this.FirstName);
            stringBuilder.AppendMetaPropertyContentIfNotNull("profile:last_name", this.LastName);
            stringBuilder.AppendMetaPropertyContentIfNotNull("profile:username", this.Username);

            if (this.Gender.HasValue)
            {
                stringBuilder.AppendMetaPropertyContent("profile:gender", this.Gender.Value.ToLowercaseString());
            }
        } 
开发者ID:netusers2014,项目名称:ASP.NET-MVC-Boilerplate,代码行数:17,代码来源:OpenGraphProfile.cs

示例4: ToString

        /// <summary>
        /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        public override void ToString(StringBuilder stringBuilder)
        {
            base.ToString(stringBuilder);

            stringBuilder.AppendMetaPropertyContentIfNotNull("books:book", this.BookUrls);
            stringBuilder.AppendMetaPropertyContentIfNotNull("books:genre", this.GenreUrls);

            if (this.Gender.HasValue)
            {
                stringBuilder.AppendMetaPropertyContent("books:gender", this.Gender.Value.ToLowercaseString());
            }

            stringBuilder.AppendMetaPropertyContentIfNotNull("books:official_site", this.OfficialSiteUrl);
        }
开发者ID:modulexcite,项目名称:ASP.NET-MVC-Boilerplate,代码行数:18,代码来源:OpenGraphBooksAuthor.cs

示例5: ToString

        /// <summary>
        /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
        /// </summary>
        /// <param name="stringBuilder">The string builder.</param>
        public override void ToString(StringBuilder stringBuilder)
        {
            base.ToString(stringBuilder);

            stringBuilder.AppendMetaPropertyContent("fitness:calories", this.Calories);

            if (this.CustomUnitEnergy != null)
            {
                stringBuilder.AppendMetaPropertyContent("fitness:custom_unit_energy:value", this.CustomUnitEnergy.Value);
                stringBuilder.AppendMetaPropertyContent("fitness:custom_unit_energy:units", this.CustomUnitEnergy.Units);
            }

            if (this.Distance != null)
            {
                stringBuilder.AppendMetaPropertyContent("fitness:distance:value", this.Distance.Value);
                stringBuilder.AppendMetaPropertyContent("fitness:distance:units", this.Distance.Units);
            }

            if (this.Duration != null)
            {
                stringBuilder.AppendMetaPropertyContent("fitness:duration:value", this.Duration.Value);
                stringBuilder.AppendMetaPropertyContent("fitness:duration:units", this.Duration.Units);
            }

            stringBuilder.AppendMetaPropertyContentIfNotNull("fitness:live_text", this.LiveText);

            if (this.Metrics != null)
            {
                foreach (OpenGraphFitnessActivityDataPoint metric in this.Metrics)
                {
                    stringBuilder.AppendMetaPropertyContentIfNotNull("fitness:metrics:calories", metric.Calories);

                    if (metric.CustomUnitEnergy != null)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:custom_unit_energy:value", metric.CustomUnitEnergy.Value);
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:custom_unit_energy:units", metric.CustomUnitEnergy.Units);
                    }

                    if (metric.Distance != null)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:distance:value", metric.Distance.Value);
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:distance:units", metric.Distance.Units);
                    }

                    if (metric.Location != null)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:location:latitude", metric.Location.Latitude);
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:location:longitude", metric.Location.Longitude);
                        stringBuilder.AppendMetaPropertyContentIfNotNull("fitness:metrics:location:altitude", metric.Location.Altitude);
                    }

                    stringBuilder.AppendMetaPropertyContentIfNotNull("fitness:metrics:steps", metric.Steps);

                    if (metric.Speed != null)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:speed:value", metric.Speed.Value);
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:speed:units", metric.Speed.Units);
                    }

                    stringBuilder.AppendMetaPropertyContentIfNotNull("fitness:metrics:timestamp", metric.Timestamp);

                    if (metric.Pace != null)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:pace:value", metric.Pace.Value);
                        stringBuilder.AppendMetaPropertyContent("fitness:metrics:pace:units", metric.Pace.Units);
                    }
                }
            }

            if (this.Pace != null)
            {
                stringBuilder.AppendMetaPropertyContent("fitness:pace:value", this.Pace.Value);
                stringBuilder.AppendMetaPropertyContent("fitness:pace:units", this.Pace.Units);
            }

            if (this.Speed != null)
            {
                stringBuilder.AppendMetaPropertyContent("fitness:speed:value", this.Speed.Value);
                stringBuilder.AppendMetaPropertyContent("fitness:speed:units", this.Speed.Units);
            }

            if (this.Splits != null)
            {
                foreach (OpenGraphSplit split in this.Splits)
                {
                    stringBuilder.AppendMetaPropertyContent("fitness:splits:unit", split.IsMiles ? "mi" : "km");
                    foreach (OpenGraphQuantity value in split.Values)
                    {
                        stringBuilder.AppendMetaPropertyContent("fitness:splits:values:value", value.Value);
                        stringBuilder.AppendMetaPropertyContent("fitness:splits:values:units", value.Units);
                    }
                }
            }
        }
开发者ID:Li-Yanzhi,项目名称:ASP.NET-MVC-Boilerplate,代码行数:98,代码来源:OpenGraphFitnessCourse.cs

示例6: ToString

 /// <summary>
 /// Appends a HTML-encoded string representing this instance to the <paramref name="stringBuilder"/> containing the Open Graph meta tags.
 /// </summary>
 /// <param name="stringBuilder">The string builder.</param>
 public override void ToString(StringBuilder stringBuilder)
 {
     stringBuilder.AppendMetaPropertyContent("music:preview_url:url", this.Url);
     stringBuilder.AppendMetaPropertyContentIfNotNull("music:preview_url:secure_url", this.UrlSecure);
     stringBuilder.AppendMetaPropertyContentIfNotNull("music:preview_url:type", this.Type);
 }
开发者ID:razormad,项目名称:ASP.NET-MVC-Boilerplate,代码行数:10,代码来源:OpenGraphPreviewAudio.cs


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