public JsResultCommand(IWebView webView, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _WebView = webView;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand = resultCommand;
     JSValue = _WebView.Factory.CreateObject(true);
 }
示例#2
0
 public JsResultCommand(IWebView webView, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _WebView = webView;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand             = resultCommand;
     JSValue = _WebView.Factory.CreateObject(true);
 }
示例#3
0
 public JsSimpleCommand(IWebView webView, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand)
 {
     _WebView = webView;
     _JavascriptToCSharpConverter = converter;
     _JSSimpleCommand             = simpleCommand;
     JSValue = _WebView.Factory.CreateObject(true);
 }
示例#4
0
        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();
        }
示例#5
0
 public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand command) :
     base(context, converter)
 {
     _Command = command;
     try
     {
         _CanExecute = _Command.CanExecute(null);
     }
     catch { }
 }
示例#6
0
        public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
        {
            _JavascriptToCSharpConverter = converter;
            _HTMLViewContext             = context;
            _Command = command;

            try
            {
                _InitialCanExecute = _Command.CanExecute(null);
            }
            catch { }
        }
 private static object GetArgument(this IJavascriptToCSharpConverter converter, IJavascriptObject javascriptObject, Type targetType)
 {
     try
     {
         var found = converter.GetCachedOrCreateBasic(javascriptObject, targetType);
         return(found?.CValue);
     }
     catch (Exception)
     {
         return(null);
     }
 }
  public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
  {
      _JavascriptToCSharpConverter = converter;
      _HTMLViewContext = context;
      _Command = command;
 
      try
      {
          _InitialCanExecute = _Command.CanExecute(null);
      }
      catch { }
  }
        public static Result <T> GetFirstArgument <T>(this IJavascriptToCSharpConverter converter, IJavascriptObject[] javascriptObjects)
        {
            if (javascriptObjects.Length == 0)
            {
                return(new Result <T>());
            }

            try
            {
                var found = converter.GetCachedOrCreateBasic(javascriptObjects[0], typeof(T));
                return(new Result <T>(found));
            }
            catch (Exception)
            {
                return(new Result <T>());
            }
        }
示例#10
0
        public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
        {
            _JavascriptToCSharpConverter = converter;
            _HTMLViewContext = context;
            _Command = command;
       
            var canexecute = true;
            try
            {
                canexecute = _Command.CanExecute(null);
            }
            catch { }

            JSValue = WebView.Evaluate(() =>
                {
                    var res = WebView.Factory.CreateObject(true);
                    res.SetValue("CanExecuteValue", WebView.Factory.CreateBool(canexecute));
                    res.SetValue("CanExecuteCount", WebView.Factory.CreateInt(_Count)); 
                    return res;       
                });
        }
示例#11
0
        public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
        {
            _JavascriptToCSharpConverter = converter;
            _HTMLViewContext             = context;
            _Command = command;

            var canexecute = true;

            try
            {
                canexecute = _Command.CanExecute(null);
            }
            catch { }

            JSValue = WebView.Evaluate(() =>
            {
                var res = WebView.Factory.CreateObject(true);
                res.SetValue("CanExecuteValue", WebView.Factory.CreateBool(canexecute));
                res.SetValue("CanExecuteCount", WebView.Factory.CreateInt(_Count));
                return(res);
            });
        }
示例#12
0
        internal static IGlueFactory GetFactory(HtmlViewContext context, ICSharpToJsCache cacher, IJavascriptToCSharpConverter converter, ObjectChangesListener onListener)
        {
            var isMapping = context.JavascriptFrameworkIsMappingObject;

            return(isMapping ? (IGlueFactory) new GlueMappingFactory(context, cacher, converter, onListener) : new GlueFactory(context, cacher, converter, onListener));
        }
 public IndividualCollectionChange(IndividualJavascriptCollectionChange change, IJavascriptToCSharpConverter converter, Type targetType)
 {
     CollectionChangeType = change.CollectionChangeType;
      Index = change.Index;
      Object = converter.GetCachedOrCreateBasic(change.Object, targetType);
 } 
示例#14
0
 public Neutronium.Core.Binding.CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge)
 {
     return new Neutronium.Core.Binding.CollectionChanges.CollectionChanges(bridge, changes, _IndividualType);
 }
