This class represents the base class for the state pattern design pattern implementation.
示例#1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ConnectionString">Connection string.</param>
 /// <param name="Pooled">Pooled</param>
 /// <param name="Shared">Controls whether the connector can be shared.</param>
 public NpgsqlConnector(NpgsqlConnectionStringBuilder ConnectionString, bool Pooled, bool Shared)
 {
     this.settings     = ConnectionString;
     _connection_state = ConnectionState.Closed;
     _pooled           = Pooled;
     _shared           = Shared;
     _isInitialized    = false;
     _state            = NpgsqlClosedState.Instance;
     _mediator         = new NpgsqlMediator();
     _NativeToBackendTypeConverterOptions = NativeToBackendTypeConverterOptions.Default.Clone(new NpgsqlBackendTypeMapping());
     _planIndex   = 0;
     _portalIndex = 0;
     _notificationThreadStopCount = 1;
 }
示例#2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ConnectionString">Connection string.</param>
 /// <param name="Pooled">Pooled</param>
 /// <param name="Shared">Controls whether the connector can be shared.</param>
 public NpgsqlConnector(NpgsqlConnectionStringBuilder ConnectionString, bool Pooled, bool Shared)
 {
     this.settings                = ConnectionString;
     _connection_state            = ConnectionState.Closed;
     _pooled                      = Pooled;
     _shared                      = Shared;
     _isInitialized               = false;
     _state                       = NpgsqlClosedState.Instance;
     _mediator                    = new NpgsqlMediator();
     _oidToNameMapping            = new NpgsqlBackendTypeMapping();
     _planIndex                   = 0;
     _portalIndex                 = 0;
     _notificationThreadStopCount = 1;
     _notificationAutoResetEvent  = new AutoResetEvent(true);
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="Shared">Controls whether the connector can be shared.</param>
        public NpgsqlConnector(NpgsqlConnectionString ConnectionString, bool Pooled, bool Shared)
        {
            this.ConnectionString = ConnectionString;
            _connection_state = ConnectionState.Closed;
            _pooled = Pooled;
            _shared = Shared;
            _isInitialized = false;
            _state = NpgsqlClosedState.Instance;
            _mediator = new NpgsqlMediator();
            _oidToNameMapping = new NpgsqlBackendTypeMapping();
            _planIndex = 0;
            _portalIndex = 0;

        }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="Shared">Controls whether the connector can be shared.</param>
 public NpgsqlConnector(NpgsqlConnectionStringBuilder ConnectionString, bool Pooled, bool Shared)
 {
     this.settings = ConnectionString;
     _connection_state = ConnectionState.Closed;
     _pooled = Pooled;
     _shared = Shared;
     _isInitialized = false;
     _state = NpgsqlClosedState.Instance;
     _mediator = new NpgsqlMediator();
     _oidToNameMapping = new NpgsqlBackendTypeMapping();
     _planIndex = 0;
     _portalIndex = 0;
     _notificationThreadStopCount = 1;
     _notificationAutoResetEvent = new AutoResetEvent(true);
 }
示例#5
0
 internal NpgsqlContextHolder(NpgsqlConnector connector, NpgsqlState state)
 {
     this.connector = connector;
     this.state = state;
 }
示例#6
0
 ///<summary>
 ///This method is used by the states to change the state of the context.
 /// </summary>
 protected static void ChangeState(NpgsqlConnector context, NpgsqlState newState)
 {
     context.CurrentState = newState;
 }
示例#7
0
 ///<summary>
 ///This method is used by the states to change the state of the context.
 /// </summary>
 protected static void ChangeState(NpgsqlConnector context, NpgsqlState newState)
 {
     context.CurrentState = newState;
 }
示例#8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ConnectionString">Connection string.</param>
 /// <param name="Pooled">Pooled</param>
 /// <param name="Shared">Controls whether the connector can be shared.</param>
 public NpgsqlConnector(NpgsqlConnectionStringBuilder ConnectionString, bool Pooled, bool Shared)
 {
     this.settings = ConnectionString;
     _connection_state = ConnectionState.Closed;
     _pooled = Pooled;
     _shared = Shared;
     _isInitialized = false;
     _state = NpgsqlClosedState.Instance;
     _mediator = new NpgsqlMediator();
     _NativeToBackendTypeConverterOptions = NativeToBackendTypeConverterOptions.Default.Clone(new NpgsqlBackendTypeMapping());
     _planIndex = 0;
     _portalIndex = 0;
     _notificationThreadStopCount = 1;
 }
示例#9
0
 internal NpgsqlContextHolder(NpgsqlConnector connector, NpgsqlState state)
 {
     this.connector = connector;
     this.state     = state;
 }
示例#10
0
 ///<summary>
 ///This method is used by the states to change the state of the context.
 /// </summary>
 protected virtual void ChangeState(NpgsqlConnector context, NpgsqlState newState)
 {
     NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ChangeState");
     context.CurrentState = newState;
 }
示例#11
0
 ///<summary>
 ///This method is used by the states to change the state of the context.
 /// </summary>
 protected virtual void ChangeState(NpgsqlConnector context, NpgsqlState newState)
 {
     NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ChangeState");
     context.CurrentState = newState;
 }