Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamecr committed Nov 4, 2018
1 parent d04a050 commit 792fed3
Show file tree
Hide file tree
Showing 31 changed files with 2,203 additions and 0 deletions.
32 changes: 32 additions & 0 deletions RadProjectsExtension.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2048
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RadProjectsExtension", "RadProjectsExtension\RadProjectsExtension.csproj", "{C28280AC-52AE-4252-893B-06BCC2CF8D57}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D02D5553-0156-4417-A3CA-A2AA7F3D5731}"
ProjectSection(SolutionItems) = preProject
changelog.md = changelog.md
license.txt = license.txt
readme.md = readme.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C28280AC-52AE-4252-893B-06BCC2CF8D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C28280AC-52AE-4252-893B-06BCC2CF8D57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C28280AC-52AE-4252-893B-06BCC2CF8D57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C28280AC-52AE-4252-893B-06BCC2CF8D57}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {118BDD8C-CF98-4328-9CFF-698D32C56A09}
EndGlobalSection
EndGlobal
Binary file added RadProjectsExtension/Key.snk
Binary file not shown.
Binary file added RadProjectsExtension/Newtonsoft.Json.dll
Binary file not shown.
33 changes: 33 additions & 0 deletions RadProjectsExtension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RadProjectsExtension")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RadProjectsExtension")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
215 changes: 215 additions & 0 deletions RadProjectsExtension/RadProjectsExtension.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<UseCodebase>true</UseCodebase>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{C28280AC-52AE-4252-893B-06BCC2CF8D57}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>net.adamec.dev.vs.extension.radprojects</RootNamespace>
<AssemblyName>RadProjectsExtension</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RadProjectsExtensionCommands.cs" />
<Compile Include="RadProjectsExtensionOptions.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RadProjectsExtensionPackage.cs" />
<Compile Include="template\TemplateEngine.cs" />
<Compile Include="template\TemplateInfo.cs" />
<Compile Include="ui\BaseDialogWindow.cs" />
<Compile Include="ui\ChooseTemplateDialogWindow.xaml.cs">
<DependentUpon>ChooseTemplateDialogWindow.xaml</DependentUpon>
</Compile>
<Compile Include="utils\EnumeratorExtensions.cs" />
<Compile Include="utils\FileUtils.cs" />
<Compile Include="utils\SolutionInfo.cs" />
<Compile Include="utils\StringExtensions.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Key.snk" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<VSCTCompile Include="RadProjectsExtensionPackage.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
</VSCTCompile>
<Content Include="license.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Newtonsoft.Json.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Resources\RadProjectsExtensionPackage.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.CoreUtility">
<Version>15.8.525</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Imaging">
<Version>15.8.28010</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime">
<Version>14.3.26930</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.OLE.Interop">
<Version>7.10.6071</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers">
<Version>15.8.36</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes">
<Version>15.0.27</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0">
<Version>15.8.28010</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Framework">
<Version>15.8.28010</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop">
<Version>7.10.6072</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.10.0">
<Version>10.0.30320</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.11.0">
<Version>11.0.61031</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
<Version>12.0.30111</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime">
<Version>14.3.26929</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.8.0">
<Version>8.0.50728</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.9.0">
<Version>9.0.30730</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop">
<Version>7.10.6071</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.TextManager.Interop.8.0">
<Version>8.0.50728</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading">
<Version>15.8.168</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<Version>15.8.168</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Utilities">
<Version>15.8.28010</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Validation">
<Version>15.3.58</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceName>VSPackage</ManifestResourceName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Page Include="ui\ChooseTemplateDialogWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ui\StyleResourceDictionary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
82 changes: 82 additions & 0 deletions RadProjectsExtension/RadProjectsExtensionCommands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using System;
using System.ComponentModel.Design;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using net.adamec.dev.vs.extension.radprojects.template;
using net.adamec.dev.vs.extension.radprojects.utils;
using Task = System.Threading.Tasks.Task;

namespace net.adamec.dev.vs.extension.radprojects
{
/// <summary>
/// Commands handler class
/// </summary>
internal sealed class RadProjectsExtensionCommands
{
public static RadProjectsExtensionCommands Instance { get; private set; }

//IDs
public static readonly Guid CommandSet = new Guid("3994f851-c0ed-4950-8bc5-46fd1a52c1eb");
public const int RadCmdApplyTemplateId = 0x0100;

//Internals
private readonly RadProjectsExtensionPackage package;
private readonly DTE2 dte;

/// <summary>
/// Initialize commands (called form <see cref="RadProjectsExtensionPackage.InitializeAsync"/>)
/// Get the MemuCommand and DTE services and creates the command handler <see cref="Instance"/>
/// </summary>
/// <param name="package">Package the command handler belongs to</param>
/// <returns>Async task</returns>
public static async Task InitializeAsync(RadProjectsExtensionPackage package)
{
// Switch to the main thread - the call to AddCommand in RadSolutionCommand's constructor requires
// the UI thread.
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
var dteService = await package.GetServiceAsync(typeof(EnvDTE.DTE)) as DTE2;
Instance = new RadProjectsExtensionCommands(package, commandService, dteService);
}

/// <summary>
/// Private CTOR
/// Add command(s) as menu item(s) to VS
/// </summary>
/// <param name="package">Package the command handler belongs to</param>
/// <param name="commandService">Menu Command service used to extend the VS menu</param>
/// <param name="dteService">DTE service used to manipulate the VS</param>
private RadProjectsExtensionCommands(RadProjectsExtensionPackage package, OleMenuCommandService commandService, DTE2 dteService)
{
this.package = package ?? throw new ArgumentNullException(nameof(package));
commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));
dte = dteService ?? throw new ArgumentNullException(nameof(dteService));

//Extend the VS menu
package.Output("Initializing commands...");
var menuItem1 = new MenuCommand(ExecuteRadCmdApplyTemplate, new CommandID(CommandSet, RadCmdApplyTemplateId));
commandService.AddCommand(menuItem1);

package.Output("Initialized commands");
}

/// <summary>
/// Apply Template command (menu item) event handler
/// </summary>
/// <param name="sender">Sender raising the event</param>
/// <param name="e">Event arguments</param>
private void ExecuteRadCmdApplyTemplate(object sender, EventArgs e)
{
ThreadHelper.ThrowIfNotOnUIThread();

//Get current settings
var settings = package.GetDialogPage(typeof(RadProjectsExtensionOptions)) as RadProjectsExtensionOptions;

//Initialize TemplateEngine and call it's ApplyTemplate method
var templateEngine = new TemplateEngine(package, settings, dte);
templateEngine.ApplyTemplate();

}
}
}
Loading

0 comments on commit 792fed3

Please sign in to comment.