コード例 #1
0
 public static BehaviorsDisposable <IEnumerable <TCollItem> > AddBehavior <TCollItem>
 (
     this IEnumerable <TCollItem> collection,
     IStatelessBehavior <IEnumerable <TCollItem> > behavior
 )
 {
     return(AddBehaviorImpl(collection, behavior));
 }
コード例 #2
0
        public static BehaviorsDisposable <IEnumerable <TCollItem> > AddBehavior <TCollItem>
        (
            this BehaviorsDisposable <IEnumerable <TCollItem> > previousBehavior,
            IStatelessBehavior <IEnumerable <TCollItem> > behavior
        )
        {
            IEnumerable <TCollItem> collection = previousBehavior.TheObjectTheBehaviorsAreAttachedTo;

            return(AddBehaviorImpl(collection, behavior, previousBehavior));
        }
        public DisposableBehaviorContainer
        (
            IStatelessBehavior <T> behavior,
            T objectTheBehaviorIsAttachedTo
        )
        {
            TheBehavior = behavior;
            TheObjectTheBehaviorIsAttachedTo = objectTheBehaviorIsAttachedTo;

            TheBehavior.Attach(TheObjectTheBehaviorIsAttachedTo);
        }
コード例 #4
0
        private static BehaviorsDisposable <IEnumerable <TCollItem> > AddBehaviorImpl <TCollItem>
        (
            this IEnumerable <TCollItem> collection,
            IStatelessBehavior <IEnumerable <TCollItem> > behavior,
            BehaviorsDisposable <IEnumerable <TCollItem> > previousBehavior = null)
        {
            if (collection == null)
            {
                return(null);
            }

            DisposableBehaviorContainer <IEnumerable <TCollItem> > behaviorContainer =
                new DisposableBehaviorContainer <IEnumerable <TCollItem> >(behavior, collection);

            BehaviorsDisposable <IEnumerable <TCollItem> > behaviorsDisposable =
                new BehaviorsDisposable <IEnumerable <TCollItem> >(behaviorContainer, previousBehavior);

            return(behaviorsDisposable);
        }
コード例 #5
0
 public static void Reset <T>(this IStatelessBehavior <T> behavior, T obj, bool resetItems = true)
 {
     behavior.Detach(obj, resetItems);
     behavior.Attach(obj, resetItems);
 }