The Labs \ Source Viewer \ SSCLI \ System.Net.NetworkInformation \ GatewayIPAddressInformationCollection

  1. //------------------------------------------------------------------------------
  2. // <copyright file="GatewayIPAddressInformationCollection.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. using System.Collections.Generic;
  16. using System.Collections.ObjectModel;
  17. namespace System.Net.NetworkInformation
  18. {
  19.     public class GatewayIPAddressInformationCollection : ICollection<GatewayIPAddressInformation>
  20.     {
  21.         Collection<GatewayIPAddressInformation> addresses = new Collection<GatewayIPAddressInformation>();
  22.        
  23.         protected internal GatewayIPAddressInformationCollection()
  24.         {
  25.         }
  26.        
  27.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.CopyTo"]/*' />
  28.         public virtual void CopyTo(GatewayIPAddressInformation[] array, int offset)
  29.         {
  30.             addresses.CopyTo(array, offset);
  31.         }
  32.        
  33.        
  34.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.Count"]/*' />
  35.         public virtual int Count {
  36.             get { return addresses.Count; }
  37.         }
  38.        
  39.         public virtual bool IsReadOnly {
  40.             get { return true; }
  41.         }
  42.        
  43.         public virtual GatewayIPAddressInformation this[int index]
  44.         {
  45.             get { return (GatewayIPAddressInformation)addresses[index]; }
  46.         }
  47.        
  48.        
  49.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.Add"]/*' />
  50.         public virtual void Add(GatewayIPAddressInformation address)
  51.         {
  52.             throw new NotSupportedException(SR.GetString(SR.net_collection_readonly));
  53.         }
  54.        
  55.        
  56.        
  57.         internal void InternalAdd(GatewayIPAddressInformation address)
  58.         {
  59.             addresses.Add(address);
  60.         }
  61.        
  62.        
  63.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.Contains"]/*' />
  64.         public virtual bool Contains(GatewayIPAddressInformation address)
  65.         {
  66.             return addresses.Contains(address);
  67.         }
  68.        
  69.        
  70.         public virtual IEnumerator<GatewayIPAddressInformation> GetEnumerator()
  71.         {
  72.             return (IEnumerator<GatewayIPAddressInformation>)addresses.GetEnumerator();
  73.         }
  74.        
  75.         System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
  76.         {
  77.             return null;
  78.         }
  79.        
  80.        
  81.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.Remove"]/*' />
  82.         public virtual bool Remove(GatewayIPAddressInformation address)
  83.         {
  84.             throw new NotSupportedException(SR.GetString(SR.net_collection_readonly));
  85.         }
  86.        
  87.         /// <include file='doc\HttpListenerPrefixCollection.uex' path='docs/doc[@for="HttpListenerPrefixCollection.Clear"]/*' />
  88.         public virtual void Clear()
  89.         {
  90.             throw new NotSupportedException(SR.GetString(SR.net_collection_readonly));
  91.         }
  92.     }
  93. }

Developer Fusion