AK.F1.Timing.Model.Collections.PostedTimeCollectionModel.Add C# (CSharp) Метод

Add() публичный Метод

Adds the specified item to this collection.
/// Thrown when is . ///
public Add ( PostedTime item ) : void
item PostedTime The item to add to this collection.
Результат void
        public void Add(PostedTime item)
        {
            Guard.NotNull(item, "item");

            InnerItems.Add(item);
            UpdateStatistics(item);
        }

Usage Example

        public void adding_an_item_updates_the_current()
        {
            var model = new PostedTimeCollectionModel();
            var observer = model.CreateObserver();
            var current = PT(35d, PostedTimeType.Normal, 5);

            model.Add(current);
            Assert.Equal(current, model.Current);
            current = PT(65d, PostedTimeType.Normal, 5);
            model.Add(current);
            Assert.Equal(current, model.Current);
            Assert.Equal(2, observer.GetChangeCount(x => x.Current));
        }
All Usage Examples Of AK.F1.Timing.Model.Collections.PostedTimeCollectionModel::Add