Exemplo n.º 1
0
		public async Task ShowActualAsync(IConnectionAdapter connectionAdapter, CancellationToken cancellationToken)
		{
			ResetView();

			ExecutionStatisticsPlanItemCollection itemCollection = null;
			
			try
			{
				itemCollection = await ((OracleConnectionAdapterBase)connectionAdapter).GetCursorExecutionStatisticsAsync(cancellationToken);
			}
			catch (Exception exception)
			{
				var errorMessage = $"Execution statistics cannot be retrieved: {Messages.GetExceptionErrorMessage(exception)}";
				_outputViewer.AddExecutionLog(DateTime.Now, errorMessage);
				Messages.ShowError(errorMessage);
			}

			if (itemCollection == null)
			{
				return;
			}
			
			SetRootItem(itemCollection.RootItem);
			TextExecutionPlan = itemCollection.PlanText;

			if (itemCollection.RootItem == null)
			{
				TabPlainText.IsSelected = true;
			}
			else
			{
				TotalExecutions = itemCollection.RootItem.Executions;
			}
		}
Exemplo n.º 2
0
        public IList <DatabaseIndex> Execute(IConnectionAdapter connectionAdapter)
        {
            ExecuteDbReader(connectionAdapter);

            foreach (var index in Result)
            {
                var name = index.Name;
                using (var cmd = BuildCommand(connectionAdapter))
                {
                    cmd.CommandText = string.Format(PragmaSql, name);
                    int ordinal = 0;
                    using (var dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            var colName = dr.GetString("name");
                            var col     = new DatabaseColumn
                            {
                                Name    = colName,
                                Ordinal = ordinal,
                            };
                            index.Columns.Add(col);
                            ordinal++;
                        }
                    }
                }
            }

            return(Result);
        }
Exemplo n.º 3
0
        public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
        {
            var hasGeneratedColumns = false; //introduced in MySQL 5.7.6
            var cmd = BuildCommand(connectionAdapter);

            //step 1- check what's in info schema (backwards compatible)
            cmd.CommandText = @"SELECT * 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE
(TABLE_SCHEMA = @schemaOwner OR @schemaOwner IS NULL)
LIMIT 1";
            AddDbParameter(cmd, "schemaOwner", Owner);
            using (var dr = cmd.ExecuteReader())
            {
                while (dr.Read())
                {
                    for (var i = 0; i < dr.FieldCount; i++)
                    {
                        if (dr.GetName(i).Equals("GENERATION_EXPRESSION", StringComparison.OrdinalIgnoreCase))
                        {
                            hasGeneratedColumns = true;
                        }
                    }
                }
            }
            if (!hasGeneratedColumns)
            {
                return(new List <DatabaseColumn>());
            }

            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 4
0
 protected ResultSetDataGridTemplateSelector(IStatementValidator statementValidator, IConnectionAdapter connectionAdapter, string bindingPath)
 {
     _statementValidator   = statementValidator;
     _connectionAdapter    = connectionAdapter;
     TextDataTemplate      = CreateTextDataTemplate(bindingPath);
     HyperlinkDataTemplate = CreateHyperlinkDataTemplate(bindingPath, CellHyperlinkClickHandler);
     BarChartDataTemplate  = CreateBarChartDataTemplate(bindingPath);
 }
Exemplo n.º 5
0
 public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
 {
     if (Version(connectionAdapter.DbConnection) < 12)
     {
         return(new List <DatabaseColumn>());
     }
     ExecuteDbReader(connectionAdapter);
     return(Result);
 }
Exemplo n.º 6
0
        public SingleRowDataTemplateSelector(IStatementValidator statementValidator, IConnectionAdapter connectionAdapter)
            : base(statementValidator, connectionAdapter, ValueProperty)
        {
            var textBlockFactory = TextDataTemplate.VisualTree;

            textBlockFactory.SetValue(FrameworkElement.HorizontalAlignmentProperty, HorizontalAlignment.Left);

            textBlockFactory = HyperlinkDataTemplate.VisualTree;
            textBlockFactory.SetValue(FrameworkElement.HorizontalAlignmentProperty, HorizontalAlignment.Left);
        }
Exemplo n.º 7
0
		public static void InitializeDataGridColumns(DataGrid dataGrid, IEnumerable<ColumnHeader> columnHeaders, IStatementValidator statementValidator, IConnectionAdapter connectionAdapter)
		{
			dataGrid.Columns.Clear();

			foreach (var columnHeader in columnHeaders)
			{
				var columnTemplate = CreateDataGridTemplateColumn(columnHeader, statementValidator, connectionAdapter);
				dataGrid.Columns.Add(columnTemplate);
			}
		}
Exemplo n.º 8
0
 public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
 {
     if (Version(connectionAdapter.DbConnection) < 11)
     {
         //only supported in 11g+
         return(new List <DatabaseColumn>());
     }
     ExecuteDbReader(connectionAdapter);
     return(Result);
 }
Exemplo n.º 9
0
 public IList <DatabaseFunction> Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         ExecuteDbReader(connectionAdapter);
     }
     catch (DbException ex)
     {
         System.Diagnostics.Trace.WriteLine("Error reading oracle functions " + ex.Message);
     }
     return(Result);
 }
