Пример #1
0
        /// <summary>
        /// Transforms the specified container.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="source">The source.</param>
        /// <param name="target">The target.</param>
        private void Transform(TemplateContainer container, string source, string target)
        {
            string file = this.GetFile(source);

            if (!string.IsNullOrEmpty(file))
            {
                container.AddAttribute("IteratorCurrentSource", source);
                container.AddAttribute("IteratorCurrentTarget", target);
                string transformed = TemplateTransformer.Transform(file);
                string outputFile  = JavascriptEvaluator.ReplaceString(transformed, container);
                StringUtil.WriteFile(target, outputFile);
            }
        }
Пример #2
0
        /// <summary>
        /// Transforms the specified template to javascript.
        /// </summary>
        /// <param name="s">The s.</param>
        /// <returns></returns>
        public static string Transform(string s)
        {
            TemplateTransformer tt = new TemplateTransformer(s);

            return(tt.Scan());
        }
Пример #3
0
 /// <summary>
 /// Transforms the specified template to javascript.
 /// </summary>
 /// <param name="s">The s.</param>
 /// <returns></returns>
 public static string Transform(string s)
 {
     TemplateTransformer tt = new TemplateTransformer(s);
     return tt.Scan();
 }