Ejemplo n.º 1
0
        public override object Clone()
        {
            ShortBounds s = new ShortBounds(this.Name);

            s.To   = this.To;
            s.From = this.From;
            return(s);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            // Check that the parameters is not null, and is of the same data type.
            if (obj != null && obj.GetType() == typeof(ShortBounds))
            {
                // Cast it to a ShortBounds object.
                ShortBounds other = (ShortBounds)obj;

                // Check if the range matches for both objects.
                if (this.To.Equals(other.To) == true && this.From.Equals(other.From) == true)
                {
                    return(true);
                }
            }

            // Objects do not match.
            return(false);
        }