Пример #1
0
        public virtual string ApplyTemplate(TemplateTag tpl)
        {
            string output;

            if (this.Selector != null && this.Selector.Length > 0)
            {
                TokenSelector selector = TokenSelector.ToTokenSelector(this.Transformer, this.Selector);
                List <string> list     = selector.Matches(this.Transformer.Text, this);

                StringBuilder sb = new StringBuilder();
                foreach (string match in list)
                {
                    if (match != null && match.Length > 0)
                    {
                        sb.Append(tpl.Apply(match));
                    }
                }
                return(sb.ToString());
            }

            output = this.ManagedTokensToString();
            return(tpl.Apply(output != null && output.Length > 0 ? output : this.Value));
        }
Пример #2
0
        public virtual string ApplyTemplate(TemplateTag tpl)
        {
            string output;
            if (this.Selector != null && this.Selector.Length > 0)
            {
                TokenSelector selector = TokenSelector.ToTokenSelector(this.Transformer, this.Selector);
                List<string> list = selector.Matches(this.Transformer.Text, this);

                StringBuilder sb = new StringBuilder();
                foreach (string match in list)
                {
                    if (match != null && match.Length > 0)
                    {
                        sb.Append(tpl.Apply(match));
                    }
                }
                return sb.ToString();
            }
            
            output = this.ManagedTokensToString();
            return tpl.Apply(output != null && output.Length > 0 ? output : this.Value);
        }