public ClosedIntervalView(string title, ClosedInterval closedInterval) { Debug.Assert(!string.IsNullOrWhiteSpace(title)); Debug.Assert(closedInterval != null); this.title = title; this.closedInterval = closedInterval; }
public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } ClosedInterval other = (ClosedInterval)obj; if (max != other.max) { return(false); } if (min != other.min) { return(false); } return(true); }
public bool Intersected(ClosedInterval closedInterval) { Debug.Assert(closedInterval != null); return(this.Includes(closedInterval.min) || this.Includes(closedInterval.max) || closedInterval.Includes(this)); }
public ClosedInterval Union(ClosedInterval closedInterval) { Debug.Assert(closedInterval != null); Debug.Assert(this.Intersected(closedInterval)); return(new ClosedInterval( Math.Min(min, closedInterval.min), Math.Max(max, closedInterval.max))); }
public LimitedIntDialog(string title, int min, int max) { Debug.Assert(title != null); limits = new ClosedInterval(min, max); limitsView = new ClosedIntervalView("El valor debe estar entre ", limits); LimitedIntDialog limitedIntDialog = this; limitedIntDialog.title = title + " " + limitsView + ": "; }
public bool Includes(ClosedInterval closedInterval) { Debug.Assert(closedInterval != null); return(this.Includes(closedInterval.min) && this.Includes(closedInterval.max)); }