示例#1
0
        public BridgeUpdater GetReplaceUpdater(IJsCsGlue glue, int index)
        {
            var bridgeUpdater = new BridgeUpdater(viewModelUpdater => Splice(viewModelUpdater, index, 1, glue));
            var old           = ReplaceAndReturnOld(index, glue.AddRef());

            return(bridgeUpdater.CheckForRemove(old));
        }
示例#2
0
        public BridgeUpdater GetReplaceUpdater(List <IJsCsGlue> glues, int index)
        {
            var bridgeUpdater = new BridgeUpdater(viewModelUpdater => Splice(viewModelUpdater, index, glues.Count, glues));

            glues.ForEach(glue => glue.AddRef());
            var oldChildren = glues.Select((glue, idx) => ReplaceAndReturnOld(index + idx, glue));

            return(bridgeUpdater.CheckForRemove(oldChildren));
        }
示例#3
0
        public BridgeUpdater GetRemoveUpdater(int index, int count)
        {
            var bridgeUpdater = new BridgeUpdater(viewModelUpdater => Splice(viewModelUpdater, index, count));
            var oldChildren   = Enumerable.Range(0, count).Select(_ =>
            {
                var old = Items[index];
                Items.RemoveAt(index);
                return(old);
            });

            return(bridgeUpdater.CheckForRemove(oldChildren));
        }