public SqlClientSqlCommandSet()
		{
			instance = Activator.CreateInstance(sqlCmdSetType, true);
			connectionSetter = (PropSetter<SqlConnection>)
			                   Delegate.CreateDelegate(typeof(PropSetter<SqlConnection>),
			                                           instance, "set_Connection");
			transactionSetter = (PropSetter<SqlTransaction>)
			                    Delegate.CreateDelegate(typeof(PropSetter<SqlTransaction>),
			                                            instance, "set_Transaction");
			commandTimeoutSetter = (PropSetter<int>)
								Delegate.CreateDelegate(typeof(PropSetter<int>),
														instance, "set_CommandTimeout");
			connectionGetter = (PropGetter<SqlConnection>)
			                   Delegate.CreateDelegate(typeof(PropGetter<SqlConnection>),
			                                           instance, "get_Connection");
			commandGetter =
				(SqlClientSqlCommandSet.PropGetter<System.Data.SqlClient.SqlCommand>)
				Delegate.CreateDelegate(typeof(SqlClientSqlCommandSet.PropGetter<System.Data.SqlClient.SqlCommand>), instance,
				                        "get_BatchCommand");
			doAppend = (AppendCommand) Delegate.CreateDelegate(typeof(AppendCommand), instance, "Append");
			doExecuteNonQuery = (ExecuteNonQueryCommand)
			                    Delegate.CreateDelegate(typeof(ExecuteNonQueryCommand),
			                                            instance, "ExecuteNonQuery");
			doDispose = (DisposeCommand) Delegate.CreateDelegate(typeof(DisposeCommand), instance, "Dispose");
		}
示例#2
0
 public SqlCommandSet()
 {
     instance         = Activator.CreateInstance(sqlCmdSetType, true);
     connectionSetter = (PropSetter <SqlConnection>)
                        Delegate.CreateDelegate(typeof(PropSetter <SqlConnection>),
                                                instance, "set_Connection");
     transactionSetter = (PropSetter <SqlTransaction>)
                         Delegate.CreateDelegate(typeof(PropSetter <SqlTransaction>),
                                                 instance, "set_Transaction");
     commandTimeoutSetter = (PropSetter <int>)
                            Delegate.CreateDelegate(typeof(PropSetter <int>),
                                                    instance, "set_CommandTimeout");
     connectionGetter = (PropGetter <SqlConnection>)
                        Delegate.CreateDelegate(typeof(PropGetter <SqlConnection>),
                                                instance, "get_Connection");
     commandGetter =
         (SqlCommandSet.PropGetter <System.Data.SqlClient.SqlCommand>)
         Delegate.CreateDelegate(typeof(SqlCommandSet.PropGetter <System.Data.SqlClient.SqlCommand>), instance,
                                 "get_BatchCommand");
     doAppend          = (AppendCommand)Delegate.CreateDelegate(typeof(AppendCommand), instance, "Append");
     doExecuteNonQuery = (ExecuteNonQueryCommand)
                         Delegate.CreateDelegate(typeof(ExecuteNonQueryCommand),
                                                 instance, "ExecuteNonQuery");
     doDispose = (DisposeCommand)Delegate.CreateDelegate(typeof(DisposeCommand), instance, "Dispose");
 }
    public MySqlClientSqlCommandSet(int batchSize) {
      instance = Activator.CreateInstance(sqlCmdSetType, true);
      doInitialise = (InitialiseCommand)Delegate.CreateDelegate(typeof(InitialiseCommand), instance, "InitializeBatching");
      batchSizeSetter = (PropSetter<int>)Delegate.CreateDelegate(typeof(PropSetter<int>), instance, "set_UpdateBatchSize");
      doAppend = (AppendCommand)Delegate.CreateDelegate(typeof(AppendCommand), instance, "AddToBatch");
      doExecuteNonQuery = (ExecuteNonQueryCommand)Delegate.CreateDelegate(typeof(ExecuteNonQueryCommand), instance, "ExecuteBatch");
      doDispose = (DisposeCommand)Delegate.CreateDelegate(typeof(DisposeCommand), instance, "Dispose");

      Initialise(batchSize);
    }
示例#4
0
        public MySqlClientSqlCommandSet(int batchSize)
        {
            instance          = Activator.CreateInstance(sqlCmdSetType, true);
            doInitialise      = (InitialiseCommand)Delegate.CreateDelegate(typeof(InitialiseCommand), instance, "InitializeBatching");
            batchSizeSetter   = (PropSetter <int>)Delegate.CreateDelegate(typeof(PropSetter <int>), instance, "set_UpdateBatchSize");
            doAppend          = (AppendCommand)Delegate.CreateDelegate(typeof(AppendCommand), instance, "AddToBatch");
            doExecuteNonQuery = (ExecuteNonQueryCommand)Delegate.CreateDelegate(typeof(ExecuteNonQueryCommand), instance, "ExecuteBatch");
            doDispose         = (DisposeCommand)Delegate.CreateDelegate(typeof(DisposeCommand), instance, "Dispose");

            Initialise(batchSize);
        }
