public void Add(IPAddress address) { GatewayIPAddressInformation info = new GatewayIPAddressInformation(address); List.Add(info); gateway_Changed(); }
/// <summary> /// Initializes a new instance of the System.Net.NetworkInformation.GatewayIPAddressInformationCollection /// class. /// </summary> internal GatewayIPAddressInformationCollection(UnicastIPAddressInformationCollection c) { foreach (UnicastIPAddressInformation info in c) { GatewayIPAddressInformation gateway = new GatewayIPAddressInformation(info.Address); gateway.Changed += new AddressChangedHandler(gateway_Changed); this.List.Add(gateway); } this.m_adapterName = c.m_adapterName; }
/// <summary> /// Determines if this address is equivalent to the address of another GatewayIPAddressInformation instance /// </summary> /// <param name="obj">A GatewayIPAddressInformation instance</param> /// <returns>true if equivalent, otherwise false</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } GatewayIPAddressInformation ipi = (GatewayIPAddressInformation)obj; return(ipi.Address.Equals(this.Address)); }
/// <summary> /// Checks whether the collection contains the specified System.Net.NetworkInformation.GatewayIPAddressInformation /// object. /// </summary> /// <param name="address"> /// The System.Net.NetworkInformation.GatewayIPAddressInformation object to be /// searched in the collection. /// </param> /// <returns> /// true if the System.Net.NetworkInformation.GatewayIPAddressInformation object /// exists in the collection; otherwise false. /// </returns> public virtual bool Contains(GatewayIPAddressInformation address) { return(List.Contains(address)); }