static OffsetAndCachedColors() { var coll = new CachedTextColorsCollection(); coll.Freeze(); Default = new OffsetAndCachedColors(0, coll); }
public void AddOrUpdate(int docOffset, CachedTextColorsCollection newCachedTextColorsCollection) { for (int i = 0; i < cachedColorsList.Count; i++) { int mi = (previousReturnedIndex + i) % cachedColorsList.Count; var info = cachedColorsList[mi]; if (info.Offset == docOffset) { cachedColorsList[mi] = new OffsetAndCachedColors(docOffset, newCachedTextColorsCollection); return; } } Add(docOffset, newCachedTextColorsCollection); }
public void AddOrUpdate(int docOffset, CachedTextColorsCollection newCachedTextColorsCollection) { for (int i = 0; i < cachedColorsList.Count; i++) { int mi = (previousReturnedIndex + i) % cachedColorsList.Count; var info = cachedColorsList[mi]; if (info.Offset == docOffset) { cachedColorsList[mi] = new OffsetAndCachedColors(docOffset, newCachedTextColorsCollection); return; } } Add(docOffset, newCachedTextColorsCollection); }