Esempio n. 1
0
        /// <summary>
        /// extract meta from content
        /// </summary>
        /// <param name="content">content need to be extract</param>
        /// <param name="metas">meta collection</param>
        /// <returns>dictionary result</returns>
        public static Dictionary <string, object> ExtractMeta(string content, ExtractMetaCollection metas)
        {
            var results = new Dictionary <string, object>();

            foreach (var key in metas.Keys)
            {
                var value = ExtractSelector(content, metas[key]);

                if (value.Count > 0)
                {
                    value[0].Name = key;
                    results.Add(key, value[0].Content);
                }
            }

            return(results);
        }
Esempio n. 2
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="name">tile name</param>
 public ExtractTile(string name = "") : base(name)
 {
     Metas = new ExtractMetaCollection();
 }
Esempio n. 3
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="name">block name</param>
 public ExtractBlock(string name = "") : base(name)
 {
     Blocks       = new ExtractBlockCollection();
     Metas        = new ExtractMetaCollection();
     TileSelector = new ExtractTile();
 }