示例#1
0
 public static SpanConstructor AutoCompleteWith(
     this SpanConstructor self,
     string autoCompleteString
     )
 {
     return(AutoCompleteWith(self, autoCompleteString, atEndOfSpan: false));
 }
示例#2
0
 public static SpanConstructor Accepts(
     this SpanConstructor self,
     AcceptedCharacters accepted
     )
 {
     return(self.With(eh => eh.AcceptedCharacters = accepted));
 }
示例#3
0
 public static SpanConstructor AutoCompleteWith(this SpanConstructor self, string autoCompleteString, bool atEndOfSpan)
 {
     return(self.With(new AutoCompleteEditHandler(SpanConstructor.TestTokenizer)
     {
         AutoCompleteString = autoCompleteString, AutoCompleteAtEndOfSpan = atEndOfSpan
     }));
 }
示例#4
0
        protected virtual Block CreateSimpleBlockAndSpan(string spanContent, BlockType blockType, SpanKind spanType, AcceptedCharacters acceptedCharacters = AcceptedCharacters.Any)
        {
            SpanConstructor span = Factory.Span(spanType, spanContent, spanType == SpanKind.Markup).Accepts(acceptedCharacters);
            BlockBuilder    b    = new BlockBuilder()
            {
                Type = blockType
            };

            return(ConfigureAndAddSpanToBlock(b, span));
        }
示例#5
0
        protected virtual Block ConfigureAndAddSpanToBlock(BlockBuilder block, SpanConstructor span)
        {
            switch (block.Type)
            {
            case BlockType.Markup:
                span.With(new MarkupCodeGenerator());
                break;

            case BlockType.Statement:
                span.With(new StatementCodeGenerator());
                break;

            case BlockType.Expression:
                block.CodeGenerator = new ExpressionCodeGenerator();
                span.With(new ExpressionCodeGenerator());
                break;
            }
            block.Children.Add(span);
            return(block.Build());
        }
 public UnclassifiedCodeSpanConstructor(SpanConstructor self)
 {
     _self = self;
 }
示例#7
0
 public UnclassifiedCodeSpanConstructor(SpanConstructor self)
 {
     _self = self;
 }
示例#8
0
 public static SpanConstructor WithEditorHints(this SpanConstructor self, EditorHints hints)
 {
     return(self.With(eh => eh.EditorHints = hints));
 }
 protected virtual Block ConfigureAndAddSpanToBlock(BlockBuilder block, SpanConstructor span)
 {
     switch (block.Type)
     {
         case BlockType.Markup:
             span.With(new MarkupCodeGenerator());
             break;
         case BlockType.Statement:
             span.With(new StatementCodeGenerator());
             break;
         case BlockType.Expression:
             block.CodeGenerator = new ExpressionCodeGenerator();
             span.With(new ExpressionCodeGenerator());
             break;
     }
     block.Children.Add(span);
     return block.Build();
 }