Exemplo n.º 10
0
        private string LookUpTypes(IConnectionAdapter connectionAdapter, long id)
        {
            const string sqlCommand =
                @"SELECT pg_catalog.format_type(:oid, NULL)";

            using (var cmd = BuildCommand(connectionAdapter))
            {
                cmd.CommandText = sqlCommand;
                AddDbParameter(cmd, "oid", id);
                return((string)cmd.ExecuteScalar());
            }
        }
Exemplo n.º 11
0
 public IList <DatabaseArgument> Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         ExecuteDbReader(connectionAdapter);
     }
     catch (Exception e)
     {
         Trace.WriteLine("Could not read parameters (older MySql does not have Information_Schema.Paramaters: " + e);
     }
     return(Result);
 }
Exemplo n.º 12
0
        public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
        {
            var sv = connectionAdapter.DbConnection.ServerVersion;

            if (!sv.Contains("Firebird 3"))
            {
                _isFirebird3 = false;
                Firebird2Sql();
            }

            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 13
0
 public IList <DatabaseTrigger> Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         ExecuteDbReader(connectionAdapter);
     }
     catch (DbException dbException)
     {
         Trace.WriteLine(dbException);
         Trace.TraceWarning("Azure Synapse does not expose trigger information");
     }
     return(Result);
 }
Exemplo n.º 14
0
 public IList <ProcedureSource> Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         ExecuteDbReader(connectionAdapter);
     }
     catch (DbException exception)
     {
         //1. Security does not allow access
         Trace.TraceError("Handled: " + exception);
         //continue without the source
     }
     return(Result);
 }
Exemplo n.º 15
0
 public IList <ProcedureSource> Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         ExecuteDbReader(connectionAdapter);
     }
     catch (DbException exception)
     {
         //1. Security does not allow access
         //2. OBJECT_SCHEMA_NAME is only available from SQLServer 2005 SP2
         Trace.TraceError("Handled: " + exception);
         //continue without the source
     }
     return(Result);
 }
Exemplo n.º 16
0
 public IList <DatabaseSequence> Execute(IConnectionAdapter connectionAdapter, int serverVersion)
 {
     try
     {
         if (serverVersion >= 100000)
         {
             Sql = Sql10; //use pgSequences
         }
         ExecuteDbReader(connectionAdapter);
     }
     catch (DbException ex)
     {
         System.Diagnostics.Trace.WriteLine("Error reading PostgreSql sequences " + ex.Message);
     }
     return(Result);
 }
 public Binance(IConnectionAdapter connectionAdapter)
 {
     CurrentPrices      = new Dictionary <string, decimal>();
     Tickers            = new List <Ticker>();
     Accounts           = new List <Account>();
     AccountHistories   = new List <AccountHistory>();
     AccountHolds       = new List <AccountHold>();
     Products           = new List <Product>();
     HistoricRates      = new List <HistoricRate>();
     Fills              = new List <Fill>();
     Orders             = new List <Order>();
     OrderBook          = new OrderBook();
     SelectedProduct    = new Product();
     ServerTime         = new ServerTime(0);
     _connectionAdapter = connectionAdapter;
 }
