UpdateAttributeHelper.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PDF_Office.Helper
  9. {
  10. /// <summary>
  11. /// 更新属性
  12. /// </summary>
  13. public class UpdateAttributeHelper
  14. {
  15. private AnnotAttribEvent annotAttribEvent;
  16. private AnnotEditEvent annotEditEvent;
  17. public UpdateAttributeHelper(AnnotAttribEvent Event)
  18. {
  19. annotAttribEvent = Event;
  20. }
  21. public UpdateAttributeHelper(AnnotEditEvent Event)
  22. {
  23. annotEditEvent = Event;
  24. }
  25. public bool IsCreateForm()
  26. {
  27. if (annotEditEvent != null)
  28. {
  29. if(annotEditEvent.EditAction == ActionType.Add)
  30. return true;
  31. }
  32. return false;
  33. }
  34. public void UpdateAttrib(AnnotAttrib attrib, object updateData)
  35. {
  36. if (annotAttribEvent != null)
  37. {
  38. annotAttribEvent.UpdateAttrib(attrib, updateData);
  39. }
  40. if (annotEditEvent != null)
  41. {
  42. }
  43. }
  44. public void UpdateAnnot()
  45. {
  46. if (annotAttribEvent != null)
  47. {
  48. annotAttribEvent.UpdateAnnot();
  49. }
  50. if (annotEditEvent != null && annotEditEvent.EditAnnotArgs != null)
  51. {
  52. annotEditEvent.EditAnnotArgs.UpdateAnnotByEventArgs();
  53. }
  54. }
  55. }
  56. }