/// <summary> /// Replaces a parameter in this <see cref="BroEvent"/>. /// </summary> /// <param name="index">Parameter index.</param> /// <param name="value">The <see cref="BroValue"/> to replace.</param> /// <returns><c>true</c> if operation was successful; otherwise, <c>false</c>.</returns> /// <exception cref="ArgumentNullException">Cannot add a <c>null</c> <see cref="BroValue"/>.</exception> /// <exception cref="ObjectDisposedException">Cannot add parameter, <see cref="BroEvent"/> is disposed.</exception> /// <exception cref="ArgumentOutOfRangeException"><paramref name="index"/> is not a valid parameter index.</exception> public bool ReplaceParameter(int index, BroValue value) { if ((object)value == null) { throw new ArgumentNullException("value"); } if (m_eventPtr.IsInvalid()) { throw new ObjectDisposedException("Cannot replace value, Bro event is disposed."); } if (index < 0 || index >= m_parameters.Count) { throw new ArgumentOutOfRangeException("index"); } if (value.ExecuteWithFixedPtr(ptr => BroApi.bro_event_set_val(m_eventPtr, index, value.Type, value.TypeName, ptr) == 0)) { return(false); } m_parameters[index] = value; return(true); }