Exemplo n.º 18
0
        public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
        {
            var tables = new Tables(CommandTimeout, _tableName).Execute(connectionAdapter);

            foreach (var table in tables)
            {
                var tableName = table.Name;
                using (var cmd = connectionAdapter.DbConnection.CreateCommand())
                {
                    cmd.CommandText = string.Format(PragmaSql, tableName);
                    if (CommandTimeout.HasValue && CommandTimeout.Value >= 0)
                    {
                        cmd.CommandTimeout = CommandTimeout.Value;
                    }
                    int ordinal = 0;
                    using (var dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            var colName = dr.GetString("name");
                            var col     = new DatabaseColumn
                            {
                                TableName   = tableName,
                                Name        = colName,
                                SchemaOwner = "",
                                Ordinal     = ordinal,
                                //type will be like "nvarchar(32)".
                                //Lengths /precisions could be parsed out (nb remember this is Sqlite)
                                DbDataType   = dr.GetString("type"),
                                Nullable     = !dr.GetBoolean("notnull"),
                                DefaultValue = dr.GetString("dflt_value"),
                                IsPrimaryKey = dr.GetBoolean("pk"),
                            };
                            if (col.IsPrimaryKey && col.DbDataType == "INTEGER")
                            {
                                col.IsAutoNumber = true;
                            }
                            Result.Add(col);
                            ordinal++;
                        }
                    }
                }
            }

            return(Result);
        }
Exemplo n.º 19
0
 public int Execute(IConnectionAdapter connectionAdapter)
 {
     try
     {
         //server_version_num available from 8.2 +
         var cmd = BuildCommand(connectionAdapter);
         cmd.CommandText = @"SELECT current_setting('server_version_num')"; //or SHOW server_version
         //bizarrely, although this is version in a numeric format, it comes back as a string
         return(int.Parse((string)cmd.ExecuteScalar(), NumberStyles.Any));
     }
     catch (Exception exception)
     {
         //possibly older than 8.2
         Trace.TraceError("Error reading postgresql version " + exception);
         return(1);
     }
 }
Exemplo n.º 20
0
        public IList <DatabaseArgument> Execute(IConnectionAdapter connectionAdapter)
        {
            _requiredDataTypes.Clear();
            ExecuteDbReader(connectionAdapter);

            //now lookup datatypes
            foreach (var key in _requiredDataTypes.Keys)
            {
                var typeName = LookUpTypes(connectionAdapter, key);
                foreach (var databaseArgument in _requiredDataTypes[key])
                {
                    databaseArgument.DatabaseDataType = typeName;
                }
            }
            _requiredDataTypes.Clear();
            return(Result);
        }
 public IList <DatabaseView> Execute(IConnectionAdapter connectionAdapter)
 {
     //or is there something on connection?
     try
     {
         var hasMatViewsTable = ServerVersion > 90300;
         if (hasMatViewsTable)
         {
             Sql = _sql93;
         }
         ExecuteDbReader(connectionAdapter);
     }
     catch (Exception exception)
     {
         //possibly older than 8.2
         Trace.TraceError("Error reading postgresql materialized views " + exception);
     }
     return(Result);
 }
Exemplo n.º 22
0
        public IList <DatabaseConstraint> Execute(IConnectionAdapter connectionAdapter)
        {
            var tables = new Tables(CommandTimeout, _tableName).Execute(connectionAdapter);

            foreach (var table in tables)
            {
                var tableName = table.Name;
                using (var cmd = connectionAdapter.DbConnection.CreateCommand())
                {
                    cmd.CommandText = string.Format(PragmaSql, tableName);
                    if (CommandTimeout.HasValue && CommandTimeout.Value >= 0)
                    {
                        cmd.CommandTimeout = CommandTimeout.Value;
                    }
                    using (var dr = cmd.ExecuteReader())
                    {
                        var columns = new List <string>();
                        while (dr.Read())
                        {
                            var  colName      = dr.GetString("name");
                            bool isPrimaryKey = dr.GetBoolean("pk");
                            if (isPrimaryKey == false)
                            {
                                continue;
                            }

                            columns.Add(colName);
                        }

                        var con = new DatabaseConstraint
                        {
                            TableName      = tableName,
                            SchemaOwner    = "",
                            ConstraintType = ConstraintType.PrimaryKey,
                        };
                        con.Columns.AddRange(columns);
                        Result.Add(con);
                    }
                }
            }

            return(Result);
        }
