/// <summary>
        /// Создание начальных записей в левой колонке.
        /// </summary>
        public void CreateInitData()
        {
            if (DBInterface != null &&
                DBInterface.TableType != null)
            {
                MemberInits.Clear();

                Type initType = DBInterface.TableType;

                int             recordCount = 0;
                PropertyInfoExs infos1      = GetProperties(initType);
                foreach (PropertyInfoEx prInfo1 in infos1)
                {
                    TableMemberInfo tmInfo2 = AnalisProperty(prInfo1, null, ref recordCount);
                    if (tmInfo2 == null)
                    {
                        break;
                    }
                    MemberInits.Add(tmInfo2);

                    PropertyInfoExs prInfos2 = GetProperties(prInfo1);

                    CreateInitData(prInfos2, tmInfo2, ref recordCount, 1);
                }
                lblTotalCount.Caption = string.Format("Всего: {0}", recordCount);

                treeInit.DataSource = null;
                treeInit.DataSource = MemberInits;
            }
        }
Пример #2
0
        /// <summary>
        /// Создание списка возможных типов таблицы.
        /// </summary>
        public void GenerateInitTables()
        {
            if (DBForm.TypeDiscoveryService != null)
            {
                ICollection types = DBForm.TypeDiscoveryService.GetTypes(typeof(DBViewBase), false);
                foreach (Type actionType in types)
                {
                    if (actionType != typeof(DBViewBase))
                    {
                        ViewMemberInfo info = new ViewMemberInfo();
                        info.ViewType = actionType;
                        info.Caption  = DBAttribute.GetCaption(actionType);

                        string name = DBAttribute.GetIconFile(info.ViewType);

                        string dir = DBForm.GetImageFullName(name);
                        if (dir != "" && File.Exists(dir) && !ImageEx.IsExist(imgInit, name))
                        {
                            imgInit.AddImage(Image.FromFile(dir), name);
                        }

                        info.ImageIndex = ImageEx.GetImageIndex(imgInit, name);
                        info.ImageName  = name;
                        if (MemberExists.FindInfo(info) != null)
                        {
                            info.IsUsed = true;
                        }

                        MemberInits.Add(info);
                    }
                }
                lblTotalCount.Caption = string.Format("Всего: {0}", types.Count);
            }
        }
        /// <summary>
        /// Очистка записи.
        /// </summary>
        public void UnuseInitTable(TableMemberInfo tmInfo)
        {
            TableMemberInfo infoInit = MemberInits.FindInfo(tmInfo);

            if (infoInit != null)
            {
                infoInit.IsUsed = false;
            }
        }