//public static TypeSerializationInfo DictionaryItemInfo = new TypeSerializationInfo(typeof(DictionaryItem)); public static IDictionaryItem CreateDictionaryItem(Type type) { Type[] genericArguments = new Type[] { typeof(object), typeof(object) }; while (type != null) { if (type.IsGenericType) { genericArguments = type.GetGenericArguments(); break; } type = type.BaseType; } return((IDictionaryItem)TypeHelper.CreateObject(typeof(DictionaryItem <,>).MakeGenericType(genericArguments))); }
public virtual object NewItem() { return(TypeHelper.CreateObject(type)); }