예제 #1
0
 internal JsUpdateHelper(IBindingLifeCycle bindingLifeCycle, HtmlViewContext context, Lazy <IJavascriptFrameworkMapper> frameworkMapper, ISessionCache sessionCache)
 {
     _Context = context;
     _JavascriptFrameworkMapper = frameworkMapper;
     _SessionCache = sessionCache;
     bindingLifeCycle.OnJavascriptSessionReady += BindingLifeCycleOnJavascriptSessionReady;
 }
 internal JavascriptFrameworkRealMapper(HtmlViewContext context, IJavascriptSessionInjector sessionInjector, IInternalSessionCache sessionCache, IJavascriptObjectBuilderStrategy builderStrategy)
 {
     _SessionInjector = sessionInjector;
     _SessionCache    = sessionCache;
     _BuilderStrategy = builderStrategy;
     _Context         = context;
 }
예제 #3
0
 internal JsUpdateHelper(ISessionMapper sessionMapper, HtmlViewContext context, Func <IJavascriptObjectBuilderStrategy> strategy, SessionCacher sessionCache)
 {
     _SessionMapper   = sessionMapper;
     _Context         = context;
     _BuilderStrategy = new Lazy <IJavascriptObjectBuilderStrategy>(strategy);
     _SessionCache    = sessionCache;
     _SessionMapper.OnJavascriptSessionReady += _SessionMapper_OnJavascriptSessionReady;
 }
예제 #4
0
 internal HtmlBinding(BidirectionalMapper convertToJso, IWebSessionLogger logger)
 {
     _Context             = convertToJso.Context;
     _BidirectionalMapper = convertToJso;
     _Logger = logger;
     _Bindings.Add(this);
     _Logger.Debug(() => $"HTML_Binding {_Current} created");
 }
예제 #5
0
 internal HtmlBinding(BidirectionalMapper bidirectionalMapper)
 {
     _Context             = bidirectionalMapper.Context;
     _BidirectionalMapper = bidirectionalMapper;
     _Logger = _Context.Logger;
     _Bindings.Add(this);
     _Logger.Debug(() => $"HTML_Binding {_Current} created");
 }
예제 #6
0
        internal static IJavascriptFrameworkMapper GetMapper(this HtmlViewContext context, IInternalSessionCache sessionCache, IJavascriptObjectBuilderStrategy builderStrategy)
        {
            var mapping = context.JavascriptFrameworkIsMappingObject;

            return(mapping
                ? (IJavascriptFrameworkMapper) new JavascriptFrameworkRealMapper(context, context.JavascriptSessionInjector, sessionCache, builderStrategy)
                : new JavascriptFrameworkNoMapper(context, sessionCache, builderStrategy));
        }
예제 #7
0
 public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand command) :
     base(context, converter)
 {
     _Command = command;
     try
     {
         _CanExecute = _Command.CanExecute(null);
     }
     catch { }
 }
예제 #8
0
 internal JsCommand(HtmlViewContext context, IJavascriptToGlueMapper converter, ICommand command) :
     base(context, converter)
 {
     _Command = command;
     try
     {
         _CanExecute = _Command.CanExecute(null);
     }
     catch { }
 }
예제 #9
0
        public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand command)
        {
            _JavascriptToCSharpConverter = converter;
            _HtmlViewContext             = context;
            _Command = command;

            try
            {
                _InitialCanExecute = _Command.CanExecute(null);
            }
            catch { }
        }
예제 #10
0
        public override void Install(IServiceProvider serviceProvider, IViewManager viewManager)
        {
            base.Install(serviceProvider, viewManager);

            HtmlViewContext dbContext = serviceProvider.GetService <HtmlViewContext>();

            if (dbContext == null)
            {
                throw new Exception("Unable to install HtmlView tables");
            }

            dbContext.Database.Migrate();
        }
        protected override void Init()
        {
            _CSharpMapper          = Substitute.For <ISessionCache>();
            _ObjectChangesListener = new ObjectChangesListener(_ => { }, _ => { }, _ => { }, _ => { });
            _GlueFactory           = new GlueFactory(null, _CSharpMapper, null, _ObjectChangesListener);
            _CSharpMapper.GetCached(Arg.Any <object>()).Returns((IJsCsGlue)null);
            _JavascriptFrameworkManager = Substitute.For <IJavascriptFrameworkManager>();
            _HtmlViewContext            = new HtmlViewContext(WebBrowserWindow, GetTestUIDispacther(), _JavascriptFrameworkManager, _Logger);
            _ConverTOJSO = new CSharpToGlueMapper(_CSharpMapper, _GlueFactory, _Logger);
            _Test        = new TestClass {
                S1 = "string", I1 = 25
            };
            _Tests = new List <TestClass>
            {
                new TestClass()
                {
                    S1 = "string1", I1 = 1
                },
                new TestClass()
                {
                    S1 = "string2", I1 = 2
                }
            };
            _Test2 = new Test2()
            {
                T1 = _Test, T2 = _Test
            };

            _TestsNg = new ArrayList
            {
                _Tests[0],
                _Tests[0]
            };

            _CircularSimple           = new Circular1();
            _CircularSimple.Reference = _CircularSimple;

            _CircularComplex = new Circular2();
            var circularChild = new Circular2
            {
                Reference = _CircularComplex
            };

            _CircularComplex.List.Add(circularChild);
        }
