protected override object CreateInstance(Type itemType) { DBInterface dbInterface = FindDBInterface(); if (dbInterface != null) { return(dbInterface.CreateInstance(itemType)); } else { return(null); } }
/// <summary> /// Автоматическое создание элемента коллекции. /// </summary> public DBInterfaceItemBase CreateInstance(TableMemberInfo tmInfo) { DBInterfaceItemBase item = null; TableMemberInfo infoParent = null; TableMemberInfo infoSelect = null; int level = tmInfo.GetLevel(); for (int i = 0; i < level; i++) { infoParent = tmInfo.GetParent(level - i); infoSelect = MemberExists.FindInfo(infoParent.Parent); if (MemberExists.FindInfo(infoParent) == null) { item = DBInterface.CreateInstance(infoParent.PropertyType, infoParent, infoSelect, treeExist, MemberExists); } } return(item); }
/// <summary> /// Ручное создание элемента коллекции. /// </summary> public DBInterfaceItemBase CreateInstance(Type type) { return(DBInterface.CreateInstance(type, infoSelect: SelectedExistInfo, treeList: treeExist, MemberExists: MemberExists)); }