예제 #1
0
        public Constraint_TreeNode(ITableSource conn, ITableStructure table, IConstraint constraint, ITreeNode parent)
            : base(conn, parent, constraint.Name ?? "noname")
        {
            m_constraint = constraint;
            m_table      = table;
            m_conn       = conn;

            var appobj = new ConstraintAppObject();

            appobj.FillFromTable(m_conn);
            appobj.Constraint = Constraint.CreateCopy(m_constraint);
            SetAppObject(appobj);
        }
예제 #2
0
        public override void GetObjectList(List <AppObject> objs, AppObject appobj, ConnectionPack connpack)
        {
            ObjectPath      objpath = appobj.GetObjectPath();
            IDatabaseSource conn    = appobj.FindDatabaseConnection(connpack);

            if (conn != null && conn.Connection.IsOpened)
            {
                var ts = conn.InvokeLoadTableStructure(objpath.ObjectName, TableStructureMembers.ConstraintsNoRefs);
                foreach (var cnt in ts.Constraints)
                {
                    var cobj = new ConstraintAppObject();
                    cobj.Constraint = Constraint.CreateCopy(cnt);
                    cobj.FillFromTable(conn.GetTable(objpath.ObjectName));
                    objs.Add(cobj);
                }
            }
            objs.SortByKey(o => o.ToString());
        }