コード例 #1
0
        //        public static Synchronizer<Ta, object> SyncWith<Ta>(this ICollection<Ta> collectionA, IEnumerable collectionB, Func<object, Ta> createA, Action<Ta> destroyA, Predicate<object> filterPredicate)
        //        {
        //            var target = new GenericCollectionTarget<Ta>(collectionA);
        //            var source = CreateNonGenericSource(collectionB);
        //            return new Synchronizer<Ta, object>(target, source, createA, destroyA, filterPredicate);
        //        }
//
        //        public static Synchronizer<Ta, object> SyncWith<Ta>(this ICollection<Ta> collectionA, IEnumerable collectionB, Func<object, Ta> createA, Action<Ta> destroyA)
        //        {
        //            return collectionA.SyncWith(collectionB, createA, destroyA, DefaultFilterPredicate);
        //        }
//
        //        public static Synchronizer<Ta, object> SyncWith<Ta>(this ICollection<Ta> collectionA, IEnumerable collectionB, Func<object, Ta> createA)
        //        {
        //            return collectionA.SyncWith(collectionB, createA, RemoveAndDispose);
        //        }

        public static Synchronizer <object, object> SyncWith(this IList listA, IEnumerable collectionB, Func <object, object> createA, Action <object> destroyA, Predicate <object> filterPredicate)
        {
            var target = new NonGenericListTarget(listA);
            var source = CreateNonGenericSource(collectionB);

            return(new Synchronizer <object, object>(target, source, createA, destroyA, filterPredicate));
        }
コード例 #2
0
ファイル: Synchronizer.cs プロジェクト: vnmone/vvvv-sdk
        public static Synchronizer <object, object> SyncWith(this IList listA, IEnumerable collectionB, Func <object, object> createA, Action <object> destroyA = null, Predicate <object> filterPredicate = null, SyncEventHandler <object, object> syncEventHandler = null)
        {
            var target = new NonGenericListTarget(listA);
            var source = CreateNonGenericSource(collectionB);

            destroyA        = destroyA ?? RemoveAndDispose;
            filterPredicate = filterPredicate ?? DefaultFilterPredicate;
            return(new Synchronizer <object, object>(target, source, createA, destroyA, filterPredicate, syncEventHandler));
        }