public override object Clone() { ShortBounds s = new ShortBounds(this.Name); s.To = this.To; s.From = this.From; return(s); }
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); }