/// <summary>
        ///     Removes the <see cref="T:EffortParameter" /> object with the specified name
        ///     from the collection.
        /// </summary>
        /// <param name="parameterName">
        ///     The name of the <see cref="T:EffortParameter" /> object to remove.
        /// </param>
        public override void RemoveAt(string parameterName)
        {
            EffortParameter parameter =
                this.internalCollection.FirstOrDefault(p => p.ParameterName == parameterName);

            this.internalCollection.Remove(parameter);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Adds a new parameter with the supplied name.
        /// </summary>
        /// <param name="name"> The name of the parameter. </param>
        protected void AddParameter(string name)
        {
            EffortParameter parameter = new EffortParameter();

            parameter.ParameterName = name;

            this.Parameters.Insert(0, parameter);
        }
        /// <summary>
        ///     Inserts the specified index of the <see cref="T:EffortParameter" /> object with
        ///     the specified name into the collection at the specified index.
        /// </summary>
        /// <param name="index">
        ///     The index at which to insert the <see cref="T:EffortParameter" /> object.
        /// </param>
        /// <param name="value">
        ///     The <see cref="T:EffortParameter" /> object to insert into the collection.
        /// </param>
        /// <exception cref="System.ArgumentException">
        ///     The provided parameter object is incompatible
        /// </exception>
        public override void Insert(int index, object value)
        {
            EffortParameter parameter = value as EffortParameter;

            if (parameter == null)
            {
                throw new ArgumentException("The provided parameter object is incompatible");
            }

            this.internalCollection.Insert(index, parameter);
        }
        /// <summary>
        ///     Adds a <see cref="T:EffortParameter" /> item with the specified value to the
        ///     <see cref="T:EffortParameterCollection" />.
        /// </summary>
        /// <param name="value">
        ///     The <see cref="P:EffortParameter.Value" /> of the
        ///     <see cref="T:EffortParameter" /> to add to the collection.
        /// </param>
        /// <returns>
        ///     The index of the <see cref="T:EffortParameter" /> object in the collection.
        /// </returns>
        /// <exception cref="System.ArgumentException">
        ///     The provided parameter object is incompatible
        /// </exception>
        public override int Add(object value)
        {
            EffortParameter parameter = value as EffortParameter;

            if (parameter == null)
            {
                throw new ArgumentException("The provided parameter object is incompatible");
            }

            this.internalCollection.Add(parameter);
            return(this.internalCollection.Count - 1);
        }
        /// <summary>
        ///     Adds an array of items with the specified values to the
        /// <see cref="T:EffortParameterCollection" />.
        /// </summary>
        ///     <param name="values">An array of values of type
        ///     <see cref="T:EffortParameter" /> to add to the collection.
        /// </param>
        /// <exception cref="System.ArgumentException">
        ///     The provided parameter object is incompatible
        /// </exception>
        public override void AddRange(Array values)
        {
            List <EffortParameter> parameters = new List <EffortParameter>();

            foreach (object value in values)
            {
                EffortParameter parameter = value as EffortParameter;

                if (parameter == null)
                {
                    throw new ArgumentException(
                              "The provided parameter object is incompatible");
                }

                parameters.Add(parameter);
            }

            this.internalCollection.AddRange(parameters);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Adds a new parameter with the supplied name.
        /// </summary>
        /// <param name="name"> The name of the parameter. </param>
        protected void AddParameter(string name)
        {
            EffortParameter parameter = new EffortParameter();
            parameter.ParameterName = name;

            this.Parameters.Insert(0, parameter);
        }