Beispiel #1
0
        public static async Task <IList <string> > FillCollection(IHCollection <string> collection, int count)
        {
            var items = new List <string>();

            for (var i = 0; i < count; i++)
            {
                var itemValue = "item" + i;
                items.Add(itemValue);
                await collection.AddAsync(itemValue);
            }

            return(items);
        }
Beispiel #2
0
 /// <inheritdoc />
 public ValueTask HandleAsync(IHCollection <T> sender, MemberInfo member, Lazy <T> item, object state)
 => _handler(sender, CreateEventArgs(member, item, state));
Beispiel #3
0
        private static void HandleItemAdded(IHCollection <string> sender, CollectionItemEventArgs <string> args)
        {
            var state = (EventState)args.State;

            Interlocked.Increment(ref state.EventsCount);
        }