/// <summary> /// Returns the data entry to the pool. /// </summary> private void ReturnToPool(LexiconFocusData data) { List <LexiconFocusData> dataPool; if (focusDataPool.TryGetValue(data.GetType(), out dataPool)) { dataPool.Add(data); } else { List <LexiconFocusData> newPool = new List <LexiconFocusData>(); newPool.Add(data); focusDataPool.Add(data.GetType(), newPool); } }
/// <summary> /// Record a focus data entry. /// </summary> public void AddFocusData(LexiconFocusData data) { List <LexiconFocusData> dataEntries; if (focusDataDict.TryGetValue(data.GetType(), out dataEntries)) { dataEntries.Add(data); } else { List <LexiconFocusData> newList = new List <LexiconFocusData>(); newList.Add(data); focusDataDict.Add(data.GetType(), newList); } }