/// <summary>
 ///     Returns a string that represents the current <see cref="NetworkAddress" />.
 /// </summary>
 /// <returns>
 ///     A string that represents the current <see cref="NetworkAddress" />.
 /// </returns>
 public override string ToString()
 {
     if (StartAddress.Equals(EndAddress))
     {
         return(Address.ToString());
     }
     return($"{Address}/{SubnetMask}");
 }
Exemplo n.º 2
0
 public override bool Equals(object obj)
 {
     if (obj is AccessIPRange)
     {
         AccessIPRange tmp = obj as AccessIPRange;
         return((StartAddress.Equals(tmp.StartAddress)) && (EndAddress.Equals(tmp.EndAddress)));
     }
     return(false);
 }
Exemplo n.º 3
0
        /// <summary>
        ///     Returns a string that represents the current <see cref="NetworkAddress" />.
        /// </summary>
        /// <returns>
        ///     A string that represents the current <see cref="NetworkAddress" />.
        /// </returns>
        public override string ToString()
        {
            if (StartAddress.Equals(EndAddress))
            {
                if (Equals(Address, IPAddress.Any) || Equals(Address, IPAddress.IPv6Any))
                {
                    return("*");
                }

                return(Address.ToString());
            }

            return($"{Address}/{SubnetMask}");
        }
Exemplo n.º 4
0
        public override bool Equals(Object obj)
        {
            MemorySection <T> personObj = obj as MemorySection <T>;

            if (personObj == null)
            {
                return(false);
            }
            else
            {
                return(Name.Equals(personObj.Name) && StartAddress.Equals(personObj.StartAddress) &&
                       EndAddress.Equals(personObj.EndAddress) && IsSymbol.Equals(personObj.IsSymbol));
            }
        }
 /// <summary>
 ///     Returns a string that represents the current <see cref="NetworkAddress" />.
 /// </summary>
 /// <returns>
 ///     A string that represents the current <see cref="NetworkAddress" />.
 /// </returns>
 public override string ToString()
 {
     return(StartAddress.Equals(EndAddress) ? Address.ToString() : $"{Address}/{SubnetMask}");
 }
Exemplo n.º 6
0
 /// <summary>
 ///     Compares two IP address ranges.
 /// </summary>
 /// <returns>
 ///     <see langword="true" /> if the two address ranges are equal; otherwise, <see langword="false" />.
 /// </returns>
 /// <param name="comparand">An <see cref="IPRange" /> instance to compare to the current instance. </param>
 private bool Equals(IPRange comparand)
 {
     return(StartAddress.Equals(comparand.StartAddress) && EndAddress.Equals(comparand.EndAddress));
 }