public static Item CreateTypedItem(ItemWrapper itemWrapper) { return (itemWrapper != null && TypeMappings.ContainsKey(itemWrapper.GetType())) ? TypeMappings[itemWrapper.GetType()].InvokeMember("ctor", System.Reflection.BindingFlags.CreateInstance, null, null, new object[] { itemWrapper }) as Item : new Item(itemWrapper); }
/// <summary> /// Gets the template ID attribute of the item wrapper. /// </summary> /// <param name="itemWrapper">The item wrapper.</param> /// <returns></returns> public static TemplateIdAttribute GetTemplateIdAttribute(this ItemWrapper itemWrapper) { return(GetTemplateIdAttribute(itemWrapper.GetType())); }