public CSLProcessorOutputConsumer(string script_directory, string citations_javascript, BibliographyReadyDelegate brd, object user_argument)
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

            this.citations_javascript = citations_javascript;
            this.brd           = brd;
            this.user_argument = user_argument;

            // Create the browser
            Logging.Info("Creating web browser for InCite CSL processing");
            web_browser = new GeckoWebBrowser();
            web_browser.CreateControl();

            // Add the name of the script to run
            script_directory = Path.GetFullPath(Path.Combine(script_directory, @"runengine.html"));
            script_directory = script_directory.Replace(@"\\", @"\");
            script_directory = script_directory.Replace(@"//", @"/");

            Uri uri = new Uri(script_directory);

            Logging.Info("CSLProcessorOutputConsumer is about to browse to {0}", uri);

            // This is the only way we can communicate from JavaScript to .NET!!
            web_browser.EnableConsoleMessageNotfication();
            web_browser.ConsoleMessage += web_browser_ConsoleMessage;

            // Kick off citeproc computation
            web_browser.Navigate(uri.ToString());
        }
Exemplo n.º 2
0
        public CSLProcessorOutputConsumer(string script_directory, string citations_javascript, BibliographyReadyDelegate brd, object user_argument)
        {
            this.citations_javascript = citations_javascript;
            this.brd           = brd;
            this.user_argument = user_argument;

            // Create the browser
            Logging.Info("Creating web browser");
            web_browser = new GeckoWebBrowser();
            web_browser.CreateControl();

            // Add the name of the script to run
            script_directory = script_directory + "\\runengine.html";
            script_directory = script_directory.Replace("\\\\", "\\");
            script_directory = script_directory.Replace("//", "/");

            Uri uri = new Uri(script_directory);

            Logging.Info("CSLProcessorOutputConsumer is about to browse to " + uri);

            // This is the only way we can communicate from JavaScript to .NET!!
            web_browser.EnableConsoleMessageNotfication();
            web_browser.ConsoleMessage += web_browser_ConsoleMessage;

            // Kick off citeproc computation
            web_browser.Navigate(uri.ToString());
        }