Esempio n. 1
0
        private IBraceStacker GetStacker(RainbowColoringMode mode)
        {
            switch (mode)
            {
            case RainbowColoringMode.Unified:
                return(new UnifiedBraceStacker());

            case RainbowColoringMode.PerBrace:
                return(new PerBraceStacker(this.BraceChars));

            default:
                throw new InvalidOperationException("Invalid rainbow coloring mode");
            }
        }
Esempio n. 2
0
        public TextBufferBraces(ITextSnapshot snapshot, ILanguage language, RainbowColoringMode coloringMode)
        {
            this.Snapshot = snapshot;
              this.LastParsedPosition = -1;
              this.language = language;
              this.coloringMode = coloringMode;
              this.braceList = new SortedList<char, char>();
              this.braces = new List<BracePos>();
              this.braceErrors = new List<CharPos>();

              if ( this.language != null ) {
            this.braceScanner = this.language.GetService<IBraceScanner>();

            this.braceList.Clear();
            this.BraceChars = this.braceScanner.BraceList;
            for ( int i = 0; i < BraceChars.Length; i += 2 ) {
              this.braceList.Add(BraceChars[i], BraceChars[i + 1]);
            }
              }
        }
Esempio n. 3
0
        public TextBufferBraces(ITextSnapshot snapshot, ILanguage language, RainbowColoringMode coloringMode)
        {
            this.Snapshot           = snapshot;
            this.LastParsedPosition = -1;
            this.language           = language;
            this.coloringMode       = coloringMode;
            this.braceList          = new SortedList <char, char>();
            this.braces             = new List <BracePos>();
            this.braceErrors        = new List <CharPos>();

            if (this.language != null)
            {
                this.braceScanner = this.language.GetService <IBraceScanner>();

                this.braceList.Clear();
                this.BraceChars = this.braceScanner.BraceList;
                for (int i = 0; i < BraceChars.Length; i += 2)
                {
                    this.braceList.Add(BraceChars[i], BraceChars[i + 1]);
                }
            }
        }
Esempio n. 4
0
 private IBraceStacker GetStacker(RainbowColoringMode mode)
 {
     switch ( mode ) {
     case RainbowColoringMode.Unified:
       return new UnifiedBraceStacker();
     case RainbowColoringMode.PerBrace:
       return new PerBraceStacker(this.BraceChars);
     default:
       throw new InvalidOperationException("Invalid rainbow coloring mode");
       }
 }