Ejemplo n.º 1
0
        public new NpgsqlParameter this[int index]
        {
            get
            {
                NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, index);
                return(this.InternalList[index]);
            }
            set
            {
                NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, index, value);
                NpgsqlParameter oldValue = this.InternalList[index];

                if (oldValue == value)
                {
                    // Reasigning the same value is a non-op.
                    return;
                }

                if (value.Collection != null)
                {
                    throw new InvalidOperationException("The parameter already belongs to a collection");
                }

                if (value.CleanName != oldValue.CleanName)
                {
                    InvalidateHashLookups();
                }

                this.InternalList[index] = value;
                value.Collection         = this;
                oldValue.Collection      = null;
            }
        }
Ejemplo n.º 2
0
        public new NpgsqlParameter this[string parameterName]
        {
            get
            {
                NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, parameterName);
                int index = IndexOf(parameterName);

                if (index == -1)
                {
                    throw new IndexOutOfRangeException("Parameter not found");
                }

                return(this.InternalList[index]);
            }
            set
            {
                NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, parameterName, value);
                int index = IndexOf(parameterName);

                if (index == -1)
                {
                    throw new IndexOutOfRangeException("Parameter not found");
                }

                NpgsqlParameter oldValue = this.InternalList[index];

                if (value.CleanName != oldValue.CleanName)
                {
                    InvalidateHashLookups();
                }

                this.InternalList[index] = value;
            }
        }
Ejemplo n.º 3
0
 public NpgsqlParameter this[string parameterName] {
     get
     {
         NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, parameterName);
         return((NpgsqlParameter)this.InternalList[IndexOf(parameterName)]);
     }
     set
     {
         NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, parameterName, value);
         this.InternalList[IndexOf(parameterName)] = value;
     }
 }
Ejemplo n.º 4
0
 public NpgsqlParameter this[int index] {
     get
     {
         NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, index);
         return((NpgsqlParameter)this.InternalList[index]);
     }
     set
     {
         NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, index, value);
         this.InternalList[index] = value;
     }
 }
Ejemplo n.º 5
0
 object System.Collections.IList.this[int index] {
     get
     {
         NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, index);
         return((NpgsqlParameter)this.InternalList[index]);
     }
     set
     {
         NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, index, value);
         CheckType(value);
         this.InternalList[index] = value;
     }
 }
Ejemplo n.º 6
0
 object System.Data.IDataParameterCollection.this[string parameterName] {
     get
     {
         NpgsqlEventLog.LogIndexerGet(LogLevel.Debug, CLASSNAME, parameterName);
         return(this.InternalList[IndexOf(parameterName)]);
     }
     set
     {
         NpgsqlEventLog.LogIndexerSet(LogLevel.Debug, CLASSNAME, parameterName, value);
         CheckType(value);
         this.InternalList[IndexOf(parameterName)] = value;
     }
 }