in src/Apache.IoTDB.Data/IoTDBParameterCollection.cs [195:295]
public override void Clear()
=> _parameters.Clear();
/// <summary>
/// Gets a value indicating whether the collection contains the specified parameter.
/// </summary>
/// <param name="value">The parameter to look for. Must be a <see cref="IoTDBParameter" />.</param>
/// <returns>true if the collection contains the parameter; otherwise, false.</returns>
public override bool Contains(object value)
=> Contains((IoTDBParameter)value);
/// <summary>
/// Gets a value indicating whether the collection contains the specified parameter.
/// </summary>
/// <param name="value">The parameter to look for.</param>
/// <returns>true if the collection contains the parameter; otherwise, false.</returns>
public virtual bool Contains(IoTDBParameter value)
=> _parameters.Contains(value);
/// <summary>
/// Gets a value indicating whether the collection contains a parameter with the specified name.
/// </summary>
/// <param name="value">The name of the parameter.</param>
/// <returns>true if the collection contains the parameter; otherwise, false.</returns>
public override bool Contains(string value)
=> IndexOf(value) != -1;
/// <summary>
/// Copies the collection to an array of parameters.
/// </summary>
/// <param name="array">
/// The array into which the parameters are copied. Must be an array of <see cref="IoTDBParameter" /> objects.
/// </param>
/// <param name="index">The zero-based index to which the parameters are copied.</param>
public override void CopyTo(Array array, int index)
=> CopyTo((IoTDBParameter[])array, index);
/// <summary>
/// Copies the collection to an array of parameters.
/// </summary>
/// <param name="array">The array into which the parameters are copied.</param>
/// <param name="index">The zero-based index to which the parameters are copied.</param>
public virtual void CopyTo(IoTDBParameter[] array, int index)
=> _parameters.CopyTo(array, index);
/// <summary>
/// Gets an enumerator that iterates through the collection.
/// </summary>
/// <returns>The enumerator.</returns>
public override IEnumerator GetEnumerator()
=> _parameters.GetEnumerator();
/// <summary>
/// Gets a parameter at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the parameter.</param>
/// <returns>The parameter.</returns>
protected override DbParameter GetParameter(int index)
=> this[index];
/// <summary>
/// Gets a parameter with the specified name.
/// </summary>
/// <param name="parameterName">The name of the parameter.</param>
/// <returns>The parameter.</returns>
protected override DbParameter GetParameter(string parameterName)
=> GetParameter(IndexOfChecked(parameterName));
/// <summary>
/// Gets the index of the specified parameter.
/// </summary>
/// <param name="value">The parameter. Must be a <see cref="IoTDBParameter" />.</param>
/// <returns>The zero-based index of the parameter.</returns>
public override int IndexOf(object value)
=> IndexOf((IoTDBParameter)value);
/// <summary>
/// Gets the index of the specified parameter.
/// </summary>
/// <param name="value">The parameter.</param>
/// <returns>The zero-based index of the parameter.</returns>
public virtual int IndexOf(IoTDBParameter value)
=> _parameters.IndexOf(value);
/// <summary>
/// Gets the index of the parameter with the specified name.
/// </summary>
/// <param name="parameterName">The name of the parameter.</param>
/// <returns>The zero-based index of the parameter or -1 if not found.</returns>
public override int IndexOf(string parameterName)
{
for (var index = 0; index < _parameters.Count; index++)
{
if (_parameters[index].ParameterName == parameterName)
{
return index;
}
}
return -1;
}