Exemplo n.º 23
0
        public IList <DatabaseConstraint> Execute(IConnectionAdapter connectionAdapter)
        {
            var tables = new Tables(CommandTimeout, _tableName).Execute(connectionAdapter);

            foreach (var table in tables)
            {
                var tableName = table.Name;
                using (var cmd = connectionAdapter.DbConnection.CreateCommand())
                {
                    cmd.CommandText = string.Format(PragmaSql, tableName);
                    if (CommandTimeout.HasValue && CommandTimeout.Value >= 0)
                    {
                        cmd.CommandTimeout = CommandTimeout.Value;
                    }
                    using (var dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            var refersToTable = dr.GetString("table");
                            var con           =
                                Result.FirstOrDefault(x => x.TableName == tableName && x.RefersToTable == refersToTable);
                            if (con == null)
                            {
                                con = new DatabaseConstraint
                                {
                                    TableName      = tableName,
                                    SchemaOwner    = "",
                                    ConstraintType = ConstraintType.ForeignKey,
                                    RefersToTable  = refersToTable,
                                    UpdateRule     = dr.GetString("on_update"),
                                    DeleteRule     = dr.GetString("on_delete"),
                                };
                                Result.Add(con);
                            }
                            con.Columns.Add(dr.GetString("from"));
                        }
                    }
                }
            }

            return(Result);
        }
