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"); } }
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]); } } }
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]); } } }
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"); } }