CPDFTitleBarControl.xaml.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. namespace Compdfkit_Tools.PDFControl
  5. {
  6. public partial class CPDFTitleBarControl : UserControl
  7. {
  8. public static readonly DependencyProperty CanSaveProperty =
  9. DependencyProperty.RegisterAttached("CanSave", typeof(bool), typeof(CPDFTitleBarControl), new PropertyMetadata(false));
  10. public bool CanSave
  11. {
  12. get { return (bool)GetValue(CanSaveProperty); }
  13. set { SetValue(CanSaveProperty, value); }
  14. }
  15. public event EventHandler OpenFileEvent;
  16. public event EventHandler SaveFileEvent;
  17. public event EventHandler SaveAsFileEvent;
  18. public event EventHandler FlattenEvent;
  19. public CPDFTitleBarControl()
  20. {
  21. InitializeComponent();
  22. }
  23. private void OpenFileItem_Click(object sender, RoutedEventArgs e)
  24. {
  25. OpenFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  26. }
  27. private void SaveFileItem_Click(object sender, RoutedEventArgs e)
  28. {
  29. SaveFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  30. }
  31. private void SaveAsItem_Click(object sender, RoutedEventArgs e)
  32. {
  33. SaveAsFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  34. }
  35. private void AboutUsItem_Click(object sender, RoutedEventArgs e)
  36. {
  37. System.Diagnostics.Process.Start("https://www.compdf.com/company/about");
  38. }
  39. private void ContactUs_Click(object sender, RoutedEventArgs e)
  40. {
  41. System.Diagnostics.Process.Start("https://www.compdf.com/contact-sales");
  42. }
  43. private void TechnicalSupport_Click(object sender, RoutedEventArgs e)
  44. {
  45. System.Diagnostics.Process.Start("https://www.compdf.com/support");
  46. }
  47. private void PrivacyAgreement_Click(object sender, RoutedEventArgs e)
  48. {
  49. System.Diagnostics.Process.Start("https://www.compdf.com/privacy-policy");
  50. }
  51. private void ServiceTerms_Click(object sender, RoutedEventArgs e)
  52. {
  53. System.Diagnostics.Process.Start("https://www.compdf.com/terms-of-service");
  54. }
  55. private void DeviceSerial_Click(object sender, RoutedEventArgs e)
  56. {
  57. var parentWindow = Window.GetWindow(this);
  58. DeviceSerialControl deviceSerialControl = new DeviceSerialControl()
  59. {
  60. Owner = parentWindow
  61. };
  62. deviceSerialControl.ShowDialog();
  63. }
  64. private void FlattenItem_Click(object sender, RoutedEventArgs e)
  65. {
  66. FlattenEvent?.Invoke(sender, RoutedEventArgs.Empty);
  67. }
  68. }
  69. }