示例#5
0
        protected DbCommandSet()
        {
            object internalCommandSet = CreateInternalCommandSet();

            commandGetter =
                (PropGetter <TCommand>)
                Delegate.CreateDelegate(typeof(PropGetter <TCommand>), internalCommandSet,
                                        "get_BatchCommand");
            doAppend          = (AppendCommand)Delegate.CreateDelegate(typeof(AppendCommand), internalCommandSet, "Append");
            doExecuteNonQuery = (ExecuteNonQueryCommand)
                                Delegate.CreateDelegate(typeof(ExecuteNonQueryCommand),
                                                        internalCommandSet, "ExecuteNonQuery");
            doDispose = (DisposeCommand)Delegate.CreateDelegate(typeof(DisposeCommand), internalCommandSet, "Dispose");
        }
示例#6
0
        /// <summary>
        /// 생성자
        /// </summary>
        public SqlCommandSet()
        {
            if (IsDebugEnabled)
            {
                log.Debug("{0}를 동적으로 생성하고, 내부 함수를 Delegate로 이용하여, 노출시킵니다.", SqlCommandSetTypeName);
            }

            _sqlCommandSetInstance = ActivatorTool.CreateInstance(_sqlCommandSetType, true);

            _sqlCommandSetInstance.ShouldNotBeNull(SqlCommandSetTypeName);

            _connectionSettter =
                (PropertySetter <SqlConnection>)CreateDelegate(typeof(PropertySetter <SqlConnection>),
                                                               _sqlCommandSetInstance,
                                                               "set_Connection");
            _transactionSetter =
                (PropertySetter <SqlTransaction>)CreateDelegate(typeof(PropertySetter <SqlTransaction>),
                                                                _sqlCommandSetInstance,
                                                                "set_Transaction");
            _commandTimeoutSetter =
                (PropertySetter <int>)CreateDelegate(typeof(PropertySetter <int>),
                                                     _sqlCommandSetInstance,
                                                     "set_CommandTimeout");

            _connectionGetter =
                (PropertyGetter <SqlConnection>)CreateDelegate(typeof(PropertyGetter <SqlConnection>),
                                                               _sqlCommandSetInstance,
                                                               "get_Connection");

            _batchCommandGetter =
                (PropertyGetter <SqlCommand>)CreateDelegate(typeof(PropertyGetter <SqlCommand>),
                                                            _sqlCommandSetInstance,
                                                            "get_BatchCommand");

            _doAppend          = (AppendCommand)CreateDelegate(typeof(AppendCommand), _sqlCommandSetInstance, "Append");
            _doExecuteNonQuery =
                (ExecuteNonQueryCommand)CreateDelegate(typeof(ExecuteNonQueryCommand), _sqlCommandSetInstance, "ExecuteNonQuery");
            _doDispose = (DisposeCommand)CreateDelegate(typeof(DisposeCommand), _sqlCommandSetInstance, "Dispose");
        }
示例#7
0
        /// <summary>
        /// 생성자
        /// </summary>
        public SqlCommandSet() {
            if(IsDebugEnabled)
                log.Debug("{0}를 동적으로 생성하고, 내부 함수를 Delegate로 이용하여, 노출시킵니다.", SqlCommandSetTypeName);

            _sqlCommandSetInstance = ActivatorTool.CreateInstance(_sqlCommandSetType, true);

            _sqlCommandSetInstance.ShouldNotBeNull(SqlCommandSetTypeName);

            _connectionSettter =
                (PropertySetter<SqlConnection>)CreateDelegate(typeof(PropertySetter<SqlConnection>),
                                                              _sqlCommandSetInstance,
                                                              "set_Connection");
            _transactionSetter =
                (PropertySetter<SqlTransaction>)CreateDelegate(typeof(PropertySetter<SqlTransaction>),
                                                               _sqlCommandSetInstance,
                                                               "set_Transaction");
            _commandTimeoutSetter =
                (PropertySetter<int>)CreateDelegate(typeof(PropertySetter<int>),
                                                    _sqlCommandSetInstance,
                                                    "set_CommandTimeout");

            _connectionGetter =
                (PropertyGetter<SqlConnection>)CreateDelegate(typeof(PropertyGetter<SqlConnection>),
                                                              _sqlCommandSetInstance,
                                                              "get_Connection");

            _batchCommandGetter =
                (PropertyGetter<SqlCommand>)CreateDelegate(typeof(PropertyGetter<SqlCommand>),
                                                           _sqlCommandSetInstance,
                                                           "get_BatchCommand");

            _doAppend = (AppendCommand)CreateDelegate(typeof(AppendCommand), _sqlCommandSetInstance, "Append");
            _doExecuteNonQuery =
                (ExecuteNonQueryCommand)CreateDelegate(typeof(ExecuteNonQueryCommand), _sqlCommandSetInstance, "ExecuteNonQuery");
            _doDispose = (DisposeCommand)CreateDelegate(typeof(DisposeCommand), _sqlCommandSetInstance, "Dispose");
        }