Exemplo n.º 1
0
 public static IPhysicalConnection FindPhysicalConnection(this AppObject appobj, ConnectionPack connpack)
 {
     if (connpack == null)
     {
         return(null);
     }
     return(connpack.GetConnection(appobj.GetConnection(), false));;
 }
Exemplo n.º 2
0
        public static T ChangeConnection <T>(this T usage, ConnectionPack connpack)
            where T : IConnectionUsage
        {
            if (usage.Connection == null)
            {
                throw new InternalError("DAE-00009 Connection property not set");
            }
            var conn = connpack.GetConnection(usage.Connection.PhysicalFactory, true);

            usage.Connection = conn;
            return(usage);
        }
Exemplo n.º 3
0
        public void GetWidgetsEx(List <IWidget> res, ConnectionPack connpack)
        {
            GetWidgets(res);
            var conn = connpack.GetConnection(GetConnection(), false);

            if (conn != null)
            {
                var dialect = conn.Dialect;
                if (dialect != null)
                {
                    dialect.GetAdditionalWidgets(res, this);
                }
            }
        }
Exemplo n.º 4
0
        public IDatabaseSource GetDatabaseConnection(ConnectionPack connpack)
        {
            if (connpack == null)
            {
                return(null);
            }
            var phys = connpack.GetConnection(Connection, true);

            if (phys == null)
            {
                return(null);
            }
            return(phys.PhysicalFactory.CreateDatabaseSource(phys, DatabaseName));
        }
Exemplo n.º 5
0
        public IServerSource GetServerConnection(ConnectionPack connpack)
        {
            if (connpack == null)
            {
                return(null);
            }
            var phys = connpack.GetConnection(Connection, true);

            if (phys == null)
            {
                return(null);
            }
            return(phys.PhysicalFactory.CreateServerSource(phys));
        }
Exemplo n.º 6
0
        public virtual ISqlDialect GetDialect(AppObject appobj, ConnectionPack connpack)
        {
            var dbobj = appobj as DatabaseFieldsAppObject;

            if (dbobj == null)
            {
                return(GenericDialect.Instance);
            }
            IDatabaseSource db = dbobj.GetDatabaseConnection(connpack);

            if (db != null && db.Dialect != null)
            {
                return(db.Dialect);
            }
            IPhysicalConnection conn = connpack.GetConnection(appobj.GetConnection(), false);

            if (conn == null)
            {
                return(GenericDialect.Instance);
            }
            return(conn.Dialect ?? GenericDialect.Instance);
        }