Esempio n. 1
0
        private void UnlistenToCSharpChanges()
        {
            var list = new JSCBridgeListenableVisitor(n => n.PropertyChanged -= Object_PropertyChanged,
                                                      c => c.CollectionChanged -= CollectionChanged, co => co.UnListenChanges());

            ApplyOnListenableReferencedObjects(list);
        }
Esempio n. 2
0
            public ReListener(BidirectionalMapper iBidirectionalMapper)
            {
                _BidirectionalMapper = iBidirectionalMapper;
                var list = new JSCBridgeListenableVisitor((e) => _OldObject.Add(e),
                                                          (e) => _OldCollections.Add(e), e => _OldCommands.Add(e));

                _BidirectionalMapper.ApplyOnListenableReferencedObjects(list);
            }
Esempio n. 3
0
            private void Clean()
            {
                var newObject       = new HashSet <INotifyPropertyChanged>();
                var new_Collections = new HashSet <INotifyCollectionChanged>();
                var new_Commands    = new HashSet <JSCommand>();

                var list = new JSCBridgeListenableVisitor((e) => newObject.Add(e),
                                                          (e) => new_Collections.Add(e), e => new_Commands.Add(e));


                _BidirectionalMapper.ApplyOnListenableReferencedObjects(list);

                _OldObject.Where(o => !newObject.Contains(o)).ForEach(o => o.PropertyChanged -= _BidirectionalMapper.Object_PropertyChanged);
                newObject.Where(o => !_OldObject.Contains(o)).ForEach(o => o.PropertyChanged += _BidirectionalMapper.Object_PropertyChanged);

                _OldCollections.Where(o => !new_Collections.Contains(o)).ForEach(o => o.CollectionChanged -= _BidirectionalMapper.CollectionChanged);
                new_Collections.Where(o => !_OldCollections.Contains(o)).ForEach(o => o.CollectionChanged += _BidirectionalMapper.CollectionChanged);

                _OldCommands.Where(o => !new_Commands.Contains(o)).ForEach(o => o.UnListenChanges());
                new_Commands.Where(o => !_OldCommands.Contains(o)).ForEach(o => o.ListenChanges());

                _BidirectionalMapper._ReListen = null;
            }
            private void Clean()
            {
                var newObject = new HashSet<INotifyPropertyChanged>();
                var new_Collections = new HashSet<INotifyCollectionChanged>();
                var new_Commands = new HashSet<JSCommand>();

                var list = new JSCBridgeListenableVisitor((e) => newObject.Add(e),
                                (e) => new_Collections.Add(e), e => new_Commands.Add(e));


                _BidirectionalMapper.ApplyOnListenableReferencedObjects(list);

                _OldObject.Where(o => !newObject.Contains(o)).ForEach(o => o.PropertyChanged -= _BidirectionalMapper.Object_PropertyChanged);
                newObject.Where(o => !_OldObject.Contains(o)).ForEach(o => o.PropertyChanged += _BidirectionalMapper.Object_PropertyChanged);

                _OldCollections.Where(o => !new_Collections.Contains(o)).ForEach(o => o.CollectionChanged -= _BidirectionalMapper.CollectionChanged);
                new_Collections.Where(o => !_OldCollections.Contains(o)).ForEach(o => o.CollectionChanged += _BidirectionalMapper.CollectionChanged);

                _OldCommands.Where(o => !new_Commands.Contains(o)).ForEach(o => o.UnListenChanges());
                new_Commands.Where(o => !_OldCommands.Contains(o)).ForEach(o => o.ListenChanges());

                _BidirectionalMapper._ReListen = null;
            }
            public ReListener(BidirectionalMapper iBidirectionalMapper)
            {
                _BidirectionalMapper = iBidirectionalMapper;
                var list = new JSCBridgeListenableVisitor((e) => _OldObject.Add(e),
                    (e) => _OldCollections.Add(e), e => _OldCommands.Add(e));

                _BidirectionalMapper.ApplyOnListenableReferencedObjects(list);
            }
        private void UnlistenToCSharpChanges()
        {
            var list = new JSCBridgeListenableVisitor(n => n.PropertyChanged -= Object_PropertyChanged,
                           c => c.CollectionChanged -= CollectionChanged, co => co.UnListenChanges());

            ApplyOnListenableReferencedObjects(list);
        }
 private void ApplyOnListenableReferencedObjects(JSCBridgeListenableVisitor visitor)
 {
     _Root.ApplyOnListenable(visitor);
     _UnrootedEntities.ForEach(js => js.ApplyOnListenable(visitor));
 }
Esempio n. 8
0
 private void ApplyOnListenableReferencedObjects(JSCBridgeListenableVisitor visitor)
 {
     _Root.ApplyOnListenable(visitor);
     _UnrootedEntities.ForEach(js => js.ApplyOnListenable(visitor));
 }