; \"Add reference\", i" />
C#, so to build this project:
1, create a new class library project;
2. From the menu "project"->; "Add reference", it is necessary to add a reference to WPS COM class library, KSO library and Addin library, and WPS ET WPP can be added as needed.
3. Add a reference to the namespace
Use et;
Use KSO;;
Using AddInDesignerObjects
4. Inherit the interface namespace ClassLibrary 1.
{
Public class1:IDT extensibility 2
5. Implement the interface. Right-click IDTExtensibility2 and select "Implement Interface" from the menu item. VS will automatically add the function of the interface.
Use the system;
Use the system. Assemble. Generics;
Use the system. Linq
Use the system. Text;
Use et;
Use KSO;;
Using AddInDesignerObjects
Namespace class library 1
{
Public class1:IDT extensibility 2
{
Public void OnAddInsUpdate (reference array customization)
{
Throw a new notimplementedException ();
}
Public void OnBeginShutdown (reference array customization)
{
Throw a new notimplementedException ();
}
Public void OnConnection (object application, ext_ConnectMode connection mode, object addition, reference array customization)
{
Throw a new notimplementedException ();
}
public void on disconnection(ext _ disconnect mode remove mode,ref Array custom)
{
Throw a new notimplementedException ();
}
Public void OnStartupComplete (reference array customization)
{
Throw a new notimplementedException ();
}
}
}
6. Register COM, sign the assembly, and add a registry key, which is the same as VB.net.