-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlugin.cs
More file actions
74 lines (63 loc) · 2.55 KB
/
Plugin.cs
File metadata and controls
74 lines (63 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing.Printing;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
using OpenDentBusiness;
using OpenDental;
namespace PluginExample {//The namespace for this class must match the dll filename, including capitalization. All other classes will typically belong to the same namespace too, but that's not a requirement.
/// <summary>Required class. Don't change the name.</summary>
public class Plugin: PluginBase{
private Form host;
///<summary></summary>
public override Form Host {
get {
return host;
}
set {
host=value;
ConvertPluginDatabase.Begin();//if this crashes, it will bubble up and result in the plugin not loading.
//If the plugin is only for personal use, then data tables do not need to be managed in the code.
//They could instead be managed manually using a tool.
}
}
public override bool HookMethod(object sender,string hookName,params object[] parameters) {//required method
switch(hookName){
case "ContrFamily.gridPat_CellDoubleClick":
ContrFamilyP.gridPat_CellDoubleClick((OpenDental.ContrFamily)sender,(Patient)parameters[0]);
return true;
case "ContrChart.FillPtInfo":
ContrChartP.FillPtInfo((OpenDental.ContrChart)sender,(Patient)parameters[0]);
return true;
case "FormRpStatement.CreateDocument":
FormRpStatementP.CreateDocument((OpenDental.FormRpStatement)sender,(MigraDoc.DocumentObjectModel.Document)parameters[0],
(PrintDocument)parameters[1],(Family)parameters[2],(Patient)parameters[3],(DataSet)parameters[4],(Statement)parameters[5]);
return true;
default:
return false;//this plugin does not implement the particular hook passed in.
}
}
public override bool HookAddCode(object sender,string hookName,params object[] parameters) {//required method
switch(hookName){
case "ContrAccount.InitializeOnStartup_end":
ContrAccountP.InitializeOnStartup_end((OpenDental.ContrAccount)sender);
return true;
case "ContrAccount.RefreshModuleData_end":
ContrAccountP.RefreshModuleData_end((OpenDental.ContrAccount)sender,(Family)parameters[0],(Patient)parameters[1]);
return true;
case "ContrAccount.RefreshModuleData_null":
ContrAccountP.RefreshModuleData_end((OpenDental.ContrAccount)sender,null,null);
return true;
default:
return false;
}
}
public override void LaunchToolbarButton(long patNum) {
FormFromToolbar form=new FormFromToolbar();
form.PatNum=patNum;
form.ShowDialog();
}
}
}