Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1467 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
1 changed files with 157 additions and 0 deletions
@ -0,0 +1,157 @@
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Mathias Simmack" created = "01/06/06" lastModified = "09/06/06"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<!-- |
||||
|
||||
Template.Project.SharedAddin.Name = Shared Add-in |
||||
Template.Project.SharedAddin.Description = Creates a shared add-in for COM applications |
||||
--> |
||||
|
||||
<Name>${res:Templates.Project.SharedAddin.Name}</Name> |
||||
<Category>C#</Category> |
||||
<Icon>C#.Project.Library</Icon> |
||||
<LanguageName>C#</LanguageName> |
||||
<Description>${res:Templates.Project.SharedAddin.Description}</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "Connect.cs"/> |
||||
</Actions> |
||||
|
||||
<!-- Template Content --> |
||||
<Combine name = "${ProjectName}" directory = "."> |
||||
<Options> |
||||
<StartupProject>${ProjectName}</StartupProject> |
||||
</Options> |
||||
|
||||
<Project name = "${ProjectName}" directory = "."> |
||||
<Options OutputType = "Library" /> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="Extensibility" /> |
||||
</ProjectItems> |
||||
|
||||
<PropertyGroup> |
||||
<RegisterForComInterop>true</RegisterForComInterop> |
||||
</PropertyGroup> |
||||
|
||||
<Files> |
||||
<File name="Connect.cs"><![CDATA[${StandardHeader.C#} |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
using Extensibility; |
||||
|
||||
|
||||
#region Creating an Add-in for Office ... |
||||
|
||||
// First of all, make sure the "Register for COM Interop" flag in your project |
||||
// options is enabled. Create and add a reference to the Office core |
||||
// tlbimp %CommonProgramFiles%\Microsoft Shared\Office12\mso.dll |
||||
// /out:Microsoft.Office.Interop.dll |
||||
// |
||||
// Then add some code, compile the assembly and register it with |
||||
// regasm ${StandardNamespace}.dll |
||||
// |
||||
// |
||||
// Now create a new Registry key for the Office application, you want to |
||||
// connect to |
||||
// HKLM\Software\Microsoft\Visio\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\Word\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\Excel\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\Outlook\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\Publisher\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\Access\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\PowerPoint\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\FrontPage\Addins\${StandardNamespace}.Connect |
||||
// HKLM\Software\Microsoft\Office\MS Project\Addins\${StandardNamespace}.Connect |
||||
// |
||||
// Now create this 3 values |
||||
// LoadBehavior (DWORD) = 3 |
||||
// Description (String) = a descriptive string for your add-in |
||||
// FriendlyName (String) = a name |
||||
// |
||||
// If you don't want to use your add-in anymore, remove those Registry entries and |
||||
// unregister the assembly with |
||||
// regasm ${StandardNamespace}.dll /u |
||||
// |
||||
// |
||||
// The best way, doing these registration steps, is a Setup project. |
||||
|
||||
#endregion |
||||
|
||||
|
||||
[GuidAttribute("PLACE-A-VALID-GUID-HERE"), ProgId("${StandardNamespace}.Connect")] |
||||
public class Connect : Object, Extensibility.IDTExtensibility2 |
||||
{ |
||||
public Connect() |
||||
{ |
||||
} |
||||
|
||||
public void OnConnection(object application, ext_ConnectMode ConnectMode, object AddInInst, ref System.Array custom) |
||||
{ |
||||
applicationObject = application; |
||||
addinInstance = AddInInst; |
||||
} |
||||
|
||||
public void OnDisconnection(ext_DisconnectMode RemoveMode, ref System.Array custom) |
||||
{ |
||||
} |
||||
|
||||
public void OnAddInsUpdate(ref System.Array custom) |
||||
{ |
||||
} |
||||
|
||||
public void OnStartupComplete(ref System.Array custom) |
||||
{ |
||||
} |
||||
|
||||
public void OnBeginShutdown(ref System.Array custom) |
||||
{ |
||||
} |
||||
|
||||
private object applicationObject; |
||||
private object addinInstance; |
||||
} |
||||
}]]></File> |
||||
<File name="AssemblyInfo.cs"> |
||||
<![CDATA[using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following |
||||
// attributes. |
||||
// |
||||
// change them to the information which is associated with the assembly |
||||
// you compile. |
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format : |
||||
// |
||||
// Major.Minor.Build.Revision |
||||
// |
||||
// You can specify all values by your own or you can build default build and revision |
||||
// numbers with the '*' character (the default): |
||||
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
|
||||
]]></File> |
||||
</Files> |
||||
</Project> |
||||
</Combine> |
||||
</Template> |
Loading…
Reference in new issue