1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using ComPDFKit.Controls.Data;
- using ComPDFKit.Controls.PDFControl;
- using ComPDFKit.PDFAnnotation;
- using ComPDFKit.PDFDocument;
- using ComPDFKit.Tool;
- using ComPDFKit.Tool.UndoManger;
- using System;
- using System.Windows.Controls;
- using System.Windows.Media;
- namespace ComPDFKit.Controls.PDFControlUI
- {
- /// <summary>
- /// Interaction logic for CPDFCloudUI.xaml
- /// </summary>
- public partial class CPDFCloudUI : UserControl
- {
- bool IsLoadedData = false;
- private AnnotParam annotParam;
- private CPDFAnnotation annotCore;
- private PDFViewControl viewControl;
- public event EventHandler<CPDFAnnotationData> PropertyChanged;
- private AnnotHistory GetHistory()
- {
- if(annotCore != null && annotCore.IsValid())
- {
- return new PolygonAnnotHistory();
- }
- return new AnnotHistory();
- }
- public CPDFCloudUI()
- {
- InitializeComponent();
- ctlBorderColorPicker.ColorChanged -= CtlBorderColorPicker_ColorChanged;
- ctlFillColorPicker.ColorChanged -= CtlFillColorPicker_ColorChanged;
- CPDFOpacityControl.OpacityChanged -= CPDFOpacityControl_OpacityChanged;
- ctlBorderColorPicker.ColorChanged += CtlBorderColorPicker_ColorChanged;
- ctlFillColorPicker.ColorChanged += CtlFillColorPicker_ColorChanged;
- CPDFOpacityControl.OpacityChanged += CPDFOpacityControl_OpacityChanged;
- }
- private void CPDFOpacityControl_OpacityChanged(object sender, EventArgs e)
- {
- throw new NotImplementedException();
- }
- private void CtlFillColorPicker_ColorChanged(object sender, EventArgs e)
- {
- throw new NotImplementedException();
- }
- private void CtlBorderColorPicker_ColorChanged(object sender, EventArgs e)
- {
- throw new NotImplementedException();
- }
- public void SetPresentAnnotAttrib(PolygonMeasureParam polygonParam, CPDFPolygonAnnotation annotation, CPDFDocument document, PDFViewControl view)
- {
- annotParam = polygonParam;
- annotCore = annotation;
- viewControl = view;
- }
- public CPDFAnnotationData GetPolygonData()
- {
- CPDFPolygonData polygonData = new CPDFPolygonData
- {
- AnnotationType = CPDFAnnotationType.Polygon,
- BorderColor = ((SolidColorBrush)ctlBorderColorPicker.Brush).Color,
- FillColor = ((SolidColorBrush)ctlFillColorPicker.Brush).Color,
- IsMeasured = false,
- Thickness = CPDFThicknessControl.Thickness,
- Opacity = CPDFOpacityControl.Opacity / 100,
- Note = NoteTextBox.Text
- };
- return polygonData;
- }
- private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- IsLoadedData = true;
- }
- private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e)
- {
- IsLoadedData = false;
- }
- }
- }
|