Exemplo n.º 24
0
        public IList <DatabaseStoredProcedure> Execute(IConnectionAdapter connectionAdapter)
        {
            if (Version(connectionAdapter.DbConnection) < 11)
            {
                //In Oracle 10.2, ALL_PROCEDURES has no OBJECT_TYPE field. The OBJECT_TYPE field is in DBA_OBJECTS.
                Sql = @"SELECT P.OWNER,
  P.OBJECT_NAME,
  P.PROCEDURE_NAME,
  O.OBJECT_TYPE
FROM ALL_PROCEDURES P
INNER JOIN ALL_OBJECTS O ON O.OWNER = P.OWNER AND O.OBJECT_NAME = P.OBJECT_NAME
WHERE (P.OWNER = :OWNER OR :OWNER IS NULL)
AND (P.OBJECT_NAME = :NAME OR :NAME IS NULL)
AND (O.OBJECT_TYPE = 'PROCEDURE' OR O.OBJECT_TYPE = 'PACKAGE')
AND NOT (P.PROCEDURE_NAME IS NULL AND O.OBJECT_TYPE = 'PACKAGE')
AND P.OWNER NOT IN ('SYS', 'SYSMAN', 'CTXSYS', 'MDSYS', 'OLAPSYS', 'ORDSYS', 'OUTLN', 'WKSYS', 'WMSYS', 'XDB', 'ORDPLUGINS', 'SYSTEM')";
            }

            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 25
0
		public static DataGridColumn CreateDataGridTemplateColumn(ColumnHeader columnHeader, IStatementValidator statementValidator = null, IConnectionAdapter connectionAdapter = null)
		{
			var textBoxFactory = new FrameworkElementFactory(typeof(TextBox));
			textBoxFactory.SetValue(TextBoxBase.IsReadOnlyProperty, true);
			textBoxFactory.SetValue(TextBoxBase.IsReadOnlyCaretVisibleProperty, true);
			var valueBinding = new Binding($"[{columnHeader.ColumnIndex}]") { Converter = CellValueConverter.Instance };
			textBoxFactory.SetBinding(TextBox.TextProperty, valueBinding);
			var editingDataTemplate = new DataTemplate(typeof(DependencyObject)) { VisualTree = textBoxFactory };

			var columnTemplate =
				new DataGridTemplateColumn
				{
					CellTemplateSelector = new ResultSetDataGridTemplateSelector(statementValidator, connectionAdapter, columnHeader),
					CellEditingTemplate = editingDataTemplate,
					ClipboardContentBinding = valueBinding
				};

			ApplyColumnStyle(columnTemplate, columnHeader);

			return columnTemplate;
		}
Exemplo n.º 26
0
        public IList <DatabaseSequence> Execute(IConnectionAdapter connectionAdapter)
        {
            var cmd = BuildCommand(connectionAdapter);

            //step 1- check if there are any sequences (backwards compatible)
            cmd.CommandText = @"SELECT COUNT(*) 
FROM sys.objects 
WHERE type= 'SO' AND
(Schema_name(schema_id) = @schemaOwner OR @schemaOwner IS NULL)";
            AddDbParameter(cmd, "schemaOwner", Owner);
            var hasSequences = (int)cmd.ExecuteScalar() > 0;

            if (!hasSequences)
            {
                return(new List <DatabaseSequence>());
            }
            //step 2- they have them
            //we can use the SqlServer 2012 sys.sequences catalog view
            //renamed for compatibility with Oracle's ALL_SEQUENCES
            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 27
0
        public IList <DatabaseColumn> Execute(IConnectionAdapter connectionAdapter)
        {
            var views = new Views(_viewName).Execute(connectionAdapter);

            foreach (var view in views)
            {
                var viewName = view.Name;
                using (var cmd = connectionAdapter.DbConnection.CreateCommand())
                {
                    cmd.CommandText = string.Format(PragmaSql, viewName);
                    int ordinal = 0;
                    using (var dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            var colName = dr.GetString("name");
                            var col     = new DatabaseColumn
                            {
                                TableName   = viewName,
                                SchemaOwner = "",
                                Name        = colName,
                                Ordinal     = ordinal,
                                //type will be like "nvarchar(32)".
                                //Lengths /precisions could be parsed out (nb remember this is Sqlite)
                                DbDataType   = dr.GetString("type"),
                                Nullable     = dr.GetBoolean("notnull"),
                                DefaultValue = dr.GetString("dflt_value"),
                                IsPrimaryKey = dr.GetBoolean("pk"),
                            };
                            Result.Add(col);
                            ordinal++;
                        }
                    }
                }
            }

            return(Result);
        }
Exemplo n.º 28
0
 public IList <DatabaseView> Execute(IConnectionAdapter connectionAdapter)
 {
     //or is there something on connection?
     try
     {
         //server_version_num available from 8.2 +
         var cmd = BuildCommand(connectionAdapter);
         cmd.CommandText = @"SELECT current_setting('server_version_num')"; //or SHOW server_version
         //bizarrely, although this is version in a numeric format, it comes back as a string
         var hasMatViewsTable = int.Parse((string)cmd.ExecuteScalar(), NumberStyles.Any) > 90300;
         if (hasMatViewsTable)
         {
             Sql = _sql93;
         }
         ExecuteDbReader(connectionAdapter);
     }
     catch (Exception exception)
     {
         //possibly older than 8.2
         Trace.TraceError("Error reading postgresql materialized views " + exception);
     }
     return(Result);
 }
Exemplo n.º 29
0
        public IList <DatabaseArgument> Execute(IConnectionAdapter connectionAdapter)
        {
            var cmd = BuildCommand(connectionAdapter);

            //step 1- check if rdb$generator_name
            cmd.CommandText = @"SELECT rfr.rdb$generator_name
FROM rdb$relation_fields rfr 
WHERE rfr.rdb$relation_name = 'Test'";
            try
            {
                using (var rdr = cmd.ExecuteReader())
                {
                    //ok, firebird 3.0
                }
            }
            catch (Exception)
            {
                //firebird 2.5 or earlier
                UseFirebird25Sql();
            }
            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 30
0
        public IList <DatabaseTrigger> Execute(IConnectionAdapter connectionAdapter)
        {
            string timing = "CONDITION_TIMING";

            if (ServerVersion >= 90100)
            {
                timing = "ACTION_TIMING";
            }

            Sql = @"SELECT 
  TRIGGER_SCHEMA AS OWNER,
  TRIGGER_NAME,
  EVENT_OBJECT_TABLE AS TABLE_NAME,
  ACTION_STATEMENT AS TRIGGER_BODY,
  EVENT_MANIPULATION AS TRIGGERING_EVENT,
  " + timing + @" AS TRIGGER_TYPE
FROM information_schema.Triggers
WHERE 
(EVENT_OBJECT_TABLE = :tableName OR :tableName IS NULL) AND 
(TRIGGER_SCHEMA = :schemaOwner OR :schemaOwner IS NULL)";

            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 31
0
        public IList <DatabaseTrigger> Execute(IConnectionAdapter connectionAdapter)
        {
            var    version = connectionAdapter.DbConnection.ServerVersion;
            string timing  = "CONDITION_TIMING";

            if (version != null)
            {
                if (version.IndexOf(',') != -1)
                {
                    //Devart shows an unparseable string
                    //PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 64-bit
                    version = version.Substring(0, version.IndexOf(','))
                              .Replace("PostgreSQL ", "");
                }
                var v = new Version(version);
                if (v.Major >= 9 && v.Minor >= 1)
                {
                    timing = "ACTION_TIMING";
                }
            }

            Sql = @"SELECT 
  TRIGGER_SCHEMA AS OWNER,
  TRIGGER_NAME,
  EVENT_OBJECT_TABLE AS TABLE_NAME,
  ACTION_STATEMENT AS TRIGGER_BODY,
  EVENT_MANIPULATION AS TRIGGERING_EVENT,
  " + timing + @" AS TRIGGER_TYPE
FROM information_schema.Triggers
WHERE 
(EVENT_OBJECT_TABLE = :tableName OR :tableName IS NULL) AND 
(TRIGGER_SCHEMA = :schemaOwner OR :schemaOwner IS NULL)";

            ExecuteDbReader(connectionAdapter);
            return(Result);
        }
Exemplo n.º 32
0
        public async Task ShowActualAsync(IConnectionAdapter connectionAdapter, CancellationToken cancellationToken)
        {
            ResetView();

            ExecutionStatisticsPlanItemCollection itemCollection = null;

            try
            {
                _planItemCollection = itemCollection = await((OracleConnectionAdapterBase)connectionAdapter).GetCursorExecutionStatisticsAsync(cancellationToken);
            }
            catch (Exception exception)
            {
                var errorMessage = $"Execution statistics cannot be retrieved: {Messages.GetExceptionErrorMessage(exception)}";
                _outputViewer.AddExecutionLog(DateTime.Now, errorMessage);
                Messages.ShowError(errorMessage);
            }

            if (itemCollection == null)
            {
                return;
            }

            ConfigureExecutionPlanItemVisibility();

            SetRootItem(itemCollection.RootItem);
            TextExecutionPlan = itemCollection.PlanText;

            if (itemCollection.RootItem == null)
            {
                TabPlainText.IsSelected = true;
            }
            else
            {
                TotalExecutions = itemCollection.RootItem.Executions;
            }
        }
Exemplo n.º 33
0
        internal Connection (string id, Uri uri)
        {
            _id = id;

            _refcount = 0;

            _channels = new Dictionary<string, Channel>();
            _routes = new Dictionary<uint, Channel>();

            #if HYDNA_UNITY
                _adapter = new ReflectClientAdapter();
            #else
                _adapter = new TcpClientAdapter();
            #endif

            _adapter.OnConnect = connectHandler;
            _adapter.OnClose = closeHandler;
            _adapter.OnFrame = frameHandler;
            _adapter.Connect(uri);

            _openQueue = new Queue<Channel>();
        }
Exemplo n.º 34
0
        void close()
        {
            if (_adapter != null) {
                _adapter.OnConnect = null;
                _adapter.OnClose = null;
                _adapter.OnFrame = null;
                _adapter.Close();
                _adapter = null;
            }

            _channels = null;
            _routes = null;
            _handshaked = false;

            if (_id != null) {
                if (_connections.ContainsKey(_id)) {
                    List<Connection> list = _connections[_id];
                    list.Remove(this);

                    if (list.Count == 0)
                        _connections.Remove(_id);
                }
            }
        }
Exemplo n.º 35
0
 public IList <DatabaseArgument> Execute(IConnectionAdapter connectionAdapter)
 {
     ExecuteDbReader(connectionAdapter);
     return(Result);
 }
Exemplo n.º 36
0
 public NestedConnection(IConnectionAdapter connectionAdapter)
 {
     DbConnection = connectionAdapter.DbConnection;
 }