Esempio n. 1
0
        private void parseSelectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string sel = lastIsRealSelection ? lastSelection : null;

            if (!string.IsNullOrWhiteSpace(sel))
            {
                ParseResult pr = lastSelectedParseResult;
                if (pr != null)
                {
                    Settings.app.removeBannedWord(sel);
                    if (lastParseOptions == null)
                    {
                        lastParseOptions = new ParseOptions();
                    }
                    lastParseOptions.addUserWord(sel);
                    waitingForId = pr.id;
                    TranslationService.instance.updateId(pr.id, pr.asText(), lastParseOptions).ContinueWith((res) => {
                        ParseResult newRes = res.Result;
                        if (newRes != null && !newRes.getParts().Any((p) => p.asText() == sel))
                        {
                            webBrowser1.callScript("flash", "No match found");
                        }
                        else
                        {
                            submitParseResult(newRes);
                        }
                    });
                }
            }
        }