예제 #1
0
 public ClosedIntervalView(string title, ClosedInterval closedInterval)
 {
     Debug.Assert(!string.IsNullOrWhiteSpace(title));
     Debug.Assert(closedInterval != null);
     this.title          = title;
     this.closedInterval = closedInterval;
 }
예제 #2
0
        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);
        }
예제 #3
0
 public bool Intersected(ClosedInterval closedInterval)
 {
     Debug.Assert(closedInterval != null);
     return(this.Includes(closedInterval.min) ||
            this.Includes(closedInterval.max) ||
            closedInterval.Includes(this));
 }
예제 #4
0
 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)));
 }
예제 #5
0
        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 + ": ";
        }
예제 #6
0
 public bool Includes(ClosedInterval closedInterval)
 {
     Debug.Assert(closedInterval != null);
     return(this.Includes(closedInterval.min) &&
            this.Includes(closedInterval.max));
 }