public TranslationMouseProcessor(IWpfTextView view) { try { _translationAdornmentManager = view.Properties.GetProperty <TranslationAdornmentManager>(typeof(TranslationAdornmentManager)); } catch (Exception e) { Console.WriteLine(e); } }
public static void Execute(IWpfTextView view, TranslationRequest request) { TranslationAdornmentManager manager = null; try { manager = view.Properties.GetProperty <TranslationAdornmentManager>(typeof(TranslationAdornmentManager)); } catch (Exception e) { Console.WriteLine(e); } if (manager == null) { return; } manager.AddTranslation(view.Selection.SelectedSpans[0], request); request.GetTranslationAsync(); }
public void TextViewCreated(IWpfTextView textView) { TranslationAdornmentManager.Create(textView); // AddCommandFilter(textView, new TranslationCommandFilter(textView)); }
public TranslationCommandFilter(IWpfTextView tv) { m_textView = tv; _translationAdornmentManager = m_textView.Properties.GetProperty<TranslationAdornmentManager>(typeof (TranslationAdornmentManager)); }
public TranslationCommandFilter(IWpfTextView tv) { m_textView = tv; _translationAdornmentManager = m_textView.Properties.GetProperty <TranslationAdornmentManager>(typeof(TranslationAdornmentManager)); }