コード例 #1
0
        protected override object CreateInstance(Type itemType)
        {
            DBInterface dbInterface = FindDBInterface();

            if (dbInterface != null)
            {
                return(dbInterface.CreateInstance(itemType));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 /// <summary>
 /// Ручное создание элемента коллекции.
 /// </summary>
 public DBInterfaceItemBase CreateInstance(Type type)
 {
     return(DBInterface.CreateInstance(type, infoSelect: SelectedExistInfo, treeList: treeExist, MemberExists: MemberExists));
 }