MeasureControl.xaml.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. using ComPDFKit.Measure;
  2. using ComPDFKit.PDFAnnotation;
  3. using ComPDFKit.Tool;
  4. using ComPDFKit.Controls.Helper;
  5. using ComPDFKit.Controls.PDFControl;
  6. using ComPDFKitViewer;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Diagnostics;
  11. using System.Drawing;
  12. using System.Globalization;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Windows;
  18. using System.Windows.Controls;
  19. using System.Windows.Data;
  20. using System.Windows.Documents;
  21. using System.Windows.Input;
  22. using System.Windows.Media;
  23. using System.Windows.Media.Imaging;
  24. using System.Windows.Navigation;
  25. using System.Windows.Shapes;
  26. using ComPDFKit.PDFPage;
  27. using ComPDFKit.Tool.Help;
  28. using ComPDFKit.Viewer.Annot;
  29. using ComPDFKitViewer.BaseObject;
  30. using Path = System.IO.Path;
  31. namespace ComPDFKit.Controls.Measure
  32. {
  33. public partial class MeasureControl : UserControl
  34. {
  35. public MeasurePropertyControl measurePropertyControl = new MeasurePropertyControl();
  36. private CPDFDisplaySettingsControl displaySettingsControl;
  37. private PDFViewControl PdfViewControl = new PDFViewControl();
  38. private PanelState panelState = PanelState.GetInstance();
  39. private CPDFAnnotation currentAnnot = null;
  40. public event EventHandler ExpandEvent;
  41. public event EventHandler OnAnnotEditHandler;
  42. public MeasureControl()
  43. {
  44. InitializeComponent();
  45. }
  46. #region Init PDFViewer
  47. public void InitWithPDFViewer(PDFViewControl pdfViewControl)
  48. {
  49. PdfViewControl = pdfViewControl;
  50. //PdfViewControl.PDFView = pdfViewer;
  51. PDFMeasureTool.InitWithPDFViewer(pdfViewControl, measurePropertyControl, this);
  52. FloatPageTool.InitWithPDFViewer(pdfViewControl);
  53. PDFGrid.Child = PdfViewControl;
  54. panelState.PropertyChanged -= PanelState_PropertyChanged;
  55. PdfViewControl.MouseLeftButtonDownHandler -= PDFToolManager_MouseLeftButtonDownHandler;
  56. PdfViewControl.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
  57. PdfViewControl.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
  58. pdfViewControl.MouseRightButtonDownHandler -= PDFToolManager_MouseRightButtonDownHandler;
  59. PdfViewControl.PDFViewTool.MeasureChanged -= MeasureSetting_MeasureChanged;
  60. PdfViewControl.PDFViewTool.MeasureChanged += MeasureSetting_MeasureChanged;
  61. PdfViewControl.MouseLeftButtonDownHandler += PDFToolManager_MouseLeftButtonDownHandler;
  62. PdfViewControl.MouseLeftButtonUpHandler += PDFToolManager_MouseLeftButtonUpHandler;
  63. PdfViewControl.MouseMoveHandler += PDFToolManager_MouseMoveHandler;
  64. pdfViewControl.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
  65. panelState.PropertyChanged += PanelState_PropertyChanged;
  66. SetInfoPanelVisble(false, false);
  67. SettingPanel.PdfViewControl= pdfViewControl;
  68. }
  69. private void MeasureSetting_MeasureChanged(object sender, MeasureEventArgs e)
  70. {
  71. InfoPanel.SetMeasureType(e.Type);
  72. InfoPanel.SetMeasureInfo(e);
  73. }
  74. private void PDFToolManager_MouseRightButtonDownHandler(object sender, MouseEventObject e)
  75. {
  76. ContextMenu ContextMenu = PdfViewControl.GetRightMenu();
  77. if (ContextMenu == null)
  78. {
  79. ContextMenu = new ContextMenu();
  80. }
  81. switch (e.hitTestType)
  82. {
  83. case MouseHitTestType.Annot:
  84. case MouseHitTestType.SelectRect:
  85. CreateAnnotContextMenu(sender, ref ContextMenu, e.annotType);
  86. break;
  87. case MouseHitTestType.Text:
  88. CreateSelectTextContextMenu(sender, ref ContextMenu);
  89. break;
  90. case MouseHitTestType.ImageSelect:
  91. CreateSelectImageContextMenu(sender, ref ContextMenu);
  92. break;
  93. default:
  94. ContextMenu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  95. PdfViewControl.CreateViewerMenu(sender, ref ContextMenu);
  96. break;
  97. }
  98. PdfViewControl.SetRightMenu(ContextMenu);
  99. }
  100. private void CreateAnnotContextMenu(object sender, ref ContextMenu menu, C_ANNOTATION_TYPE annotType)
  101. {
  102. switch (annotType)
  103. {
  104. case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
  105. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
  106. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
  107. CreateMeasureContextMenu(sender, ref menu);
  108. break;
  109. case C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET:
  110. break;
  111. case C_ANNOTATION_TYPE.C_ANNOTATION_SOUND:
  112. case C_ANNOTATION_TYPE.C_ANNOTATION_MOVIE:
  113. case C_ANNOTATION_TYPE.C_ANNOTATION_RICHMEDIA:
  114. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  115. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Play"), Command = MediaCommands.Play, CommandTarget = (UIElement)sender, CommandParameter = (sender as CPDFViewerTool).GetCacheHitTestAnnot() });
  116. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Cut"), Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
  117. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  118. break;
  119. default:
  120. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  121. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Copy"), Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
  122. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Cut"), Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
  123. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  124. break;
  125. }
  126. }
  127. private void CreateMeasureContextMenu(object sender, ref ContextMenu menu)
  128. {
  129. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  130. MenuItem menuItem = new MenuItem();
  131. menuItem.Header = "Measurement Settings";
  132. menuItem.Click += (item, param) =>
  133. {
  134. if (currentAnnot is CPDFLineAnnotation annotation)
  135. {
  136. SettingPanel.BindMeasureSetting(annotation.GetDistanceMeasure().MeasureInfo);
  137. }
  138. SetInfoPanelVisble(false, true);
  139. };
  140. menu.Items.Add(menuItem);
  141. MenuItem propertyItem = new MenuItem();
  142. propertyItem.Header = "Properties";
  143. propertyItem.Click += (item, param) =>
  144. {
  145. panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
  146. };
  147. menu.Items.Add(propertyItem);
  148. }
  149. private void CreateSelectTextContextMenu(object sender, ref ContextMenu menu)
  150. {
  151. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Copy"), Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
  152. }
  153. private void CreateSelectImageContextMenu(object sender, ref ContextMenu menu)
  154. {
  155. if (menu == null)
  156. {
  157. menu = new ContextMenu();
  158. }
  159. MenuItem copyImage = new MenuItem();
  160. copyImage.Header = "Copy Image";
  161. copyImage.Click += CopyImage_Click;
  162. menu.Items.Add(copyImage);
  163. MenuItem extractImage = new MenuItem();
  164. extractImage.Header = "Extract Image";
  165. extractImage.Click += ExtractImage_Click;
  166. menu.Items.Add(extractImage);
  167. }
  168. private void ExtractImage_Click(object sender, RoutedEventArgs e)
  169. {
  170. System.Windows.Forms.FolderBrowserDialog folderDialog = new System.Windows.Forms.FolderBrowserDialog();
  171. if (folderDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  172. {
  173. var image = PdfViewControl.FocusPDFViewTool.GetSelectImage();
  174. if (image == null)
  175. {
  176. return;
  177. }
  178. CPDFPage page = PdfViewControl.PDFToolManager.GetDocument().PageAtIndex(image.PageIndex);
  179. string savePath = System.IO.Path.Combine(folderDialog.SelectedPath, Guid.NewGuid() + ".jpg");
  180. string tempPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), Guid.NewGuid() + ".jpg");
  181. page.GetImgSelection().GetImgBitmap(image.ImageIndex, tempPath);
  182. Bitmap bitmap = new Bitmap(tempPath);
  183. bitmap.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);
  184. Process.Start("explorer", "/select,\"" + savePath + "\"");
  185. }
  186. }
  187. private void CopyImage_Click(object sender, RoutedEventArgs e)
  188. {
  189. var image = PdfViewControl.FocusPDFViewTool.GetSelectImage();
  190. if (image == null)
  191. {
  192. return;
  193. }
  194. CPDFPage page = PdfViewControl.PDFToolManager.GetDocument().PageAtIndex(image.PageIndex);
  195. string tempPath = System.IO.Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".jpg");
  196. page.GetImgSelection().GetImgBitmap(image.ImageIndex, tempPath);
  197. Bitmap bitmap = new Bitmap(tempPath);
  198. BitmapImage imageData;
  199. using (MemoryStream ms = new MemoryStream())
  200. {
  201. bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
  202. imageData = new BitmapImage();
  203. imageData.BeginInit();
  204. imageData.StreamSource = ms;
  205. imageData.CacheOption = BitmapCacheOption.OnLoad;
  206. imageData.EndInit();
  207. imageData.Freeze();
  208. Clipboard.SetImage(imageData);
  209. bitmap.Dispose();
  210. File.Delete(tempPath);
  211. }
  212. }
  213. private void PDFToolManager_MouseMoveHandler(object sender, MouseEventObject e)
  214. {
  215. }
  216. private void PDFToolManager_MouseLeftButtonUpHandler(object sender, MouseEventObject e)
  217. {
  218. if (e.IsCreate)
  219. {
  220. OnAnnotEditHandler?.Invoke(this, EventArgs.Empty);
  221. }
  222. }
  223. private void PDFToolManager_MouseLeftButtonDownHandler(object sender, MouseEventObject e)
  224. {
  225. BaseAnnot baseAnnot = PdfViewControl.GetCacheHitTestAnnot();
  226. if (baseAnnot != null)
  227. {
  228. AnnotData annotData = baseAnnot.GetAnnotData();
  229. AnnotParam annotParam = ParamConverter.CPDFDataConverterToAnnotParam(
  230. PdfViewControl.GetCPDFViewer().GetDocument(), annotData.PageIndex, annotData.Annot);
  231. measurePropertyControl.SetPropertyForMeasureCreate(annotParam, annotData.Annot, PdfViewControl);
  232. SetMeasureInfoPanel(annotData.Annot, annotParam);
  233. currentAnnot = annotData.Annot;
  234. }
  235. panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
  236. // measurePropertyControl.SetPropertyForMeasureCreate(LineArgs, e);
  237. SetInfoPanelVisble(true, false);
  238. }
  239. private void SetMeasureInfoPanel(CPDFAnnotation annot,AnnotParam param = null)
  240. {
  241. if (annot == null)
  242. {
  243. return;
  244. }
  245. try
  246. {
  247. if (annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
  248. {
  249. CPDFLineAnnotation lineAnnot = annot as CPDFLineAnnotation;
  250. if (lineAnnot.IsMersured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
  251. {
  252. InfoPanel.SetMeasureInfo(lineAnnot);
  253. SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
  254. }
  255. }
  256. if (annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE)
  257. {
  258. CPDFPolylineAnnotation polylineAnnot = annot as CPDFPolylineAnnotation;
  259. if (polylineAnnot.IsMersured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
  260. {
  261. InfoPanel.SetMeasureInfo(polylineAnnot);
  262. SetMeasureInfoType(CPDFMeasureType.CPDF_PERIMETER_MEASURE);
  263. }
  264. }
  265. if(annot.Type== C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON)
  266. {
  267. CPDFPolygonAnnotation Annot = annot as CPDFPolygonAnnotation;
  268. CPDFAreaMeasure polygonMeasure = Annot.GetAreaMeasure();
  269. CPDFMeasureInfo measureInfo = polygonMeasure.MeasureInfo;
  270. CPDFCaptionType CaptionType = measureInfo.CaptionType;
  271. bool IsArea = false;
  272. bool IsLength = false;
  273. if ((CaptionType& CPDFCaptionType.CPDF_CAPTION_AREA)== CPDFCaptionType.CPDF_CAPTION_AREA)
  274. {
  275. IsArea = true;
  276. }
  277. if ((CaptionType & CPDFCaptionType.CPDF_CAPTION_LENGTH) == CPDFCaptionType.CPDF_CAPTION_LENGTH)
  278. {
  279. IsLength = true;
  280. }
  281. SettingPanel.ChangedCheckBoxIsChecked(IsArea, IsLength);
  282. InfoPanel.SetMeasureInfo(Annot);
  283. SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
  284. }
  285. }
  286. catch (Exception e)
  287. {
  288. }
  289. }
  290. private double GetMeasureRatio(string baseUnit)
  291. {
  292. if (baseUnit == CPDFMeasure.CPDF_PT)
  293. {
  294. return 1 / 72;
  295. }
  296. if (baseUnit == CPDFMeasure.CPDF_IN)
  297. {
  298. return 1;
  299. }
  300. if (baseUnit == CPDFMeasure.CPDF_MM)
  301. {
  302. return 1 / 25.4;
  303. }
  304. if (baseUnit == CPDFMeasure.CPDF_CM)
  305. {
  306. return 1 / 2.54;
  307. }
  308. if (baseUnit == CPDFMeasure.CPDF_M)
  309. {
  310. return 1 / 0.0254;
  311. }
  312. if (baseUnit == CPDFMeasure.CPDFO_KM)
  313. {
  314. return 1 / 0.0254 / 1000;
  315. }
  316. if (baseUnit == CPDFMeasure.CPDF_FT)
  317. {
  318. return 12;
  319. }
  320. if (baseUnit == CPDFMeasure.CPDF_YD)
  321. {
  322. return 36;
  323. }
  324. if (baseUnit == CPDFMeasure.CPDF_MI)
  325. {
  326. return 63360;
  327. }
  328. return 0;
  329. }
  330. public void SetSettingsControl(CPDFDisplaySettingsControl cPDFDisplaySettingsControl)
  331. {
  332. displaySettingsControl = cPDFDisplaySettingsControl;
  333. }
  334. public void ClearAllToolState()
  335. {
  336. PDFMeasureTool.ClearAllToolState();
  337. InfoPanel.ClearMeasureInfo();
  338. }
  339. public void ClearViewerControl()
  340. {
  341. PDFGrid.Child = null;
  342. BotaContainer.Child = null;
  343. PropertyContainer.Child = null;
  344. displaySettingsControl = null;
  345. }
  346. public void UnloadEvent()
  347. {
  348. PdfViewControl.MouseLeftButtonDownHandler -= PDFToolManager_MouseLeftButtonDownHandler;
  349. PdfViewControl.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
  350. PdfViewControl.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
  351. panelState.PropertyChanged -= PanelState_PropertyChanged;
  352. }
  353. private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
  354. {
  355. if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
  356. {
  357. ExpandLeftPanel(panelState.IsLeftPanelExpand);
  358. }
  359. else if (e.PropertyName == nameof(PanelState.RightPanel))
  360. {
  361. if (panelState.RightPanel == PanelState.RightPanelState.PropertyPanel)
  362. {
  363. ExpandRightPropertyPanel(measurePropertyControl, Visibility.Visible);
  364. }
  365. else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
  366. {
  367. ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
  368. }
  369. else
  370. {
  371. ExpandRightPropertyPanel(null, Visibility.Collapsed);
  372. }
  373. }
  374. }
  375. #endregion
  376. #region Expand and collapse Panel
  377. public void ExpandRightPropertyPanel(Visibility visible)
  378. {
  379. ExpandRightPropertyPanel(measurePropertyControl, visible);
  380. }
  381. public void ExpandNullRightPropertyPanel(Visibility visible)
  382. {
  383. ExpandRightPropertyPanel(null, visible);
  384. }
  385. public void ExpandViewSettings(Visibility visible)
  386. {
  387. SetViewSettings(displaySettingsControl, visible);
  388. }
  389. private void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
  390. {
  391. PropertyContainer.Width = 260;
  392. PropertyContainer.Child = propertytPanel;
  393. PropertyContainer.Visibility = visible;
  394. }
  395. private void SetViewSettings(CPDFDisplaySettingsControl displaySettingsControl, Visibility visibility)
  396. {
  397. PropertyContainer.Child = displaySettingsControl;
  398. PropertyContainer.Visibility = visibility;
  399. }
  400. public void ExpandLeftPanel(bool isExpand)
  401. {
  402. BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  403. Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  404. if (isExpand)
  405. {
  406. BodyGrid.ColumnDefinitions[0].Width = new GridLength(320);
  407. BodyGrid.ColumnDefinitions[1].Width = new GridLength(15);
  408. }
  409. else
  410. {
  411. BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
  412. BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
  413. }
  414. }
  415. #endregion
  416. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  417. {
  418. }
  419. private void MeasureInfoPanel_SettingClick(object sender, EventArgs e)
  420. {
  421. if (sender is MeasureInfoPanel)
  422. {
  423. switch ((sender as MeasureInfoPanel).MeasureType)
  424. {
  425. case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
  426. case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
  427. SettingPanel.ShowAreaAndLength(Visibility.Collapsed);
  428. break;
  429. case CPDFMeasureType.CPDF_AREA_MEASURE:
  430. SettingPanel.ShowAreaAndLength(Visibility.Visible);
  431. break;
  432. default:
  433. break;
  434. }
  435. }
  436. SettingPanel.ReturnToInfoPanel = true;
  437. SetInfoPanelVisble(false, true);
  438. if(currentAnnot != null)
  439. {
  440. AnnotParam annotParam = ParamConverter.CPDFDataConverterToAnnotParam(
  441. PdfViewControl.GetCPDFViewer().GetDocument(), currentAnnot.Page.PageIndex, currentAnnot);
  442. SettingPanel.BindMeasureSetting(GetMeasureInfoFromParam(annotParam));
  443. }
  444. }
  445. private CPDFMeasureInfo GetMeasureInfoFromParam(AnnotParam param)
  446. {
  447. if(param is LineMeasureParam lineParam)
  448. {
  449. return lineParam.measureInfo;
  450. }
  451. if (param is PolyLineMeasureParam polyLineParam)
  452. {
  453. return polyLineParam.measureInfo;
  454. }
  455. if (param is PolygonMeasureParam polygonParam)
  456. {
  457. return polygonParam.measureInfo;
  458. }
  459. return null;
  460. }
  461. private void SettingPanel_CancelEvent(object sender, EventArgs e)
  462. {
  463. SetInfoPanelVisble(SettingPanel.ReturnToInfoPanel, false);
  464. }
  465. private void SettingPanel_DoneEvent(object sender, EventArgs e)
  466. {
  467. SetInfoPanelVisble(SettingPanel.ReturnToInfoPanel, false);
  468. SettingPanel.SaveMeasureSetting(currentAnnot);
  469. InfoPanel.SetMeasureInfo(currentAnnot);
  470. }
  471. public void SetInfoPanelVisble(bool measureInfo, bool measureSetting)
  472. {
  473. InfoPanel.Visibility = measureInfo ? Visibility.Visible : Visibility.Collapsed;
  474. SettingPanel.Visibility = measureSetting ? Visibility.Visible : Visibility.Collapsed;
  475. }
  476. public void SetMeasureInfoType(CPDFMeasureType measureType)
  477. {
  478. InfoPanel?.SetMeasureType(measureType);
  479. }
  480. public void SetBOTAContainer(CPDFBOTABarControl botaControl)
  481. {
  482. this.BotaContainer.Child = botaControl;
  483. }
  484. public void SetMeasureScale(CPDFMeasureType measureType, string scale)
  485. {
  486. InfoPanel?.SetMeasureScale(measureType,scale);
  487. }
  488. }
  489. }