ConverterWordDialogViewModel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. using ComDocumentAIKit;
  2. using ComPDFKit_Conversion.Converter;
  3. using ComPDFKit_Conversion.Options;
  4. using ComPDFKitViewer.PdfViewer;
  5. using ImageMagick;
  6. using PDF_Master.CustomControl;
  7. using PDF_Master.EventAggregators;
  8. using PDF_Master.Helper;
  9. using PDF_Master.Model;
  10. using PDF_Master.Model.Dialog.ConverterDialogs;
  11. using PDF_Master.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
  12. using PDF_Master.Properties;
  13. using Prism.Commands;
  14. using Prism.Mvvm;
  15. using Prism.Services.Dialogs;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Diagnostics;
  19. using System.Globalization;
  20. using System.IO;
  21. using System.Linq;
  22. using System.Windows;
  23. using System.Windows.Controls;
  24. using System.Windows.Forms;
  25. using DialogResult = Prism.Services.Dialogs.DialogResult;
  26. namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
  27. {
  28. public class ConverterWordDialogViewModel : BindableBase, IDialogAware
  29. {
  30. #region 文案
  31. private string T_title;
  32. public string T_Title
  33. {
  34. get { return T_title; }
  35. set
  36. {
  37. SetProperty(ref T_title, value);
  38. }
  39. }
  40. private string T_yes;
  41. public string T_YES
  42. {
  43. get { return T_yes; }
  44. set
  45. {
  46. SetProperty(ref T_yes, value);
  47. }
  48. }
  49. private string T_no;
  50. public string T_No
  51. {
  52. get { return T_no; }
  53. set
  54. {
  55. SetProperty(ref T_no, value);
  56. }
  57. }
  58. private string T_pageRange;
  59. public string T_PageRange
  60. {
  61. get { return T_pageRange; }
  62. set
  63. {
  64. SetProperty(ref T_pageRange, value);
  65. }
  66. }
  67. private string _TextUpgrade;
  68. public string TextUpgrade
  69. {
  70. get { return _TextUpgrade; }
  71. set { _TextUpgrade = value; }
  72. }
  73. private void IntString()
  74. {
  75. TextUpgrade = App.ServiceLoader.GetString("TextUpgrade");
  76. T_Title = App.MainPageLoader.GetString("Convert_PDFToWordTitle");
  77. T_YES = App.MainPageLoader.GetString("Convert_Yes");
  78. T_No = App.MainPageLoader.GetString("Convert_No");
  79. T_PageRange = App.MainPageLoader.GetString("Convert_PDFPageRange");
  80. }
  81. #endregion
  82. public string Title => "";
  83. public event Action<IDialogResult> RequestClose;
  84. #region 参数和属性
  85. public ConverterWordDialogModel ConverterWordModel = new ConverterWordDialogModel();
  86. public CPDFViewer currentViewer;
  87. public IDialogService dialogs;
  88. public string CurrentPageIndex = "1";
  89. public bool IsCurrentPageIndex = true;
  90. public string PageRangeText { set; get; } = "0";
  91. public string PageRangeSelectIndex { set; get; } = "0";
  92. private int maxPageRange = 0;
  93. public int MaxPageRange
  94. {
  95. get { return maxPageRange; }
  96. set
  97. {
  98. SetProperty(ref maxPageRange, value);
  99. }
  100. }
  101. private bool oCRCheckBoxIsCheckBox = false;
  102. public bool OCRCheckBoxIsCheckBox
  103. {
  104. get { return oCRCheckBoxIsCheckBox; }
  105. set
  106. {
  107. SetProperty(ref oCRCheckBoxIsCheckBox, value);
  108. ConverterWordModel.Options.IsAllowOCR = oCRCheckBoxIsCheckBox;
  109. }
  110. }
  111. private int languageSelectedIndex = 2;
  112. public int LanguageSelectedIndex
  113. {
  114. get { return languageSelectedIndex; }
  115. set
  116. {
  117. SetProperty(ref languageSelectedIndex, value);
  118. SelectLanguage(languageSelectedIndex);
  119. }
  120. }
  121. private Visibility limitationsConvertVisible = Visibility.Hidden;
  122. public Visibility LimitationsConvertVisible
  123. {
  124. get { return limitationsConvertVisible; }
  125. set
  126. {
  127. SetProperty(ref limitationsConvertVisible, value);
  128. }
  129. }
  130. private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
  131. private void InitCheckPageSelect()
  132. {
  133. CheckPageSelect.Clear();
  134. if (!IsCurrentPageIndex)
  135. {
  136. CheckPageSelect.Add("0", "0");
  137. CheckPageSelect.Add("1", "1");
  138. CheckPageSelect.Add("2", "2");
  139. CheckPageSelect.Add("3", "3");
  140. CheckPageSelect.Add("4", "4");
  141. }
  142. else
  143. {
  144. CheckPageSelect.Add("0", "0");
  145. CheckPageSelect.Add("1", "-2");
  146. CheckPageSelect.Add("2", "1");
  147. CheckPageSelect.Add("3", "2");
  148. CheckPageSelect.Add("4", "3");
  149. }
  150. }
  151. #endregion
  152. #region 委托声明
  153. public DelegateCommand<string> RadioButtonCommand { get; set; }
  154. public DelegateCommand CancelCommand { get; set; }
  155. public DelegateCommand ConverterCommnad { get; set; }
  156. public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
  157. public DelegateCommand<object> CmbPageTextChanged { get; set; }
  158. public DelegateCommand BatchConverterCommand { get; set; }
  159. public DelegateCommand<object> PreviewCancelDownCommand { get; set; }
  160. public DelegateCommand SetCustomPageRangeCommand { get; set; }
  161. public DelegateCommand UnlockMouseDownCommand { get; set; }
  162. public DelegateCommand OpenOCRCommand { get; set; }
  163. #endregion
  164. public ConverterWordDialogViewModel(IDialogService dialogService)
  165. {
  166. CancelCommand = new DelegateCommand(cancel);
  167. ConverterCommnad = new DelegateCommand(converter);
  168. RadioButtonCommand = new DelegateCommand<string>(radiobutton);
  169. CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
  170. CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
  171. SetCustomPageRangeCommand = new DelegateCommand(SetCustomPageRange);
  172. BatchConverterCommand = new DelegateCommand(BatchConverter);
  173. PreviewCancelDownCommand = new DelegateCommand<object>(PreviewCancelDown);
  174. UnlockMouseDownCommand = new DelegateCommand(UnlockMouseDown);
  175. OpenOCRCommand = new DelegateCommand(openOCR);
  176. dialogs = dialogService;
  177. IntString();
  178. }
  179. #region 逻辑函数
  180. private void openOCR()
  181. {
  182. if (OCRCheckBoxIsCheckBox == true)
  183. {
  184. bool folderMD5 = FileComparisonHelper.OCRModelItExist();
  185. if (folderMD5)
  186. {
  187. string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
  188. CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
  189. CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
  190. }
  191. else
  192. {
  193. AlertsMessage alertsMessage = new AlertsMessage();
  194. alertsMessage.ShowDialog(App.MainPageLoader.GetString("OCR_PleaseDownload"), "", App.MainPageLoader.GetString("OCR_CancelDownload"), App.MainPageLoader.GetString("OCR_Download"));
  195. if (alertsMessage.result == ContentResult.Ok)
  196. {
  197. FileComparisonHelper.RemoveOCRModel();
  198. DialogParameters oCRDownloadProgress = new DialogParameters();
  199. dialogs.ShowDialog(DialogNames.OCRDownloadProgress, oCRDownloadProgress, e =>
  200. {
  201. if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
  202. {
  203. string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
  204. CPDFConverter.InitOCRLibrary(Path.Combine(folderPath, "x64"));
  205. CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
  206. }
  207. else
  208. {
  209. OCRCheckBoxIsCheckBox = false;
  210. }
  211. });
  212. }
  213. else
  214. {
  215. OCRCheckBoxIsCheckBox = false;
  216. }
  217. }
  218. }
  219. }
  220. public void SetCustomPageRange()
  221. {
  222. if (PageRangeSelectIndex == CheckPageSelect["4"])
  223. {
  224. List<int> PageIndexLists = new List<int>();
  225. if (!CommonHelper.GetPagesInRange(ref PageIndexLists, PageRangeText, currentViewer.Document.PageCount, new char[] { ',' }, new char[] { '-' }))
  226. { //TODO
  227. //AlertsMessage alertsMessage = new AlertsMessage();
  228. //alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  229. //if (alertsMessage.result == ContentResult.Ok)
  230. //{
  231. // return;
  232. //}
  233. //else
  234. //{
  235. // //this.eventAggregator.GetEvent<DeleteWatermarkEvent>().Publish(new EnumDeleteUnicode
  236. // //{
  237. // // Unicode = Unicode,
  238. // // Status = EnumDelete.StatusCreate
  239. // //});
  240. // return;
  241. //}
  242. }
  243. }
  244. }
  245. private void cancel()
  246. {
  247. RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
  248. }
  249. private void PreviewCancelDown(object e)
  250. {
  251. var PageRangeComboBox = e as WritableComboBox;
  252. if (PageRangeComboBox != null)
  253. {
  254. PageRangeComboBox.IsloseFocus = false;
  255. }
  256. }
  257. private void UnlockMouseDown()
  258. {
  259. ConverterHelper.convertUnlock();
  260. }
  261. private void converter()
  262. {
  263. if (PageRangeSelectIndex == CheckPageSelect["4"])
  264. {
  265. List<int> PageIndexLists = new List<int>();
  266. if (!CommonHelper.GetPagesInRange(ref PageIndexLists, PageRangeText, currentViewer.Document.PageCount, new char[] { ',' }, new char[] { '-' }))
  267. { //TODO
  268. AlertsMessage alertsMessage = new AlertsMessage();
  269. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  270. if (alertsMessage.result == ContentResult.Ok)
  271. {
  272. return;
  273. }
  274. else
  275. {
  276. //this.eventAggregator.GetEvent<DeleteWatermarkEvent>().Publish(new EnumDeleteUnicode
  277. //{
  278. // Unicode = Unicode,
  279. // Status = EnumDelete.StatusCreate
  280. //});
  281. return;
  282. }
  283. }
  284. }
  285. System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
  286. /*
  287. *设置这个对话框的起始保存路径
  288. */
  289. sfd.InitialDirectory = currentViewer.Document.FilePath;
  290. /*
  291. *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
  292. */
  293. sfd.Filter = "Word|*.docx;";
  294. /*
  295. *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
  296. */
  297. sfd.FileName = currentViewer.Document.FileName + ".docx";
  298. /*
  299. * 做一些工作
  300. */
  301. if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  302. {
  303. ConverterWordModel.OutputPath = sfd.FileName;
  304. try { if (File.Exists(ConverterWordModel.OutputPath)) File.Delete(ConverterWordModel.OutputPath); }
  305. catch
  306. {
  307. AlertsMessage alertsMessage = new AlertsMessage();
  308. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("FileNotExistWarning"), App.ServiceLoader.GetString("Text_ok"));
  309. return;
  310. }
  311. }
  312. else
  313. {
  314. return;
  315. }
  316. HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterWordModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
  317. if (ConverterWordModel.PageRange == "")
  318. {
  319. Trace.WriteLine("输入不对");
  320. AlertsMessage alertsMessage = new AlertsMessage();
  321. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  322. return;
  323. }
  324. char[] enumerationSeparator = new char[] { ',' };
  325. char[] rangeSeparator = new char[] { '-' };
  326. if (!CommonHelper.GetPagesInRange(ref ConverterWordModel.PageIndexLists, ConverterWordModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  327. { //TODO
  328. Trace.WriteLine("输入不对");
  329. AlertsMessage alertsMessage = new AlertsMessage();
  330. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  331. return;
  332. }
  333. ConverterWordModel.wordOptions = ConverterWordModel.WordOptions();
  334. //DialogParameters value = new DialogParameters();
  335. //value.Add(ParameterNames.ConverterType, "Word");
  336. //value.Add(ParameterNames.ConverterTypeModel, ConverterWordModel);
  337. var dialogresult = new DialogResult(ButtonResult.OK);
  338. dialogresult.Parameters.Add(ParameterNames.ConverterType, "Word");
  339. dialogresult.Parameters.Add(ParameterNames.ConverterTypeModel, ConverterWordModel);
  340. RequestClose.Invoke(dialogresult);
  341. //RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
  342. //dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
  343. //{
  344. //});
  345. }
  346. private void CmbPageSelectionChangedEvent(object e)
  347. {
  348. ///这里采用的是将预览UI控件传递过来的方式,为下下策
  349. ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
  350. ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
  351. var ConverterPreview = e as PageTurningPreview;
  352. if (ConverterPreview != null)
  353. {
  354. string PageRangeSelectIndex = this.PageRangeSelectIndex;
  355. var currentViewer = this.currentViewer;
  356. string PageRange = "";
  357. var PageRangeText = this.PageRangeText;
  358. if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"] || PageRangeSelectIndex == CheckPageSelect["4"])
  359. {
  360. if (PageRangeSelectIndex == CheckPageSelect["4"]) { HomePageEditHelper.GetPagerange("0", currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex); } else { HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex); }
  361. char[] enumerationSeparator = new char[] { ',' };
  362. char[] rangeSeparator = new char[] { '-' };
  363. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  364. { //TODO
  365. ConverterPreview.PageIndexLists.Add(0);
  366. Trace.WriteLine("输入不对");
  367. AlertsMessage alertsMessage = new AlertsMessage();
  368. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  369. return;
  370. }
  371. }
  372. if (PageRangeSelectIndex == CheckPageSelect["1"])
  373. {
  374. char[] enumerationSeparator = new char[] { ',' };
  375. char[] rangeSeparator = new char[] { '-' };
  376. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (currentViewer.CurrentIndex + 1).ToString()
  377. , currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  378. { //TODO
  379. Trace.WriteLine("输入不对");
  380. AlertsMessage alertsMessage = new AlertsMessage();
  381. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  382. return;
  383. }
  384. this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  385. }
  386. // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  387. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  388. ConverterPreview.CurrentIndex = 0;
  389. }
  390. }
  391. private void CmbPageTextChangedEvent(object e)
  392. {
  393. var ConverterPreview = e as PageTurningPreview;
  394. if (ConverterPreview != null)
  395. {
  396. if (ConverterPreview != null)
  397. {
  398. string PageRangeSelectIndex = this.PageRangeSelectIndex;
  399. var currentViewer = this.currentViewer;
  400. string PageRange = "";
  401. var PageRangeText = this.PageRangeText;
  402. HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
  403. char[] enumerationSeparator = new char[] { ',' };
  404. char[] rangeSeparator = new char[] { '-' };
  405. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  406. { //TODO
  407. HomePageEditHelper.GetPagerange("0", currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
  408. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  409. { //TODO
  410. ConverterPreview.PageIndexLists.Add(0);
  411. Trace.WriteLine("输入不对");
  412. AlertsMessage alertsMessage = new AlertsMessage();
  413. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  414. return;
  415. }
  416. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  417. ConverterPreview.CurrentIndex = 0;
  418. return;
  419. }
  420. else
  421. {
  422. // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  423. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  424. ConverterPreview.CurrentIndex = 0;
  425. }
  426. }
  427. }
  428. }
  429. private void BatchConverter()
  430. {
  431. DialogParameters convertpdftoword = new DialogParameters();
  432. convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
  433. convertpdftoword.Add("ConverterTypeIndex", 0);
  434. HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
  435. HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
  436. convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
  437. dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
  438. }
  439. private void radiobutton(string e)
  440. {
  441. string radioButton = e;
  442. if (radioButton != null)
  443. {
  444. switch (radioButton)
  445. {
  446. case "FlowingTextRadioBtn":
  447. ConverterWordModel.Options.LayoutOpts = LayoutOptions.RetainFlowingText;
  448. break;
  449. case "PageLayoutRadioBtn":
  450. ConverterWordModel.Options.LayoutOpts = LayoutOptions.RetainFlowingText;
  451. break;
  452. default:
  453. break;
  454. }
  455. }
  456. }
  457. private void SelectLanguage(int SelectedIndex)
  458. {
  459. switch (SelectedIndex)
  460. {
  461. case 0:
  462. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageChinese;
  463. break;
  464. case 1:
  465. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageChineseTraditional;
  466. break;
  467. case 2:
  468. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageEnglish;
  469. break;
  470. case 3:
  471. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageJapanese;
  472. break;
  473. case 4:
  474. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageKorean;
  475. break;
  476. default:
  477. break;
  478. }
  479. }
  480. #endregion
  481. #region 构架行为
  482. public bool CanCloseDialog()
  483. {
  484. return true;
  485. }
  486. public void OnDialogClosed()
  487. {
  488. }
  489. public void OnDialogOpened(IDialogParameters parameters)
  490. {
  491. CPDFViewer pdfViewer = null;
  492. parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
  493. parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
  494. if (pdfViewer != null)
  495. {
  496. InitCheckPageSelect();
  497. currentViewer = pdfViewer;
  498. MaxPageRange = currentViewer.Document.PageCount;
  499. if (currentViewer.Tag != null) { ConverterWordModel.Pawssword = currentViewer.Tag.ToString(); }
  500. ConverterWordModel.InputPath = pdfViewer.Document.FilePath;
  501. FileInfo fileinfo = new FileInfo(ConverterWordModel.InputPath);
  502. ConverterWordModel.OutputPath = fileinfo.DirectoryName;
  503. if (Settings.Default.UserDate.subscribestatus != 1)
  504. {
  505. LimitationsConvertVisible = Visibility.Visible;
  506. }
  507. LanguageSelectedIndex = ConverterHelper.GetCOCRLanguageInt();
  508. }
  509. }
  510. #endregion
  511. }
  512. }