/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="cache">The Fdo cache</param> /// <param name="viewTypeId">An identifier for a group of views that share the same /// height estimator</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public static IParagraphCounter GetParaCounter(FdoCache cache, int viewTypeId) { ParaCounterKey key = new ParaCounterKey(cache, viewTypeId); IParagraphCounter counter = null; if (!s_paraCounters.ContainsKey(key) && s_paraCounterType != null) { counter = (IParagraphCounter)Activator.CreateInstance(s_paraCounterType, new object[] { cache }); Debug.Assert(counter != null); s_paraCounters[key] = counter; } // May need another try to get it, since it may not get created, above. if (counter == null) { s_paraCounters.TryGetValue(key, out counter); } return(counter); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="cache">The Fdo cache</param> /// <param name="viewTypeId">An identifier for a group of views that share the same /// height estimator</param> /// <returns></returns> /// ------------------------------------------------------------------------------------ public static IParagraphCounter GetParaCounter(FdoCache cache, int viewTypeId) { ParaCounterKey key = new ParaCounterKey(cache, viewTypeId); IParagraphCounter counter = null; if (!s_paraCounters.ContainsKey(key) && s_paraCounterType != null) { counter = (IParagraphCounter)Activator.CreateInstance(s_paraCounterType, new object[] { cache }); Debug.Assert(counter != null); s_paraCounters[key] = counter; } // May need another try to get it, since it may not get created, above. if (counter == null) s_paraCounters.TryGetValue(key, out counter); return counter; }