C#,所以要構建這個項目:
1,新建壹個類庫項目;
2.從菜單"項目"→;“添加引用”,添加壹個對WPS COM類庫、KSO庫和Addin庫的引用是必須的,WPS ET WPP可以根據需要添加。
3.添加對命名空間的引用
使用ET;
使用KSO;
使用AddInDesignerObjects
4.繼承接口命名空間ClassLibrary1。
{
公共類Class1 : IDTExtensibility2
5.實現接口。右鍵單擊IDTExtensibility2,並從菜單項中選擇“實現接口”。VS會自動添加接口的功能。
使用系統;
使用系統。集合。泛型;
使用系統。Linq
使用系統。文本;
使用ET;
使用KSO;
使用AddInDesignerObjects
命名空間類庫1
{
公共類Class1 : IDTExtensibility2
{
公共void OnAddInsUpdate(引用數組自定義)
{
拋出新的NotImplementedException();
}
公共void OnBeginShutdown(引用數組自定義)
{
拋出新的NotImplementedException();
}
public void OnConnection(對象應用程序,ext_ConnectMode連接模式,對象添加,引用數組自定義)
{
拋出新的NotImplementedException();
}
public void on disconnection(ext _ disconnect mode remove mode,ref Array custom)
{
拋出新的NotImplementedException();
}
public void OnStartupComplete(引用數組自定義)
{
拋出新的NotImplementedException();
}
}
}
6.註冊COM,對程序集簽名,並添加註冊表項,該註冊表項與VB.net相同。