/// <summary> /// Removes the action at a specified index. /// </summary> /// <param name="index">Index of action to remove.</param> /// <exception cref="ArgumentOutOfRangeException">Index out of range.</exception> public void RemoveAt(int index) { if (index >= Count) { throw new ArgumentOutOfRangeException(nameof(index), index, "Failed to remove action. Index out of range."); } if (v2Coll != null) { v2Coll.Remove(++index); } else { v1Actions.RemoveAt(index); SaveV1Actions(); } }
/// <summary> /// Removes the action at a specified index. /// </summary> /// <param name="index">Index of action to remove.</param> /// <exception cref="ArgumentOutOfRangeException">Index out of range.</exception> public void RemoveAt(int index) { if (index >= this.Count) { throw new ArgumentOutOfRangeException("index", index, "Failed to remove action. Index out of range."); } if (v2Coll != null) { v2Coll.Remove(++index); } else if (index == 0) { Add(new ExecAction()); } else { throw new NotV1SupportedException("There can be only a single action and it cannot be removed."); } }