示例#15
0
 internal CollectionChanges(IJavascriptToCSharpConverter iJSCBridgeCache, JavascriptCollectionChanges changes, Type iTargetedType)
 {
     _IJSCBridgeCache = iJSCBridgeCache;
     _TargetedType    = iTargetedType;
     _Changes         = changes;
 }
示例#16
0
        internal static IGlueFactory GetFactory(HTMLViewContext context, IJavascriptToCSharpConverter converter)
        {
            var isMapping = context.JavascriptFrameworkIsMappingObject;

            return(isMapping ? (IGlueFactory) new GlueMappingFactory(context, converter) : new GlueFactory(context, converter));
        }
示例#17
0
 public CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge)
 {
     return(new CollectionChanges.CollectionChanges(bridge, changes, _IndividualType));
 }
示例#18
0
 protected JsCommandBase(HtmlViewContext context, IJavascriptToCSharpConverter converter)
 {
     _JavascriptToCSharpConverter = converter;
     _HtmlViewContext             = context;
 }
示例#19
0
 public JsResultCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, IResultCommand <TArg, TResult> resultCommand) :
     base(context, converter)
 {
     _JsResultCommand = resultCommand;
 }
 public JsResultCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _HTMLViewContext = context;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand = resultCommand;          
 }
 public static object GetFirstArgumentOrNull(this IJavascriptToCSharpConverter converter, IJavascriptObject[] javascriptObjects)
 {
     return(javascriptObjects.Length == 0 ? null : converter.GetArgument(javascriptObjects[0], null));
 }
 public JsCommandWithoutParameter(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommandWithoutParameter command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = _Command.CanExecute;
 }
 public JsSimpleCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand)
 {
     _HTMLViewContext = context;
     _JavascriptToCSharpConverter = converter;
     _JSSimpleCommand = simpleCommand;
 }
示例#24
0
 public JsMappableResultCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, IResultCommand <TArg, TResult> resultCommand)
     : base(context, converter, resultCommand)
 {
 }
示例#25
0
 public GlueFactory(HTMLViewContext context, IJavascriptToCSharpConverter converter)
 {
     _HTMLViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }
 public IndividualCollectionChange(IndividualJavascriptCollectionChange change, IJavascriptToCSharpConverter converter, Type targetType)
 {
     CollectionChangeType = change.CollectionChangeType;
     Index  = change.Index;
     Object = converter.GetCachedOrCreateBasic(change.Object, targetType);
 }
示例#27
0
 public JsMappableCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand command) :
     base(context, converter, command)
 {
 }
示例#28
0
 public JsSimpleCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand)
 {
     _HTMLViewContext             = context;
     _JavascriptToCSharpConverter = converter;
     _JSSimpleCommand             = simpleCommand;
 }
示例#29
0
 public JsSimpleCommandBase(HtmlViewContext context, IJavascriptToCSharpConverter converter)
 {
     _HtmlViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }
示例#30
0
 public JsMappedCommandWithoutParameter(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommandWithoutParameter command)
     : base(context, converter, command)
 {
 }
示例#31
0
 public Neutronium.Core.Binding.CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge)
 {
     return(new Neutronium.Core.Binding.CollectionChanges.CollectionChanges(bridge, changes, _IndividualType));
 }
 public CommandFactory(HTMLViewContext context, IJavascriptToCSharpConverter converter)
 {
     _HTMLViewContext = context;
     _JavascriptToCSharpConverter = converter;
 }
示例#33
0
 public JsMappedCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand <T> resultCommand)
     : base(context, converter, resultCommand)
 {
 }
示例#34
0
 public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand <T> command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = true;
 }
示例#35
0
 public JsSimpleCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand) :
     base(context, converter)
 {
     _JsSimpleCommand = simpleCommand;
 }
 public JsMappableSimpleCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand resultCommand)
     : base(context, converter, resultCommand)
 {
 }
示例#37
0
 public JsResultCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _HTMLViewContext             = context;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand             = resultCommand;
 }
示例#38
0
 public GlueFactory(HtmlViewContext context, ICSharpToJsCache cacher, IJavascriptToCSharpConverter converter, ObjectChangesListener onListener)
     : base(cacher, onListener)
 {
     _HtmlViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }