/// <summary>
        /// Adds an appropriate FieldFilter to the given PageAssemblyInstruction object, based on the Tag's
        /// current settings.
        /// </summary>
        /// <param name="pai">The IPageAssemblyInstruction object to receive the new FieldFilter.</param>
        private void RegisterSocialMetaTagFieldFilter(IPageAssemblyInstruction pai, SocialMetaTagData socialMetaTag)
        {
            // add a field filter for each tag
            pai.AddFieldFilter(socialMetaTag.Id, (name, data) =>
            {
                string content = String.Empty;
                switch (socialMetaTag.Source)
                {
                case SocialMetaTagSources.field:
                    content = pai.GetField(socialMetaTag.Content);
                    break;

                case SocialMetaTagSources.url:
                    content = pai.GetUrl(socialMetaTag.Content).ToString();
                    break;

                // both literal types just use the content directly
                default:
                    content = socialMetaTag.Content;
                    break;
                }

                data.Value = content;
            });
        }
예제 #2
0
        public SocialMetadata()
        {
            // default to false in the case of no entry in XML
            IsCommentingAvailable = false;

            Tags = new SocialMetaTagData[0];
        }
예제 #3
0
 public SocialMetaTag(SocialMetaTagData data)
 {
     SocialMetaTagData = data;
 }