コード例 #1
0
 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
ファイル: JsCommand.cs プロジェクト: zengfr/Neutronium
 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 { }
        }
コード例 #7
0
 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);
     }
 }
コード例 #8
0
  public JSCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
  {
      _JavascriptToCSharpConverter = converter;
      _HTMLViewContext = context;
      _Command = command;
 
      try
      {
          _InitialCanExecute = _Command.CanExecute(null);
      }
      catch { }
  }
コード例 #9
0
        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));
        }
コード例 #13
0
 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;
 }
コード例 #20
0
 public JsResultCommand(HTMLViewContext context, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _HTMLViewContext = context;
     _JavascriptToCSharpConverter = converter;
     _JSResultCommand = resultCommand;          
 }
コード例 #21
0
 public static object GetFirstArgumentOrNull(this IJavascriptToCSharpConverter converter, IJavascriptObject[] javascriptObjects)
 {
     return(javascriptObjects.Length == 0 ? null : converter.GetArgument(javascriptObjects[0], null));
 }
コード例 #22
0
 public JsCommandWithoutParameter(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommandWithoutParameter command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = _Command.CanExecute;
 }
コード例 #23
0
 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
ファイル: GlueFactory.cs プロジェクト: francisrc/Neutronium
 public GlueFactory(HTMLViewContext context, IJavascriptToCSharpConverter converter)
 {
     _HTMLViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }
コード例 #26
0
 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
ファイル: JSArray.cs プロジェクト: jmecosta/Neutronium
 public Neutronium.Core.Binding.CollectionChanges.CollectionChanges GetChanger(JavascriptCollectionChanges changes, IJavascriptToCSharpConverter bridge)
 {
     return(new Neutronium.Core.Binding.CollectionChanges.CollectionChanges(bridge, changes, _IndividualType));
 }
コード例 #32
0
 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
ファイル: JsCommand_T.cs プロジェクト: zengfr/Neutronium
 public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand <T> command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = true;
 }
コード例 #35
0
ファイル: JsSimpleCommand.cs プロジェクト: zengfr/Neutronium
 public JsSimpleCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand) :
     base(context, converter)
 {
     _JsSimpleCommand = simpleCommand;
 }
コード例 #36
0
 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;
 }