예제 #1
0
 public WebFormsVisitor(TemplateOptions o)
     : base(o)
 {
     _sb = new StringBuilder();
     _stack = new Stack<StringBuilder>();
     _partialMethod = Options.GetPartialRenderMethod();
 }
예제 #2
0
 public WebFormsVisitor()
     : base()
 {
     _sb = new StringBuilder();
     _stack = new Stack<StringBuilder>();
     Options.PartialRenderMethodType = typeof(WebFormsHtmlHelperPartialMethod);
     _partialMethod = Options.GetPartialRenderMethod();
 }
예제 #3
0
        public CodeDomVisitor()
        {
            _methods = new Dictionary<string, CodeMemberMethod>();
            _stack = new Stack<string>();
            _writerName = "textWriter";
            _blockCount = 0;
            _builder = new StringBuilder();

            _containsContent = new CodeMemberMethod();
            _containsContent.Parameters.Add(
                    new CodeParameterDeclarationExpression(
                        new CodeTypeReference(typeof(string)),
                        "name"
                    )
                );
            _containsContent.ReturnType = new CodeTypeReference(typeof(bool));
            _containsContent.Name = "ContainsContent";
            _containsContent.Attributes = MemberAttributes.Public | MemberAttributes.Override;

            _runContent = new CodeMemberMethod();
            _runContent.Parameters.Add(
                    new CodeParameterDeclarationExpression(
                        new CodeTypeReference(typeof(TextWriter)),
                        "textWriter"
                    )
                );
            _runContent.Parameters.Add(
                    new CodeParameterDeclarationExpression(
                        new CodeTypeReference(typeof(string)),
                        "name"
                    )
                );
            _runContent.Name = "RunContent";
            _runContent.Attributes = MemberAttributes.Public | MemberAttributes.Override;

            _partialMethod = Options.GetPartialRenderMethod();

            _endBlockStatements = new Stack<CodeObject>();
        }