/// <summary> /// Creates new empty synchronized collection of same type. /// </summary> /// <returns></returns> public ListEx <T> CreateSynchronized() { Type synchronizedType = SynchronizedTypeBuilder.Get(GetType()); return((ListEx <T>)Activator.CreateInstance(synchronizedType)); }
/// <summary> /// Creates new empty synchronized dictionary of same type. /// </summary> /// <returns></returns> /// <example> /// This sample shows how to create synchronized instances. /// <code> /// public class StringDictionaryEx : DictionaryEx<string, string> /// { /// public StringDictionaryEx() /// { /// } /// } /// /// public class TestClass /// { /// private DictionaryEx<int, int> synchronizedDictionary = new DictionaryEx<int, int>.CreateSynchronized(); /// /// private StringDictionaryEx synchronizedStringDictionary = (StringDictionaryEx)new StringDictionaryEx().CreateSynchronized(); /// } /// </code> /// </example> public DictionaryEx <TKey, TValue> CreateSynchronized() { Type synchronizedType = SynchronizedTypeBuilder.Get(GetType()); return((DictionaryEx <TKey, TValue>)Activator.CreateInstance(synchronizedType)); }