Пример #1
0
        public static IEnumerable <T> Oscillate <T>(this IEnumerable <T> enumerable, NotifyOscillator <T> oscillator)
        {
            var enumerator = enumerable.GetEnumerator();
            var item       = new OscillatorNotityItem <T>(OscillatorNotifyType.Begin, default(T));

            oscillator.RaiseNotification(new EventArgs <OscillatorNotityItem <T> >(item));

            while (enumerator.MoveNext())
            {
                T current = enumerator.Current;

                item = new OscillatorNotityItem <T>(OscillatorNotifyType.Next, current);
                oscillator.RaiseNotification(new EventArgs <OscillatorNotityItem <T> >(item));

                yield return(current);
            }

            item = new OscillatorNotityItem <T>(OscillatorNotifyType.End, default(T));
            oscillator.RaiseNotification(new EventArgs <OscillatorNotityItem <T> >(item));
        }
Пример #2
0
 public override bool Test(out OscillatorNotityItem <TItemType> currentValue)
 {
     throw new NotImplementedException();
 }