|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Windows; |
|
|
using System.Windows.Controls; |
|
|
using System.Windows.Data; |
|
|
using System.Windows.Documents; |
|
|
using System.Windows.Forms; |
|
|
using System.Windows.Input; |
|
|
using System.Windows.Media; |
|
|
using System.Windows.Media.Imaging; |
|
|
using System.Windows.Shapes; |
|
|
|
|
|
namespace WpfEditor |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
public partial class OCRResultWindow : Window |
|
|
{ |
|
|
private string selectText = ""; |
|
|
|
|
|
public OCRResultWindow(string text="") |
|
|
{ |
|
|
InitializeComponent(); |
|
|
if (text.Length > 0) |
|
|
{ |
|
|
richTextBox.AppendText(text); |
|
|
} |
|
|
richTextBox.PreviewMouseRightButtonUp += RichTextBox_PreviewMouseRightButtonUp; |
|
|
} |
|
|
|
|
|
|
|
|
private void RichTextBox_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e) |
|
|
{ |
|
|
var selected = richTextBox.Selection.Text; |
|
|
if (selectText != selected) |
|
|
{ |
|
|
selectText = selected; |
|
|
} |
|
|
} |
|
|
|
|
|
private void CutMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
richTextBox.Cut(); |
|
|
} |
|
|
|
|
|
private void CopyMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
richTextBox.Copy(); |
|
|
} |
|
|
|
|
|
private void PasteMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
richTextBox.Paste(); |
|
|
} |
|
|
|
|
|
private void JishoMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
var content = System.Web.HttpUtility.UrlEncode(this.selectText); |
|
|
|
|
|
String url = $"https://jisho.org/search/{content}"; |
|
|
|
|
|
} |
|
|
|
|
|
private void NaverMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
var content = System.Web.HttpUtility.UrlEncode(this.selectText); |
|
|
|
|
|
String url = $"https://ko.dict.naver.com/#/search?query={content}"; |
|
|
|
|
|
} |
|
|
|
|
|
private void NaverjaMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
var content = System.Web.HttpUtility.UrlEncode(this.selectText); |
|
|
|
|
|
String url = $"https://ja.dict.naver.com/#/search?query={content}&range=all"; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
private void EchodictMenuItem_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|