Ejemplo n.º 1
0
            public void OnDialogClosed(IQuickFilingDialog qfDialog)
            {
                if (!Electron.WindowManager.BrowserWindows.Any() || qfDialog.SelectedItem == null)
                {
                    return;
                }

                var hierarchyId = qfDialog.SelectedItem;
                var javascript  = $"{callbackFunction}('{hierarchyId}')";

                AsyncUtil.RunSync(() => ElectronUtils.ExecuteJavascript(javascript));
            }
Ejemplo n.º 2
0
        public async Task <AnalysisSessionVm> Handle(Request request, CancellationToken cancellationToken)
        {
            var navigationProviderInfo = await dbContext.NavigationProvidersInfo
                                         .Where(p => p.Id == request.NavigationProviderId)
                                         .SingleAsync(cancellationToken);

            oneNoteNavigationProvider.SetParameters(navigationProviderInfo);

            var options = new AnalyzerOptions()
            {
                Depth = AnalyzeDepth.All
            };


            var analysisSession = await analyzer.AnalyzeAsync(oneNoteNavigationProvider, options, async (documentId, parseResult) =>
            {
                var javascript = $"{request.DocumentProcessedCallbackFunction}('{documentId.DocumentId}')";
                await ElectronUtils.ExecuteJavascript(javascript);
            }, cancellationToken);

            return(mapper.Map <AnalysisSessionVm>(analysisSession));
        }
Ejemplo n.º 3
0
        private static Process RunUi()
        {
            var uiProcess = new Process();

            if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix)
            {
                uiProcess.StartInfo.FileName               = "/bin/bash";
                uiProcess.StartInfo.Arguments              = "-c \"npm run electron\"";
                uiProcess.StartInfo.WorkingDirectory       = ElectronUtils.FindElectronUiDirectory("Electron", Environment.CurrentDirectory);
                uiProcess.StartInfo.RedirectStandardOutput = true;
                uiProcess.StartInfo.UseShellExecute        = false;
            }
            else
            {
                uiProcess.StartInfo.FileName  = "cmd";
                uiProcess.StartInfo.Arguments = "/C npm run electron";
                uiProcess.StartInfo.RedirectStandardOutput = true;
                uiProcess.StartInfo.WorkingDirectory       = ElectronUtils.FindElectronUiDirectory("Electron", Environment.CurrentDirectory);
            }

            uiProcess.Start();
            return(uiProcess);
        }
Ejemplo n.º 4
0
        public void ShouldFindFolderInCurrentLevel(string folderName, string rootFolderName, string result)
        {
            var path = ElectronUtils.FindElectronUiDirectory(folderName, rootFolderName);

            Assert.Equal(path, result);
        }