예제 #1
0
        private async void GoLive(IWebViewComponent viewControl)
        {
            if (Mode != ApplicationMode.Dev)
            {
                return;
            }

            var resourceLoader = new ResourceReader("SetUp.script", this);
            var createOverlay  = resourceLoader.Load("loading.js");

            viewControl.ExecuteJavascript(createOverlay);

            var updateOverlay = resourceLoader.Load("update.js");
            var messageCount  = 0;

            void OnNpmLog(string information)
            {
                if (messageCount++ < 2)
                {
                    return;
                }

                var text = JavascriptNamer.GetCreateExpression(information);
                var code = updateOverlay.Replace("{information}", text);

                viewControl.ExecuteJavascript(code);
            }

            UpdateSetUp(await _Builder.BuildFromMode(ApplicationMode.Live, OnNpmLog));
            await viewControl.SwitchViewAsync(Uri);
        }
예제 #2
0
        private async Task DoGoLive(IWebViewComponent viewControl, CancellationToken token)
        {
            var resourceLoader = GetResourceReader();
            var updateOverlay  = resourceLoader.Load("update.js");

            void OnNpmLog(string information)
            {
                if (information == null)
                {
                    return;
                }

                var text = JavascriptNamer.GetCreateExpression(information);
                var code = updateOverlay.Replace("{information}", text);

                viewControl.ExecuteJavascript(code);
            }

            UpdateSetUp(await _Builder.BuildFromMode(ApplicationMode.Live, token, OnNpmLog));
        }