예제 #1
0
파일: MetaEntry.cs 프로젝트: radtek/KoreCMS
        public static MetaEntry Combine(MetaEntry meta1, MetaEntry meta2, string contentSeparator)
        {
            var newMeta = new MetaEntry();

            Merge(newMeta.builder.Attributes, new[] { meta1.builder.Attributes, meta2.builder.Attributes });
            if (!string.IsNullOrEmpty(meta1.Content) && !string.IsNullOrEmpty(meta2.Content))
            {
                newMeta.Content = meta1.Content + contentSeparator + meta2.Content;
            }
            return(newMeta);
        }
예제 #2
0
        public void AppendMeta(MetaEntry meta, string contentSeparator)
        {
            if (meta == null || String.IsNullOrEmpty(meta.Name))
            {
                return;
            }

            MetaEntry existingMeta;

            if (metas.TryGetValue(meta.Name, out existingMeta))
            {
                meta = MetaEntry.Combine(existingMeta, meta, contentSeparator);
            }
            metas[meta.Name] = meta;
        }
예제 #3
0
 public void SetMeta(MetaEntry meta)
 {
     metas[meta.Name ?? Guid.NewGuid().ToString()] = meta;
 }