// 返回一个做数据容器的block(可以作为数据容器,并包括tokens信息) public IBlock GetBlock(String blockName) { if (_isTemplateExist == false) { throw new Exception(lang.get("exTemplateNotExist")); } BlockToken blockToken = getBlockToken(blockName); if (blockToken == null) { throw new Exception(lang.get("exBlockExist") + ":" + blockName); } ContentBlock block = new ContentBlock(); block.Name = blockName; block._thisToken = blockToken; // 将上级变量放入下级循环可用 block._blockData = new BlockData(_blockData.getDic()); _blockData.addBlock(block); return(block); }
/// <summary> /// 返回一个做数据容器的block(可以作为数据容器,并包括tokens信息) /// </summary> /// <param name="blockName"></param> /// <returns></returns> public IBlock GetBlock(String blockName) { if (_isTemplateExist == false) { throw new TemplateException(lang.get("exTemplateNotExist") + ": " + _templatePath); } BlockToken blockToken = getBlockToken(blockName); if (blockToken == null) { throw new TemplateException( string.Format(lang.get("exBlockExist"), blockName, _templatePath, "<!-- BEGIN " + blockName + " -->") ); } ContentBlock block = new ContentBlock(); block.Name = blockName; block._thisToken = blockToken; block._templatePath = _templatePath; // 将上级变量放入下级循环可用 block._blockData = new BlockData(_blockData.getDic()); _blockData.addBlock(block); return(block); }
/// <summary> /// 返回一个做数据容器的block(可以作为数据容器,并包括tokens信息) /// </summary> /// <param name="blockName"></param> /// <returns></returns> public IBlock GetBlock( String blockName ) { if (_isTemplateExist == false) { throw new TemplateException( lang.get( "exTemplateNotExist" ) + ": " + _templatePath ); } BlockToken blockToken = getBlockToken( blockName ); if (blockToken == null) throw new TemplateException( string.Format( lang.get( "exBlockExist" ), blockName, _templatePath, "<!-- BEGIN " + blockName + " -->" ) ); ContentBlock block = new ContentBlock(); block.Name = blockName; block._thisToken = blockToken; block._templatePath = _templatePath; // 将上级变量放入下级循环可用 block._blockData = new BlockData( _blockData.getDic() ); _blockData.addBlock( block ); return block; }
// 返回一个做数据容器的block(可以作为数据容器,并包括tokens信息) public IBlock GetBlock( String blockName ) { if (_isTemplateExist == false) throw new Exception( lang.get( "exTemplateNotExist" ) ); BlockToken blockToken = getBlockToken( blockName ); if (blockToken == null) throw new Exception( lang.get( "exBlockExist" ) + ":" + blockName ); ContentBlock block = new ContentBlock(); block.Name = blockName; block._thisToken = blockToken; // 将上级变量放入下级循环可用 block._blockData = new BlockData( _blockData.getDic() ); _blockData.addBlock( block ); return block; }