Browse Source

new SharedAddin template for VBNet

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1489 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mathias Simmack 19 years ago
parent
commit
ae4e5fe372
  1. 2
      data/templates/file/CSharp/CSharp.WPFPage.xft
  2. 4
      data/templates/project/CSharp/SharedAddin.xpt
  3. 145
      data/templates/project/VBNet/SharedAddin.xpt

2
data/templates/file/CSharp/CSharp.WPFPage.xft

@ -46,7 +46,7 @@ using System.Windows.Shapes; @@ -46,7 +46,7 @@ using System.Windows.Shapes;
namespace ${StandardNamespace}
{
/// <summary>
/// Interaction logic for ${FullName}
/// Interaction logic for ${FileName}
/// </summary>
public partial class ${FileNameWithoutExtension} : Page

4
data/templates/project/CSharp/SharedAddin.xpt

@ -148,9 +148,7 @@ using System.Runtime.CompilerServices; @@ -148,9 +148,7 @@ using System.Runtime.CompilerServices;
// 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>
[assembly: AssemblyVersion("1.0.*")]]]></File>
</Files>
</Project>
</Combine>

145
data/templates/project/VBNet/SharedAddin.xpt

@ -0,0 +1,145 @@ @@ -0,0 +1,145 @@
<?xml version="1.0"?>
<Template originator = "Mathias Simmack" created = "17/06/06" lastModified = "17/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>VBNet</Category>
<Icon>VBNet.Project.Library</Icon>
<LanguageName>VBNet</LanguageName>
<Description>${res:Templates.Project.SharedAddin.Description}</Description>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Connect.vb"/>
</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.vb"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Runtime.InteropServices
Imports Extensibility
<GuidAttribute("PLACE-A-VALID-GUID-HERE"), ProgId("Test3.Connect")> _
Public Class Connect
Implements Extensibility.IDTExtensibility2
#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.
#End Region
Public Sub New()
End Sub
Public Sub OnConnection(ByVal Application As Object, ByVal ConnectMode As ext_ConnectMode, ByVal AddInInst As Object, ByRef [custom] As Array) Implements IDTExtensibility2.OnConnection
Me.ApplicationObject = Application
Me.AddInInstance = AddInInst
End Sub
Public Sub OnDisconnection(ByVal RemoveMode As ext_DisconnectMode, ByRef [custom] As Array) Implements IDTExtensibility2.OnDisconnection
End Sub
Public Sub OnAddInsUpdate(ByRef [custom] As Array) Implements IDTExtensibility2.OnAddInsUpdate
End Sub
Public Sub OnStartupComplete(ByRef [custom] As Array) Implements IDTExtensibility2.OnStartupComplete
End Sub
Public Sub OnBeginShutdown(ByRef [custom] As Array) Implements IDTExtensibility2.OnBeginShutdown
End Sub
Private ApplicationObject As Object
Private AddInInstance As Object
End Class]]></File>
<File name="AssemblyInfo.cs">
<![CDATA[Imports System.Reflection
Imports 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…
Cancel
Save