예제 #12
0
 public JsMappedCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand <T> resultCommand)
     : base(context, converter, resultCommand)
 {
 }
예제 #13
0
 internal StringBinding(HtmlViewContext context, IJavascriptObject root)
 {
     _Context = context;
     _Root    = root;
 }
 public JsMappedCommandWithoutParameter(HtmlViewContext context, IJavascriptToGlueMapper converter, ICommandWithoutParameter command)
     : base(context, converter, command)
 {
 }
 public JsMappableSimpleCommand(HtmlViewContext context, IJavascriptToGlueMapper converter, ISimpleCommand resultCommand)
     : base(context, converter, resultCommand)
 {
 }
예제 #16
0
 public JsSimpleCommand(HtmlViewContext context, IJavascriptToGlueMapper converter, ISimpleCommand <T> simpleCommand) :
     base(context, converter)
 {
     _JsSimpleCommand = simpleCommand;
 }
예제 #17
0
 public GlueFactory(HtmlViewContext context, ICSharpToJsCache cacher, IJavascriptToCSharpConverter converter, ObjectChangesListener onListener)
     : base(cacher, onListener)
 {
     _HtmlViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }
 protected JsResultCommandBase(HtmlViewContext context, ICSharpUnrootedObjectManager manager, IJavascriptToGlueMapper converter)
 {
     _HtmlViewContext             = context;
     JavascriptToGlueMapper       = converter;
     _CSharpUnrootedObjectManager = manager;
 }
예제 #19
0
 public JsMappableResultCommand(HtmlViewContext context, ICSharpUnrootedObjectManager manager, IJavascriptToGlueMapper converter, IResultCommand <TArg, TResult> resultCommand)
     : base(context, manager, converter, resultCommand)
 {
 }
예제 #20
0
 public JsResultCommand(HtmlViewContext context, ICSharpUnrootedObjectManager manager, IJavascriptToGlueMapper converter, IResultCommand <TResult> resultCommand) :
     base(context, manager, converter)
 {
     _JsResultCommand = resultCommand;
 }
예제 #21
0
 public JsMappableCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand command) :
     base(context, converter, command)
 {
 }
예제 #22
0
 public JsSimpleCommandBase(HtmlViewContext context, IJavascriptToGlueMapper converter)
 {
     _HtmlViewContext       = context;
     JavascriptToGlueMapper = converter;
 }
예제 #23
0
 public JsResultCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, IResultCommand <TArg, TResult> resultCommand) :
     base(context, converter)
 {
     _JsResultCommand = resultCommand;
 }
예제 #24
0
 public JsCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ICommand <T> command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = true;
 }
예제 #25
0
 internal JsCommandWithoutParameter(HtmlViewContext context, IJavascriptToGlueMapper converter, ICommandWithoutParameter command) :
     base(context, converter)
 {
     _Command    = command;
     _CanExecute = _Command.CanExecute;
 }
예제 #26
0
 public JsSimpleCommandBase(HtmlViewContext context, IJavascriptToCSharpConverter converter)
 {
     _HtmlViewContext             = context;
     _JavascriptToCSharpConverter = converter;
 }
예제 #27
0
 public JsSimpleCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, ISimpleCommand simpleCommand) :
     base(context, converter)
 {
     _JsSimpleCommand = simpleCommand;
 }
예제 #28
0
 public JsResultCommand(HtmlViewContext context, IJavascriptToCSharpConverter converter, IResultCommand resultCommand)
 {
     _HtmlViewContext             = context;
     _JavascriptToCSharpConverter = converter;
     _JsResultCommand             = resultCommand;
 }
예제 #29
0
 protected JsCommandBase(HtmlViewContext context, IJavascriptToCSharpConverter converter)
 {
     _JavascriptToCSharpConverter = converter;
     _HtmlViewContext             = context;
 }
 internal JavascriptFrameworkNoMapper(HtmlViewContext context, ISessionCache sessionCache, IJavascriptObjectBuilderStrategy builderStrategy)
 {
     _Context         = context;
     _SessionCache    = sessionCache;
     _BuilderStrategy = builderStrategy;
 }