| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Collections.ObjectModel; |
| | | 5 | | |
| | | 6 | | namespace CoreWCF.Description |
| | | 7 | | { |
| | | 8 | | public class OperationDescriptionCollection : Collection<OperationDescription> |
| | | 9 | | { |
| | 685 | 10 | | internal OperationDescriptionCollection() |
| | | 11 | | { |
| | 685 | 12 | | } |
| | | 13 | | |
| | | 14 | | public OperationDescription Find(string name) |
| | | 15 | | { |
| | 32 | 16 | | for (int i = 0; i < Count; i++) |
| | | 17 | | { |
| | 16 | 18 | | if (this[i].Name == name) |
| | | 19 | | { |
| | 16 | 20 | | return this[i]; |
| | | 21 | | } |
| | | 22 | | } |
| | 0 | 23 | | return null; |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | public Collection<OperationDescription> FindAll(string name) |
| | | 27 | | { |
| | 2837 | 28 | | Collection<OperationDescription> results = new Collection<OperationDescription>(); |
| | 25278 | 29 | | for (int i = 0; i < Count; i++) |
| | | 30 | | { |
| | 9802 | 31 | | if (this[i].Name == name) |
| | | 32 | | { |
| | 0 | 33 | | results.Add(this[i]); |
| | | 34 | | } |
| | | 35 | | } |
| | 2837 | 36 | | return results; |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | protected override void InsertItem(int index, OperationDescription item) |
| | | 40 | | { |
| | 2837 | 41 | | if (item == null) |
| | | 42 | | { |
| | 0 | 43 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 44 | | } |
| | 2837 | 45 | | base.InsertItem(index, item); |
| | 2837 | 46 | | } |
| | | 47 | | |
| | | 48 | | protected override void SetItem(int index, OperationDescription item) |
| | | 49 | | { |
| | 0 | 50 | | if (item == null) |
| | | 51 | | { |
| | 0 | 52 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(item)); |
| | | 53 | | } |
| | 0 | 54 | | base.SetItem(index, item); |
| | 0 | 55 | | } |
| | | 56 | | } |
| | | 57 | | } |