public static void SafeReconnect(IPhysicalConnection conn) { IAsyncResult res = conn.BeginInvoke((Action)conn.Reconnect, null); Async.WaitFor(res); conn.EndInvoke(res); }
private void RefreshedTables(IAsyncResult async) { try { Connection.EndInvoke(async); } catch (Exception err) { Errors.Report(err); } lbxAvailableTables.Items.Clear(); if (m_availableTableNames != null) { foreach (var tbl in m_availableTableNames) { lbxAvailableTables.Items.Add(new FullDatabaseRelatedName { ObjectName = tbl, ObjectType = "table" }); } } lbxAvailableViews.Items.Clear(); if (m_availableViewNames != null) { foreach (var tbl in m_availableViewNames) { lbxAvailableViews.Items.Add(new FullDatabaseRelatedName { ObjectName = tbl, ObjectType = "view" }); } } }
//public static List<NameWithSchema> InvokeLoadFullTableNames(this IPhysicalConnection conn, string dbname) //{ // DatabaseStructureMembers dbmem = new DatabaseStructureMembers { TableList = true }; // IDatabaseStructure dbs = conn.InvokeLoadStructure(dbname, dbmem); // return dbs.GetTableNames(); //} public static IDatabaseStructure InvokeLoadStructure(this IPhysicalConnection conn, string dbname, DatabaseStructureMembers members, IProgressInfo progress) { IAsyncResult async = conn.BeginInvoke( (Func <IDatabaseStructure>) delegate() { return(conn.Dialect.AnalyseDatabase(conn, dbname, members, progress)); }, null); Async.WaitFor(async); return((IDatabaseStructure)conn.EndInvoke(async)); }
public static ITableStructure InvokeLoadStructure(this ITableSource table, TableStructureMembers members) { IPhysicalConnection conn = table.Connection; if (conn == null) { return(table.LoadTableStructure(members)); } IAsyncResult async = conn.BeginInvoke((Func <TableStructureMembers, ITableStructure>)table.LoadTableStructure, null, members); Async.WaitFor(async); return((ITableStructure)conn.EndInvoke(async)); }
public ITableStructure EndGetRowFormat(IAsyncResult async) { return((ITableStructure)m_conn.EndInvoke(async)); }