2828
2929namespace Platibus
3030{
31+ /// <inheritdoc />
3132 /// <summary>
32- /// A mutable <see cref="IEndpointCollection"/> implementation
33+ /// A mutable <see cref="T:Platibus. IEndpointCollection" /> implementation
3334 /// </summary>
3435 public class EndpointCollection : IEndpointCollection
3536 {
37+ public static readonly IEndpointCollection Empty = new EndpointCollection ( ) ;
38+
3639 private readonly IDictionary < EndpointName , IEndpoint > _endpoints = new Dictionary < EndpointName , IEndpoint > ( ) ;
3740
3841 /// <summary>
@@ -44,21 +47,15 @@ public class EndpointCollection : IEndpointCollection
4447 /// or <paramref name="endpoint"/> are <c>null</c></exception>
4548 /// <exception cref="EndpointAlreadyExistsException">Thrown if there is already an
4649 /// endpoint with the specified <paramref name="endpointName"/></exception>
47- public void Add ( EndpointName endpointName , IEndpoint endpoint )
50+ public virtual void Add ( EndpointName endpointName , IEndpoint endpoint )
4851 {
4952 if ( endpointName == null ) throw new ArgumentNullException ( nameof ( endpointName ) ) ;
5053 if ( _endpoints . ContainsKey ( endpointName ) ) throw new EndpointAlreadyExistsException ( endpointName ) ;
5154 _endpoints [ endpointName ] = endpoint ?? throw new ArgumentNullException ( nameof ( endpoint ) ) ;
5255 }
5356
54- /// <summary>
55- /// Returns the endpoint with the specified name
56- /// </summary>
57- /// <param name="endpointName">The name of the endpoint</param>
58- /// <returns>Returns the endpoint</returns>
59- /// <exception cref="EndpointNotFoundException">Thrown if there
60- /// is no endpoint with the specified name</exception>
61- public IEndpoint this [ EndpointName endpointName ]
57+ /// <inheritdoc />
58+ public virtual IEndpoint this [ EndpointName endpointName ]
6259 {
6360 get
6461 {
@@ -70,23 +67,16 @@ public IEndpoint this[EndpointName endpointName]
7067 }
7168 }
7269
73- /// <summary>
74- /// Tries to retrieve the endpoint with the specified address
75- /// </summary>
76- /// <param name="address">The address of the endpoint</param>
77- /// <param name="endpoint">An output parameter that will be initialied
78- /// with the endpoint if the endpoint is found</param>
79- /// <returns>Returns <c>true</c> if the endpoint is found; <c>false</c>
80- /// otherwise</returns>
81- public bool TryGetEndpointByAddress ( Uri address , out IEndpoint endpoint )
70+ /// <inheritdoc />
71+ public virtual bool TryGetEndpointByAddress ( Uri address , out IEndpoint endpoint )
8272 {
8373 var comparer = new EndpointAddressEqualityComparer ( ) ;
8474 endpoint = _endpoints . Values . FirstOrDefault ( e => comparer . Equals ( e . Address , address ) ) ;
8575 return endpoint != null ;
8676 }
8777
8878 /// <inheritdoc />
89- public bool Contains ( EndpointName endpointName )
79+ public virtual bool Contains ( EndpointName endpointName )
9080 {
9181 return _endpoints . ContainsKey ( endpointName ) ;
9282 }
@@ -96,13 +86,7 @@ IEnumerator IEnumerable.GetEnumerator()
9686 return GetEnumerator ( ) ;
9787 }
9888
99- /// <summary>
100- /// Returns an enumerator that iterates through the collection.
101- /// </summary>
102- /// <returns>
103- /// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
104- /// </returns>
105- /// <filterpriority>1</filterpriority>
89+ /// <inheritdoc />
10690 public IEnumerator < KeyValuePair < EndpointName , IEndpoint > > GetEnumerator ( )
10791 {
10892 return _endpoints . GetEnumerator ( ) ;
0 commit comments