Itenso.TimePeriod.TimeRange.ExpandStartTo C# (CSharp) Method

ExpandStartTo() public method

public ExpandStartTo ( System.DateTime moment ) : void
moment System.DateTime
return void
        public virtual void ExpandStartTo( DateTime moment )
        {
            CheckModification();
            if ( start > moment )
            {
                start = moment;
            }
        }

Usage Example

Example #1
0
 public void ExpandStartToTest()
 {
     TimeRange timeRange = new TimeRange( start, end );
     timeRange.ExpandStartTo( start.AddMilliseconds( 1 ) );
     Assert.AreEqual( timeRange.Start, start );
     timeRange.ExpandStartTo( start.AddMinutes( -1 ) );
     Assert.AreEqual( timeRange.Start, start.AddMinutes( -1 ) );
 }