本文整理汇总了C#中System.Text.StringBuilder.AppendMetaPropertyContentIfNotNull方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AppendMetaPropertyContentIfNotNull方法的具体用法?C# StringBuilder.AppendMetaPropertyContentIfNotNull怎么用?C# StringBuilder.AppendMetaPropertyContentIfNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.AppendMetaPropertyContentIfNotNull方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.AppendMetaPropertyContentIfNotNull("books:author", this.AuthorUrls);
stringBuilder.AppendMetaPropertyContentIfNotNull("books:book", this.BookUrls);
stringBuilder.AppendMetaPropertyContentIfNotNull("books:canonical_name", this.CanonicalName);
}
示例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);
}
示例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());
}
}
示例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);
}
示例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("game:points", this.Points);
stringBuilder.AppendMetaPropertyContentIfNotNull("game:secret", this.IsSecret);
}
示例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)
{
base.ToString(stringBuilder);
stringBuilder.AppendMetaPropertyContentIfNotNull("product:retailer_group_id", this.RetailerGroupId);
}
示例7: 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);
}
}
}
}
示例8: 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);
}
示例9: 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("music:creator", this.CreatorUrl);
}