Skip to content

Commit dcd7eb0

Browse files
committed
Created an empty project creation wizard.
1 parent 28c785a commit dcd7eb0

File tree

9 files changed

+313
-26
lines changed

9 files changed

+313
-26
lines changed

ExcelDNAVSExtension/CSProjectTemplate/CSProjectTemplate.vstemplate

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
2424
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
2525
</WizardExtension>
26+
<WizardExtension>
27+
<Assembly>ExcelDNAVSExtension, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=f5d8bc8a5caf976a</Assembly>
28+
<FullClassName>ExcelDNAVSExtension.TemplateWizard</FullClassName>
29+
</WizardExtension>
2630
<WizardData>
2731
<packages repository="extension" repositoryId="f1b3b55f-9bdc-4e9a-802c-84b329e36587">
2832
<package id="ExcelDna.Integration" version="1.1.0" />

ExcelDNAVSExtension/ExcelDNAVSExtension/ExcelDNAVSExtension.csproj

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
<PropertyGroup>
44
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
55
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
<UseCodebase>true</UseCodebase>
7+
</PropertyGroup>
8+
<PropertyGroup>
9+
<SignAssembly>true</SignAssembly>
10+
</PropertyGroup>
11+
<PropertyGroup>
12+
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
613
</PropertyGroup>
714
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
815
<PropertyGroup>
@@ -16,11 +23,11 @@
1623
<RootNamespace>ExcelDNAVSExtension</RootNamespace>
1724
<AssemblyName>ExcelDNAVSExtension</AssemblyName>
1825
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
19-
<GeneratePkgDefFile>false</GeneratePkgDefFile>
20-
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
21-
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
22-
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
23-
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
26+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
27+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
28+
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
29+
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
30+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
2431
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
2532
<StartAction>Program</StartAction>
2633
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
@@ -45,6 +52,8 @@
4552
</PropertyGroup>
4653
<ItemGroup>
4754
<Compile Include="Properties\AssemblyInfo.cs" />
55+
<Compile Include="TemplateWizard.cs" />
56+
<Compile Include="VSPackage.cs" />
4857
</ItemGroup>
4958
<ItemGroup>
5059
<Content Include="Packages\exceldna.addin.1.1.1.nupkg">
@@ -55,6 +64,8 @@
5564
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5665
<IncludeInVSIX>true</IncludeInVSIX>
5766
</Content>
67+
<Content Include="Resources\VSPackage.ico" />
68+
<None Include="Key.snk" />
5869
<None Include="source.extension.vsixmanifest">
5970
<SubType>Designer</SubType>
6071
</None>
@@ -79,6 +90,23 @@
7990
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
8091
</ProjectReference>
8192
</ItemGroup>
93+
<ItemGroup>
94+
<EmbeddedResource Include="VSPackage.resx">
95+
<DependentUpon>VSPackage.cs</DependentUpon>
96+
<MergeWithCTO>true</MergeWithCTO>
97+
<ManifestResourceName>VSPackage</ManifestResourceName>
98+
</EmbeddedResource>
99+
</ItemGroup>
100+
<ItemGroup>
101+
<Reference Include="Microsoft.CSharp" />
102+
<Reference Include="Microsoft.VisualStudio.TemplateWizardInterface, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
103+
<Reference Include="System" />
104+
<Reference Include="System.Data" />
105+
<Reference Include="System.Design" />
106+
<Reference Include="System.Drawing" />
107+
<Reference Include="System.Windows.Forms" />
108+
<Reference Include="System.Xml" />
109+
</ItemGroup>
82110
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
83111
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
84112
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
596 Bytes
Binary file not shown.
418 KB
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.Collections.Generic;
2+
using Microsoft.VisualStudio.TemplateWizard;
3+
using EnvDTE;
4+
5+
namespace ExcelDNAVSExtension
6+
{
7+
public class TemplateWizard : IWizard
8+
{
9+
public void BeforeOpeningFile(ProjectItem projectItem)
10+
{
11+
}
12+
13+
public void ProjectFinishedGenerating(Project project)
14+
{
15+
}
16+
17+
public void ProjectItemFinishedGenerating(ProjectItem projectItem)
18+
{
19+
}
20+
21+
public void RunFinished()
22+
{
23+
}
24+
25+
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
26+
{
27+
}
28+
29+
public bool ShouldAddProjectItem(string filePath)
30+
{
31+
return true;
32+
}
33+
}
34+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
using System;
2+
using System.ComponentModel.Design;
3+
using System.Diagnostics;
4+
using System.Diagnostics.CodeAnalysis;
5+
using System.Globalization;
6+
using System.Runtime.InteropServices;
7+
using System.Threading;
8+
using System.Threading.Tasks;
9+
using Microsoft.VisualStudio;
10+
using Microsoft.VisualStudio.OLE.Interop;
11+
using Microsoft.VisualStudio.Shell;
12+
using Microsoft.VisualStudio.Shell.Interop;
13+
using Microsoft.Win32;
14+
using Task = System.Threading.Tasks.Task;
15+
16+
namespace ExcelDNAVSExtension
17+
{
18+
/// <summary>
19+
/// This is the class that implements the package exposed by this assembly.
20+
/// </summary>
21+
/// <remarks>
22+
/// <para>
23+
/// The minimum requirement for a class to be considered a valid package for Visual Studio
24+
/// is to implement the IVsPackage interface and register itself with the shell.
25+
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
26+
/// to do it: it derives from the Package class that provides the implementation of the
27+
/// IVsPackage interface and uses the registration attributes defined in the framework to
28+
/// register itself and its components with the shell. These attributes tell the pkgdef creation
29+
/// utility what data to put into .pkgdef file.
30+
/// </para>
31+
/// <para>
32+
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
33+
/// </para>
34+
/// </remarks>
35+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
36+
[Guid(VSPackage.PackageGuidString)]
37+
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
38+
public sealed class VSPackage : AsyncPackage
39+
{
40+
/// <summary>
41+
/// VSPackage GUID string.
42+
/// </summary>
43+
public const string PackageGuidString = "8123a50c-24f3-4eb6-8e12-6e852e023779";
44+
45+
/// <summary>
46+
/// Initializes a new instance of the <see cref="VSPackage"/> class.
47+
/// </summary>
48+
public VSPackage()
49+
{
50+
// Inside this method you can place any initialization code that does not require
51+
// any Visual Studio service because at this point the package object is created but
52+
// not sited yet inside Visual Studio environment. The place to do all the other
53+
// initialization is the Initialize method.
54+
}
55+
56+
#region Package Members
57+
58+
/// <summary>
59+
/// Initialization of the package; this method is called right after the package is sited, so this is the place
60+
/// where you can put all the initialization code that rely on services provided by VisualStudio.
61+
/// </summary>
62+
/// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
63+
/// <param name="progress">A provider for progress updates.</param>
64+
/// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
65+
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
66+
{
67+
// When initialized asynchronously, the current thread may be a background thread at this point.
68+
// Do any initialization that requires the UI thread after switching to the UI thread.
69+
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
70+
}
71+
72+
#endregion
73+
}
74+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
VS SDK Notes: This resx file contains the resources that will be consumed from your package by Visual Studio.
4+
For example, Visual Studio will attempt to load resource '400' from this resource stream when it needs to
5+
load your package's icon. Because Visual Studio will always look in the VSPackage.resources stream first for
6+
resources it needs, you should put additional resources that Visual Studio will load directly into this resx
7+
file.
8+
9+
Resources that you would like to access directly from your package in a strong-typed fashion should be stored
10+
in Resources.resx or another resx file.
11+
-->
12+
<root>
13+
<!--
14+
Microsoft ResX Schema
15+
16+
Version 2.0
17+
18+
The primary goals of this format is to allow a simple XML format
19+
that is mostly human readable. The generation and parsing of the
20+
various data types are done through the TypeConverter classes
21+
associated with the data types.
22+
23+
Example:
24+
25+
... ado.net/XML headers & schema ...
26+
<resheader name="resmimetype">text/microsoft-resx</resheader>
27+
<resheader name="version">2.0</resheader>
28+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
29+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
30+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
31+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
32+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
33+
<value>[base64 mime encoded serialized .NET Framework object]</value>
34+
</data>
35+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
36+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
37+
<comment>This is a comment</comment>
38+
</data>
39+
40+
There are any number of "resheader" rows that contain simple
41+
name/value pairs.
42+
43+
Each data row contains a name, and value. The row also contains a
44+
type or mimetype. Type corresponds to a .NET class that support
45+
text/value conversion through the TypeConverter architecture.
46+
Classes that don't support this are serialized and stored with the
47+
mimetype set.
48+
49+
The mimetype is used for serialized objects, and tells the
50+
ResXResourceReader how to depersist the object. This is currently not
51+
extensible. For a given mimetype the value must be set accordingly:
52+
53+
Note - application/x-microsoft.net.object.binary.base64 is the format
54+
that the ResXResourceWriter will generate, however the reader can
55+
read any of the formats listed below.
56+
57+
mimetype: application/x-microsoft.net.object.binary.base64
58+
value : The object must be serialized with
59+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
60+
: and then encoded with base64 encoding.
61+
62+
mimetype: application/x-microsoft.net.object.soap.base64
63+
value : The object must be serialized with
64+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
65+
: and then encoded with base64 encoding.
66+
67+
mimetype: application/x-microsoft.net.object.bytearray.base64
68+
value : The object must be serialized into a byte array
69+
: using a System.ComponentModel.TypeConverter
70+
: and then encoded with base64 encoding.
71+
-->
72+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
73+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
74+
<xsd:element name="root" msdata:IsDataSet="true">
75+
<xsd:complexType>
76+
<xsd:choice maxOccurs="unbounded">
77+
<xsd:element name="metadata">
78+
<xsd:complexType>
79+
<xsd:sequence>
80+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
81+
</xsd:sequence>
82+
<xsd:attribute name="name" use="required" type="xsd:string" />
83+
<xsd:attribute name="type" type="xsd:string" />
84+
<xsd:attribute name="mimetype" type="xsd:string" />
85+
<xsd:attribute ref="xml:space" />
86+
</xsd:complexType>
87+
</xsd:element>
88+
<xsd:element name="assembly">
89+
<xsd:complexType>
90+
<xsd:attribute name="alias" type="xsd:string" />
91+
<xsd:attribute name="name" type="xsd:string" />
92+
</xsd:complexType>
93+
</xsd:element>
94+
<xsd:element name="data">
95+
<xsd:complexType>
96+
<xsd:sequence>
97+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
98+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
99+
</xsd:sequence>
100+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
101+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
102+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
103+
<xsd:attribute ref="xml:space" />
104+
</xsd:complexType>
105+
</xsd:element>
106+
<xsd:element name="resheader">
107+
<xsd:complexType>
108+
<xsd:sequence>
109+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
110+
</xsd:sequence>
111+
<xsd:attribute name="name" type="xsd:string" use="required" />
112+
</xsd:complexType>
113+
</xsd:element>
114+
</xsd:choice>
115+
</xsd:complexType>
116+
</xsd:element>
117+
</xsd:schema>
118+
<resheader name="resmimetype">
119+
<value>text/microsoft-resx</value>
120+
</resheader>
121+
<resheader name="version">
122+
<value>2.0</value>
123+
</resheader>
124+
<resheader name="reader">
125+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
126+
</resheader>
127+
<resheader name="writer">
128+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
129+
</resheader>
130+
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
131+
<data name="110" xml:space="preserve">
132+
<value>VSPackage Extension</value>
133+
</data>
134+
<data name="112" xml:space="preserve">
135+
<value>VSPackage Visual Studio Extension Detailed Info</value>
136+
</data>
137+
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
138+
<value>Resources\VSPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
139+
</data>
140+
</root>
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3-
<Metadata>
4-
<Identity Id="f1b3b55f-9bdc-4e9a-802c-84b329e36587" Version="1.0" Language="en-US" Publisher="Govert van Drimmelen" />
5-
<DisplayName>Excel-DNA Developer Tools</DisplayName>
6-
<Description xml:space="preserve">The Visual Studio extension for Excel-DNA.</Description>
7-
</Metadata>
8-
<Installation>
9-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
10-
</Installation>
11-
<Dependencies>
12-
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
13-
</Dependencies>
14-
<Assets>
15-
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="CSProjectTemplate" d:TargetPath="|CSProjectTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />
16-
<Asset Type="nupkg" d:Source="File" Path="Packages\exceldna.addin.1.1.1.nupkg" d:VsixSubPath="Packages" />
17-
<Asset Type="nupkg" d:Source="File" Path="Packages\exceldna.integration.1.1.0.nupkg" d:VsixSubPath="Packages" />
18-
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="VBProjectTemplate" d:TargetPath="|VBProjectTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />
19-
</Assets>
20-
<Prerequisites>
21-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,17.0)" DisplayName="Visual Studio core editor" />
22-
</Prerequisites>
3+
<Metadata>
4+
<Identity Id="f1b3b55f-9bdc-4e9a-802c-84b329e36587" Version="1.0" Language="en-US" Publisher="Govert van Drimmelen" />
5+
<DisplayName>Excel-DNA Developer Tools</DisplayName>
6+
<Description xml:space="preserve">The Visual Studio extension for Excel-DNA.</Description>
7+
</Metadata>
8+
<Installation>
9+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
10+
</Installation>
11+
<Dependencies>
12+
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
13+
<Dependency Id="Microsoft.VisualStudio.MPF.16.0" DisplayName="Visual Studio MPF 16.0" d:Source="Installed" Version="[16.0,17.0)" />
14+
</Dependencies>
15+
<Assets>
16+
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="CSProjectTemplate" d:TargetPath="|CSProjectTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />
17+
<Asset Type="nupkg" d:Source="File" Path="Packages\exceldna.addin.1.1.1.nupkg" d:VsixSubPath="Packages" />
18+
<Asset Type="nupkg" d:Source="File" Path="Packages\exceldna.integration.1.1.0.nupkg" d:VsixSubPath="Packages" />
19+
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="Project" d:ProjectName="VBProjectTemplate" d:TargetPath="|VBProjectTemplate;TemplateProjectOutputGroup|" Path="ProjectTemplates" d:VsixSubPath="ProjectTemplates" />
20+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
21+
<Asset Type="Microsoft.VisualStudio.Assembly" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" AssemblyName="|%CurrentProject%;AssemblyName|" />
22+
</Assets>
23+
<Prerequisites>
24+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[16.0,17.0)" DisplayName="Visual Studio core editor" />
25+
</Prerequisites>
2326
</PackageManifest>

ExcelDNAVSExtension/VBProjectTemplate/VBProjectTemplate.vstemplate

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
<Assembly>NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
3030
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
3131
</WizardExtension>
32+
<WizardExtension>
33+
<Assembly>ExcelDNAVSExtension, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=f5d8bc8a5caf976a</Assembly>
34+
<FullClassName>ExcelDNAVSExtension.TemplateWizard</FullClassName>
35+
</WizardExtension>
3236
<WizardData>
3337
<packages repository="extension" repositoryId="f1b3b55f-9bdc-4e9a-802c-84b329e36587">
3438
<package id="ExcelDna.Integration" version="1.1.0" />

0 commit comments

Comments
 (0)