-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
22 lines (19 loc) · 811 Bytes
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using DevExpress.XtraPdfViewer;
using System;
using System.Windows.Forms;
namespace ViewerCustomCommand {
public partial class Form1 : Form {
void ReplacePdfViewerCommandFactoryService(PdfViewer control) {
IPdfViewerCommandFactoryService service = control.GetService<IPdfViewerCommandFactoryService>();
if (service == null)
return;
control.RemoveService(typeof(IPdfViewerCommandFactoryService));
control.AddService(typeof(IPdfViewerCommandFactoryService), new CustomPdfViewerCommandFactoryService(control,service));
}
public Form1() {
InitializeComponent();
pdfViewer1.LoadDocument("..\\..\\Demo.pdf");
ReplacePdfViewerCommandFactoryService(pdfViewer1);
}
}
}