Пример #1
0
 public SpecificObjectsNode(IDatabaseSource conn, ITreeNode parent, ISpecificObjectType dbtype, ISpecificRepresentation repr, ObjectPath parpath, bool isSystem)
     : base(conn, parent, Texts.GetTextIdWithoutPrefix(repr.TitlePlural))
 {
     m_conn     = conn;
     m_dbtype   = dbtype;
     m_repr     = repr;
     m_parpath  = parpath;
     m_isSystem = isSystem;
 }
Пример #2
0
        //public static IAppObjectSqlGenerator[] GetSqlGenerators(this ITreeNode node)
        //{
        //    List<IAppObjectSqlGenerator> res = new List<IAppObjectSqlGenerator>();
        //    if (node == null) return res.ToArray();
        //    res.AddRange(node.GetSqlGenerators());
        //    return res.ToArray();
        //}

        public static void GetDbObjectNodes(this ITreeNode parent, IDatabaseSource conn, List <ITreeNode> res, DbObjectParent parentType, ObjectPath parpath, bool isSystem)
        {
            foreach (ISpecificObjectType dbtype in conn.GetSpecificTypes())
            {
                if (dbtype.ParentType == parentType)
                {
                    if (isSystem && !dbtype.HasSystemVariant)
                    {
                        continue;
                    }
                    var repr = SpecificRepresentationAddonType.Instance.FindRepresentation(dbtype.ObjectType);
                    if (!repr.ShowInTree)
                    {
                        continue;
                    }
                    res.Add(new SpecificObjectsNode(conn, parent, dbtype, repr, parpath, isSystem));
                }
            }
        }
Пример #3
0
        //ISpecificObjectStructure m_struct;

        public SpecificObjectNode(SpecificObjectsNode parent, IDatabaseSource conn, ISpecificObjectType dbtype, ISpecificRepresentation repr, ObjectPath objpath)
            : base(new ConnectionWrapperUsage(parent.GetConnection()), parent, objpath.ObjectName.ToString())
        {
            m_dbtype  = dbtype;
            m_repr    = repr;
            m_objpath = objpath;
            m_conn    = conn;
            m_objCaps = m_conn.AlterCaps[m_dbtype.ObjectType];
            var appobj = new SpecificObjectAppObject();

            appobj.FillFromDatabase(conn);
            appobj.DbObjectName = m_objpath.ObjectName;
            appobj.DbObjectType = dbtype.ObjectType;
            SetAppObject(appobj);
        }