當前位置: 首頁>>代碼示例>>C#>>正文


C# StringBuilder.AppendMetaPropertyContentIfNotNull方法代碼示例

本文整理匯總了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);
        }
開發者ID:modulexcite,項目名稱:ASP.NET-MVC-Boilerplate,代碼行數:12,代碼來源:OpenGraphBooksGenre.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("game:points", this.Points);
            stringBuilder.AppendMetaPropertyContentIfNotNull("game:secret", this.IsSecret);
        }
開發者ID:Li-Yanzhi,項目名稱:ASP.NET-MVC-Boilerplate,代碼行數:11,代碼來源:OpenGraphGameAchievement.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)
        {
            base.ToString(stringBuilder);

            stringBuilder.AppendMetaPropertyContentIfNotNull("product:retailer_group_id", this.RetailerGroupId);
        }
開發者ID:rabbal,項目名稱:Decision,代碼行數:10,代碼來源:OpenGraphProductGroup.cs

示例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);
                    }
                }
            }
        }
開發者ID:Li-Yanzhi,項目名稱:ASP.NET-MVC-Boilerplate,代碼行數:98,代碼來源:OpenGraphFitnessCourse.cs

示例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);
 }
開發者ID:razormad,項目名稱:ASP.NET-MVC-Boilerplate,代碼行數:10,代碼來源:OpenGraphPreviewAudio.cs

示例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);
        }
開發者ID:rabbal,項目名稱:Decision,代碼行數:10,代碼來源:OpenGraphMusicRadioStation.cs


注:本文中的System.Text.StringBuilder.AppendMetaPropertyContentIfNotNull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。