Beispiel #1
0
 private void ProcessOutput(Output output)
 {
     ProcessDirectives(output.Directives, EscapeToCSharp(output.WriterKey));
 }
Beispiel #2
0
        private void ParseOutputStart(string line)
        {
            Assertion.Assert(line != null, "line cannot be null.");

            string trimedLine = line.TrimStart();
            string key = trimedLine.Substring(OutputStartDirective.Length).Trim();

            if (trimedLine.Length == OutputStartDirective.Length ||
                trimedLine[OutputStartDirective.Length] != ' ' ||
                key.Length == 0)
            {
                TemplateParsingException ex =
                    new TemplateParsingException(
                        Resources.NoOutputKeyProvided);
                FillParseError(ex);
                throw ex;
            }

            Output output = new Output(key);
            this.currentDirective.Directives.Add(output);
            this.currentDirective = output;

            this.outputStack.Push(
                new OutputContext(
                    key,
                    line.Substring(0, CountLeadingWhiteSpace(line))));

            this.contextStack.Push(new Context(TemplateMode.Static, ""));
        }