private void InitViews()
        {
            wordGridViewModel = new WordInformationViewModel();

            wordsGridView.ViewModel              = wordGridViewModel;
            wordsGridView.WordClicked           += OnWordsGridViewWordClicked;
            wordsGridView.ReTokenizeClicked     += OnReTokenizeClicked;
            wordsGridView.UndoReTokenizeClicked += OnUndoReTokenizeClicked;

            dictionaryWordView.ViewModel           = dictionaryWordViewModel;
            dictionaryWordView.OnExampleCliked    += OnExampleCliked;
            dictionaryWordView.KanjiClickEvent    += OnDictionaryWordViewKanjiClickEvent;
            dictionaryWordView.OnWebSearchClicked += OnWebSearchClicked;

            pageControl.ItemsPerPage = MAX_RESULTS_PER_PAGE;
            pageControl.PageChanged += OnPageChanged;

            SetupSearchOptions();
            searchMethod = SearchAutoDectectInput;

            ocrOneWordView.ViewModel    = new OcrOneWordViewModel();
            ocrOneWordView.WordClicked += OnOcrOneWordViewWordClicked;

            DataObject.AddPastingHandler(searchTextBox, OnSearchTextBoxPaste);
        }
示例#2
0
        public SvgPage()
        {
            InitializeComponent();

            textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("XML");
            TextEditorOptions options = textEditor.Options;

            if (options != null)
            {
                //options.AllowScrollBelowDocument = true;
                options.EnableHyperlinks      = true;
                options.EnableEmailHyperlinks = true;
                //options.ShowSpaces = true;
                //options.ShowTabs = true;
                //options.ShowEndOfLine = true;
            }

            textEditor.ShowLineNumbers = true;

            _foldingManager  = FoldingManager.Install(textEditor.TextArea);
            _foldingStrategy = new XmlFoldingStrategy();

            textEditor.CommandBindings.Add(new CommandBinding(
                                               ApplicationCommands.Print, OnPrint, OnCanExecuteTextEditorCommand));
            textEditor.CommandBindings.Add(new CommandBinding(
                                               ApplicationCommands.PrintPreview, OnPrintPreview, OnCanExecuteTextEditorCommand));

            _searchHandler = new SearchInputHandler(textEditor.TextArea);
            textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(_searchHandler);
        }
示例#3
0
        public FileEditor()
        {
            InitializeComponent();

            SyntaxHighlightingHelper.RegisterHightingExtensions();

            // set the Syntax Highlighting definitions
            SyntaxDefinitions.ItemsSource = HighlightingManager.Instance.HighlightingDefinitions;

            // Set the initial Font Family to Consolas
            FontChoice.ItemsSource  = Fonts.SystemFontFamilies.OrderBy(p => p.Source);
            FontChoice.SelectedItem = ConsolasFont;

            // disable unnecessary editor features
            Editor.Options.CutCopyWholeLine      = false;
            Editor.Options.EnableEmailHyperlinks = false;
            Editor.Options.EnableHyperlinks      = false;
            Editor.Options.ConvertTabsToSpaces   = true;

            Editor.TextArea.SelectionCornerRadius = 0;

            var searchInput = new SearchInputHandler(Editor.TextArea);

            Editor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(searchInput);
        }
示例#4
0
 public override void Detach()
 {
     base.Detach();
     if (textArea != null)
     {
         textArea.DefaultInputHandler.NestedInputHandlers.Remove(handler);
         textArea = null;
         handler  = null;
     }
 }
示例#5
0
 public override void Attach(ITextEditor editor)
 {
     base.Attach(editor);
     textArea = editor.GetService(typeof(TextArea)) as TextArea;
     if (textArea != null)
     {
         handler = new SearchInputHandler(textArea);
         textArea.DefaultInputHandler.NestedInputHandlers.Add(handler);
         handler.SearchOptionsChanged += SearchOptionsChanged;
     }
 }
示例#6
0
        public void ShowQuickFind()
        {
            foreach (ITextAreaInputHandler handler in _Editor.TextArea.DefaultInputHandler.NestedInputHandlers)
            {
                if (handler is SearchInputHandler)
                {
                    _Editor.TextArea.Focus();

                    SearchInputHandler search = (SearchInputHandler)handler;
                    search.Open();
                }
            }
        }
示例#7
0
        public ContentViewerPane()
        {
            InitializeComponent();

            SyntaxHighlightingHelper.RegisterHightingExtensions();

            // set the Syntax Highlighting definitions
            LanguageBox.ItemsSource = HighlightingManager.Instance.HighlightingDefinitions;

            // disable unnecessary editor features
            contentBox.Options.CutCopyWholeLine       = false;
            contentBox.Options.EnableEmailHyperlinks  = false;
            contentBox.Options.EnableHyperlinks       = false;
            contentBox.TextArea.SelectionCornerRadius = 0;

            var searchInput = new SearchInputHandler(contentBox.TextArea);

            _findCommand = searchInput.CommandBindings.FirstOrDefault(binding => binding.Command == ApplicationCommands.Find);
            contentBox.TextArea.DefaultInputHandler.NestedInputHandlers.Add(searchInput);
        }