public async void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes) { try { var jsArray = _JsUpdateHelper.GetCachedFromJsObject <JsArray>(changes.Collection); if (jsArray == null) { return; } var collectionChanges = jsArray.GetChanger(changes, _JavascriptToGlueMapper); var updater = await _JsUpdateHelper.EvaluateOnUiContextAsync(() => { collectionChanges.ComputeGlues(_JsUpdateHelper); return(UpdateCollectionAfterJavascriptChanges(jsArray, jsArray.CValue, collectionChanges)); }); if (updater?.HasUpdatesOnJavascriptContext != true) { return; } await _JsUpdateHelper.RunOnJavascriptContextAsync(() => _JsUpdateHelper.UpdateOnJavascriptContext(updater) ); } catch (Exception exception) { LogJavascriptSetException(exception); } }
public async void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes) { try { var res = _SessionCache.GetCached(changes.Collection) as JsArray; if (res == null) { return; } var collectionChanges = res.GetChanger(changes, this); var updater = new BridgeUpdater(_SessionCache); await Context.RunOnUiContextAsync(() => { UpdateCollection(res, res.CValue, collectionChanges, updater); }); if (!updater.HasUpdatesOnJavascriptContext) { return; } await Context.RunOnJavascriptContextAsync(() => { updater.UpdateOnJavascriptContext(Context.ViewModelUpdater); }); } catch (Exception exception) { LogJavascriptSetException(exception); } }
public void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes) { try { var res = _SessionCache.GetGlobalCached(changes.Collection) as JSArray; if (res == null) { return; } var collectionChanges = res.GetChanger(changes, this); Context.RunOnUIContextAsync(() => { using (ReListen()) using (_ListenerRegister.GetColllectionSilenter(res.CValue)) { res.UpdateEventArgsFromJavascript(collectionChanges); } }); } catch (Exception e) { _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}"); } }
public async void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes) { try { var res = _SessionCache.GetCached(changes.Collection) as JSArray; if (res == null) { return; } var collectionChanges = res.GetChanger(changes, this); var updater = new BridgeUpdater(); await Context.RunOnUIContextAsync(() => { UpdateCollection(res, res.CValue, collectionChanges, updater); }); if (!updater.HasUpdatesOnJavascriptContext) { return; } await Context.RunOnJavascriptContextAsync(() => { updater.UpdateOnJavascriptContext(_Context.ViewModelUpdater); }); } catch (Exception e) { _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}"); } }
internal CollectionChanges(IJavascriptToCSharpConverter jSCBridgeCache, JavascriptCollectionChanges changes, Type targetedType) { _IJSCBridgeCache = jSCBridgeCache; _TargetedType = targetedType; IndividualChanges = changes.Changes .Select(jvchnage => new IndividualCollectionChange(jvchnage, _IJSCBridgeCache, _TargetedType)) .OrderBy(idc => idc, this).ToArray(); }
public void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes) { try { var res = _SessionCache.GetGlobalCached(changes.Collection) as JSArray; if (res == null) { return; } var collectionChanges = res.GetChanger(changes, this); Context.RunOnUIContextAsync(() => { UpdateCollection(res, collectionChanges, res.CValue); }); } catch (Exception e) { _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}"); } }
internal CollectionChanges(IJavascriptToCSharpConverter iJSCBridgeCache, JavascriptCollectionChanges changes, Type iTargetedType) { _IJSCBridgeCache = iJSCBridgeCache; _TargetedType = iTargetedType; _Changes = changes; }
internal CollectionChanges(IJavascriptToGlueMapper jsCsBridgeCache, JavascriptCollectionChanges changes, Type targetedType) { IndividualChanges = changes.Changes .Select(collectionChange => new IndividualCollectionChange(collectionChange, jsCsBridgeCache, targetedType)) .OrderBy(idc => idc, this).ToArray(); }
public Neutronium.Core.Binding.CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge) { return(new Neutronium.Core.Binding.CollectionChanges.CollectionChanges(bridge, changes, _IndividualType)); }
public CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge) { return(new CollectionChanges.CollectionChanges(bridge, changes, _IndividualType)); }
public CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToGlueMapper bridge) { return(new CollectionChanges.CollectionChanges(bridge, changes, _IndividualType)); }