Exemplo n.º 1
0
        protected override string DoProcess(dynamic args, string content)
        {
//            var rtn = new StringBuilder();
//            rtn.Append(@"#hjs{else" + SymbalCode.LEFT_BRACE + @"}
//    " + content + @"
//#hjs{" + SymbalCode.RIGHT_BRACE + @"}");
//            return rtn.ToString();
            return(ForTag.ProcessForIfElse(this.TagName, args, content));
        }
Exemplo n.º 2
0
        public HostViewContext()
        {
            RootPath       = GlobalCommon.HostCommon.RootPath;
            RunTimeLibPath = GlobalCommon.HostCommon.RootPath + HostJsConstants.COMPILED_ROOT_PATH;
            CommonLibPath  = GlobalCommon.HostCommon.RootPath;
            var viewdoc = new ViewDocument(_currentjse);

            _hostobject.Add(viewdoc.Name, viewdoc);
            var console = new ConsoleObject();

            _hostobject.Add(console.Name, console);
            var document = new JsDocument(_currentjse, RootPath);

            _hostobject.Add(document.Name, document);
            var comfunc = new ComFuncObject();

            _hostobject.Add(comfunc.Name, comfunc);

            var loadtag   = new LoadParser();
            var reftag    = new RefParser();
            var copytag   = new CopyParser();
            var outtag    = new OutTag();
            var hjstag    = new HjsTag();
            var fortag    = new ForTag();
            var iftag     = new IfTag();
            var elseiftag = new ElseIfTag();
            var elsetag   = new ElseTag();

            //按照先后处理标签的顺序进行标签处理
            _hosttag.Add(loadtag.TagName, loadtag);
            _hosttag.Add(reftag.TagName, reftag);
            _hosttag.Add(copytag.TagName, copytag);
            //out会变为hjs标签
            _hosttag.Add(outtag.TagName, outtag);
            _hosttag.Add(iftag.TagName, iftag);
            _hosttag.Add(elseiftag.TagName, elseiftag);
            _hosttag.Add(elsetag.TagName, elsetag);
            _hosttag.Add(fortag.TagName, fortag);
            _hosttag.Add(hjstag.TagName, hjstag);
        }