Ejemplo n.º 1
0
        /// <summary>
        /// Processes the specified block.
        /// </summary>
        /// <param name="block">The block.</param>
        /// <returns></returns>
        public List <imbMCStream> process(imbMCBlock block)
        {
            List <imbMCStream> output = new List <imbMCStream>();

            String content = ""; // block.blockModel.getContent(nodeBlockOutputEnum.text);

            foreach (htmlWrapper node in block.blockModel)
            {
                content = node.GetContent(nodeBlockOutputEnum.text);

                content = HtmlEntity.DeEntitize(content);

                var streams = content.SplitSmart(Environment.NewLine, "", true, true);

                Int32 c = 1;
                foreach (String str in streams)
                {
                    imbMCStream stream = new imbMCStream();
                    stream.name = "S" + c.ToString("D5");

                    c++;

                    block.Add(stream);

                    stream.content  = str;
                    stream.htmlNode = node.html;

                    output.Add(stream);
                }
            }



            return(output);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes the specified stream.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <returns></returns>
        public List <imbMCToken> process(imbMCStream stream)
        {
            List <imbMCToken> output = new List <imbMCToken>();

            // var str = tokenSelect.Split(stream.content);

            var mchs = tokenSelect.Matches(stream.content);

            Int32 c = 1;

            foreach (Match m in mchs)
            {
                imbMCToken mct = new imbMCToken();

                mct.name     = "T" + c.ToString("D5");
                mct.htmlNode = stream.htmlNode;

                mct.content  = m.Value;
                mct.position = m.Index;

                stream.Add(mct);

                output.Add(mct);
                c++;
            }

            return(output);
        }