Itenso.TimePeriod.TimePeriodCollection.RemoveAt C# (CSharp) Method

RemoveAt() public method

public RemoveAt ( int index ) : void
index int
return void
        public virtual void RemoveAt( int index )
        {
            periods.RemoveAt( index );
        }

Usage Example

コード例 #1
0
        public void RemoveAtTest()
        {
            DateTime now = ClockProxy.Clock.Now;
            SchoolDay schoolDay = new SchoolDay( now );
            TimePeriodCollection timePeriods = new TimePeriodCollection( schoolDay );

            // inside
            Assert.AreEqual( timePeriods[ 2 ], schoolDay.Lesson2 );
            timePeriods.RemoveAt( 2 );
            Assert.AreEqual( timePeriods[ 2 ], schoolDay.Break2 );

            // first
            Assert.AreEqual( timePeriods[ 0 ], schoolDay.Lesson1 );
            timePeriods.RemoveAt( 0 );
            Assert.AreEqual( timePeriods[ 0 ], schoolDay.Break1 );

            // last
            Assert.AreEqual( timePeriods[ timePeriods.Count - 1 ], schoolDay.Lesson4 );
            timePeriods.RemoveAt( timePeriods.Count - 1 );
            Assert.AreEqual( timePeriods[ timePeriods.Count - 1 ], schoolDay.Break3 );
        }
All Usage Examples Of Itenso.TimePeriod.TimePeriodCollection::RemoveAt