| | | 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 CoreWCF.Collections.Generic; |
| | | 5 | | |
| | | 6 | | namespace CoreWCF.Channels |
| | | 7 | | { |
| | | 8 | | // Some binding elements can sometimes consume extra information when building factories. |
| | | 9 | | // BindingParameterCollection is a collection of objects with this extra information. |
| | | 10 | | // See comments in SecurityBindingElement and TransactionFlowBindingElement for examples |
| | | 11 | | // of binding elements that go looking for certain data in this collection. |
| | | 12 | | public class BindingParameterCollection : KeyedByTypeCollection<object> |
| | | 13 | | { |
| | 18122 | 14 | | public BindingParameterCollection() { } |
| | | 15 | | |
| | 0 | 16 | | internal BindingParameterCollection(params object[] parameters) |
| | | 17 | | { |
| | 0 | 18 | | if (parameters == null) |
| | | 19 | | { |
| | 0 | 20 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters)); |
| | | 21 | | } |
| | | 22 | | |
| | 0 | 23 | | for (int i = 0; i < parameters.Length; i++) |
| | | 24 | | { |
| | 0 | 25 | | Add(parameters[i]); |
| | | 26 | | } |
| | 0 | 27 | | } |
| | | 28 | | |
| | 22046 | 29 | | internal BindingParameterCollection(BindingParameterCollection parameters) |
| | | 30 | | { |
| | 22046 | 31 | | if (parameters == null) |
| | | 32 | | { |
| | 0 | 33 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parameters)); |
| | | 34 | | } |
| | | 35 | | |
| | 61110 | 36 | | for (int i = 0; i < parameters.Count; i++) |
| | | 37 | | { |
| | 8509 | 38 | | Add(parameters[i]); |
| | | 39 | | } |
| | 22046 | 40 | | } |
| | | 41 | | } |
| | | 42 | | } |