コード例 #1
0
ファイル: JSArray.cs プロジェクト: francisrc/Neutronium
        public void UpdateEventArgsFromJavascript(CollectionChanges.CollectionChanges collectionChanges)
        {
            var list = CValue as IList;

            if (list == null)
            {
                return;
            }

            collectionChanges.IndividualChanges.ForEach(c => ReplayChanges(c, list));
        }
コード例 #2
0
ファイル: JSArray.cs プロジェクト: mustafaasaber/Neutronium
        public BridgeUpdater UpdateCollectionFromFromJavascriptChanges(CollectionChanges.CollectionChanges collectionChanges)
        {
            if (!(CValue is IList list))
            {
                return(null);
            }

            collectionChanges.IndividualChanges.ForEach(c => ReplayChanges(c, list));

            collectionChanges.GetGlues(CollectionChangeType.Add).ForEach(glue => glue.AddRef());
            return(new BridgeUpdater().CheckForRemove(collectionChanges.GetGlues(CollectionChangeType.Remove)));
        }
コード例 #3
0
        public void UpdateEventArgsFromJavascript(CollectionChanges.CollectionChanges collectionChanges, BridgeUpdater updater)
        {
            if (!(CValue is IList list))
            {
                return;
            }

            collectionChanges.IndividualChanges.ForEach(c => ReplayChanges(c, list));

            collectionChanges.IndividualChanges.Where(ch => ch.CollectionChangeType == CollectionChangeType.Add)
            .ForEach(ch => ch.Object.AddRef());

            collectionChanges.IndividualChanges.Where(ch => ch.CollectionChangeType == CollectionChangeType.Remove)
            .ForEach(ch => CheckForRemove(updater, ch.Object));
        }
コード例 #4
0
        private BridgeUpdater UpdateCollectionAfterJavascriptChanges(JsArray array, object collection, CollectionChanges.CollectionChanges change)
        {
            var updater = default(BridgeUpdater);

            try
            {
                using (_CSharpChangesListener.GetCollectionSilenter(collection))
                {
                    updater = array.UpdateCollectionFromFromJavascriptChanges(change);
                }
                _JsUpdateHelper.UpdateOnUiContext(updater, _CSharpChangesListener.Off);
            }
            catch (Exception exception)
            {
                LogJavascriptSetException(exception);
            }
            return(updater);
        }