Browse Source

Add ASP.NET MVC file templates for C# and VB.NET.

pull/16/merge
Matt Ward 15 years ago
parent
commit
c7765b33a4
  1. 37
      data/templates/file/CSharp/CSharp.Mvc.Controller.xft
  2. 27
      data/templates/file/CSharp/CSharp.Mvc.ViewContentPage.xft
  3. 35
      data/templates/file/CSharp/CSharp.Mvc.ViewMasterPage.xft
  4. 31
      data/templates/file/CSharp/CSharp.Mvc.ViewPage.xft
  5. 22
      data/templates/file/CSharp/CSharp.Mvc.ViewUserControl.xft
  6. 30
      data/templates/file/VB/VB.Mvc.Controller.xft
  7. 26
      data/templates/file/VB/VB.Mvc.ViewContentPage.xft
  8. 34
      data/templates/file/VB/VB.Mvc.ViewMasterPage.xft
  9. 30
      data/templates/file/VB/VB.Mvc.ViewPage.xft
  10. 21
      data/templates/file/VB/VB.Mvc.ViewUserControl.xft
  11. 30
      src/Setup/Files.wxs
  12. 10
      src/Setup/Setup.wxs

37
data/templates/file/CSharp/CSharp.Mvc.Controller.xft

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC Controller"
icon="C#.File.NewClass"
category="C#"
subcategory="ASP.NET MVC"
defaultname="Controller${Number}.cs"
language="C#"/>
<Description>MVC Controller</Description>
<Files>
<File name="${FullName}" language="C#">
<![CDATA[${StandardHeader.C#}
using System;
using System.Web.Mvc;
namespace ${StandardNamespace}
{
/// <summary>
/// Description of ${ClassName}.
/// </summary>
public class ${ClassName} : Controller
{
public ActionResult Index()
{
return View();
}
}
}
]]>
</File>
</Files>
</Template>

27
data/templates/file/CSharp/CSharp.Mvc.ViewContentPage.xft

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Content Page"
icon="C#.File.NewClass"
category="C#"
subcategory="ASP.NET MVC"
defaultname="ViewContentPage${Number}.aspx"
language="C#"/>
<Description>MVC View Content Page</Description>
<Files>
<File name="${FullName}" language="C#">
<![CDATA[<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ContentPlaceHolderId="Title" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderId="Main" runat="server">
</asp:Content>
]]>
</File>
</Files>
</Template>

35
data/templates/file/CSharp/CSharp.Mvc.ViewMasterPage.xft

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Master Page"
icon="C#.File.NewClass"
category="C#"
subcategory="ASP.NET MVC"
defaultname="ViewMasterPage${Number}.master"
language="C#"/>
<Description>MVC View Master Page</Description>
<Files>
<File name="${FullName}" language="C#">
<![CDATA[<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title><asp:ContentPlaceHolder id="Title" runat="server"/></title>
</head>
<body>
<div id="page">
<section id="main">
<asp:ContentPlaceHolder id="Main" runat="server"/>
</section>
</div>
</body>
</html>
]]>
</File>
</Files>
</Template>

31
data/templates/file/CSharp/CSharp.Mvc.ViewPage.xft

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Page"
icon="C#.File.NewClass"
category="C#"
subcategory="ASP.NET MVC"
defaultname="ViewPage${Number}.aspx"
language="C#"/>
<Description>MVC View Page</Description>
<Files>
<File name="${FullName}" language="C#">
<![CDATA[<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
</head>
<body>
</body>
</html>
]]>
</File>
</Files>
</Template>

22
data/templates/file/CSharp/CSharp.Mvc.ViewUserControl.xft

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View User Control"
icon="C#.File.NewClass"
category="C#"
subcategory="ASP.NET MVC"
defaultname="ViewUserControl${Number}.ascx"
language="C#"/>
<Description>MVC View User Control</Description>
<Files>
<File name="${FullName}" language="C#">
<![CDATA[<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
]]>
</File>
</Files>
</Template>

30
data/templates/file/VB/VB.Mvc.Controller.xft

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC Controller"
icon="VBNet.File.NewClass"
category="VB"
subcategory="ASP.NET MVC"
defaultname="Controller${Number}.vb"
language="VBNET"/>
<Description>MVC Controller</Description>
<Files>
<File name="${FullName}" language="VBNET">
<![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Web.Mvc
Public Class ${ClassName}
Inherits Controller
Function Index() As ActionResult
Return View()
End Function
End Class
]]>
</File>
</Files>
</Template>

26
data/templates/file/VB/VB.Mvc.ViewContentPage.xft

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Content Page"
icon="VBNet.File.NewClass"
category="VB"
subcategory="ASP.NET MVC"
defaultname="ViewContentPage${Number}.aspx"
language="VBNET"/>
<Description>MVC View Content Page</Description>
<Files>
<File name="${FullName}" language="VBNET">
<![CDATA[<%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ContentPlaceHolderId="Title" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderId="Main" runat="server">
</asp:Content>
]]>
</File>
</Files>
</Template>

34
data/templates/file/VB/VB.Mvc.ViewMasterPage.xft

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Master Page"
icon="VBNet.File.NewClass"
category="VB"
subcategory="ASP.NET MVC"
defaultname="ViewMasterPage${Number}.master"
language="VBNET"/>
<Description>MVC View Master Page</Description>
<Files>
<File name="${FullName}" language="VBNET">
<![CDATA[<%@ Master Language="VB" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title><asp:ContentPlaceHolder id="Title" runat="server"/></title>
</head>
<body>
<div id="page">
<section id="main">
<asp:ContentPlaceHolder id="Main" runat="server"/>
</section>
</div>
</body>
</html>
]]>
</File>
</Files>
</Template>

30
data/templates/file/VB/VB.Mvc.ViewPage.xft

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View Page"
icon="VBNet.File.NewClass"
category="VB"
subcategory="ASP.NET MVC"
defaultname="ViewPage${Number}.aspx"
language="VBNET"/>
<Description>MVC View Page</Description>
<Files>
<File name="${FullName}" language="VBNET">
<![CDATA[<%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
</head>
<body>
</body>
</html>
]]>
</File>
</Files>
</Template>

21
data/templates/file/VB/VB.Mvc.ViewUserControl.xft

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0"?>
<Template author="Matt Ward" version="1.0">
<Config
name="MVC View User Control"
icon="VBNet.File.NewClass"
category="VB"
subcategory="ASP.NET MVC"
defaultname="ViewUserControl${Number}.ascx"
language="VBNET"/>
<Description>MVC View User Control</Description>
<Files>
<File name="${FullName}" language="VBNET">
<![CDATA[<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
]]>
</File>
</Files>
</Template>

30
src/Setup/Files.wxs

@ -715,6 +715,21 @@ @@ -715,6 +715,21 @@
<Component Guid="47C2A81B-8BC1-4762-BE7F-8989E8DE0703" Id="CSharpRecentFilesCollectionTemplateRecentFilesCollectionClass" DiskId="1">
<File Source="..\..\data\templates\file\CSharp\RecentFilesCollection.cs" Name="RecentFilesCollection.cs" Id="RecentFilesCollection.cs" KeyPath="yes" />
</Component>
<Component Id="CSharpMvcControllerFileTemplate" Guid="93AF3CAF-FA60-4765-9D24-415535A7F1F2" DiskId="1">
<File Id="CSharp.Mvc.Controller.xft" Name="CSharp.Mvc.Controller.xft" Source="..\..\data\templates\file\CSharp\CSharp.Mvc.Controller.xft" KeyPath="yes" />
</Component>
<Component Id="CSharpMvcViewContentPageFileTemplate" Guid="04C2BEF8-DB03-4D56-9176-E85529DB6789" DiskId="1">
<File Id="CSharp.Mvc.ViewContentPage.xft" Name="CSharp.Mvc.ViewContentPage.xft" Source="..\..\data\templates\file\CSharp\CSharp.Mvc.ViewContentPage.xft" KeyPath="yes" />
</Component>
<Component Id="CSharpMvcViewMasterPageFileTemplate" Guid="1482F786-8437-4402-8798-D0EF2664FCB4" DiskId="1">
<File Id="CSharp.Mvc.ViewMasterPage.xft" Name="CSharp.Mvc.ViewMasterPage.xft" Source="..\..\data\templates\file\CSharp\CSharp.Mvc.ViewMasterPage.xft" KeyPath="yes" />
</Component>
<Component Id="CSharpMvcViewPageFileTemplate" Guid="6C77F3F2-AF84-4927-BD9C-1995D8F30559" DiskId="1">
<File Id="CSharp.Mvc.ViewPage.xft" Name="CSharp.Mvc.ViewPage.xft" Source="..\..\data\templates\file\CSharp\CSharp.Mvc.ViewPage.xft" KeyPath="yes" />
</Component>
<Component Id="CSharpMvcViewUserControlFileTemplate" Guid="FF8B0A8A-6C11-471E-AAAC-351D8D762973" DiskId="1">
<File Id="CSharp.Mvc.ViewUserControl.xft" Name="CSharp.Mvc.ViewUserControl.xft" Source="..\..\data\templates\file\CSharp\CSharp.Mvc.ViewUserControl.xft" KeyPath="yes" />
</Component>
</Directory>
<Directory Id="MiscFileTemplatesFolder" Name="Misc">
<Component Guid="F47EE9EB-321F-4D98-A373-BFE2C2D801D0" Id="EmptyHTMLFileTemplate" DiskId="1">
@ -771,6 +786,21 @@ @@ -771,6 +786,21 @@
<File Id="VB.WPFUserControl.xft" Name="VB.WPFUserControl.xft" Source="..\..\data\templates\file\VB\VB.WPFUserControl.xft" />
<File Id="VB.WPFWindow.xft" Name="VB.WPFWindow.xft" Source="..\..\data\templates\file\VB\VB.WPFWindow.xft" />
</Component>
<Component Id="VBMvcControllerFileTemplate" Guid="E56644A3-2A6C-4E49-88E2-85EEDA3B0999" DiskId="1">
<File Id="VB.Mvc.Controller.xft" Name="VB.Mvc.Controller.xft" Source="..\..\data\templates\file\VB\VB.Mvc.Controller.xft" KeyPath="yes" />
</Component>
<Component Id="VBMvcViewContentPageFileTemplate" Guid="D1A45934-F42E-4B69-82CA-FF0769A39268" DiskId="1">
<File Id="VB.Mvc.ViewContentPage.xft" Name="VB.Mvc.ViewContentPage.xft" Source="..\..\data\templates\file\VB\VB.Mvc.ViewContentPage.xft" KeyPath="yes" />
</Component>
<Component Id="VBMvcViewMasterPageFileTemplate" Guid="014285CD-C24F-4C40-9C31-089C83E09660" DiskId="1">
<File Id="VB.Mvc.ViewMasterPage.xft" Name="VB.Mvc.ViewMasterPage.xft" Source="..\..\data\templates\file\VB\VB.Mvc.ViewMasterPage.xft" KeyPath="yes" />
</Component>
<Component Id="VBMvcViewPageFileTemplate" Guid="4C6C4367-AC3E-49F3-AA89-2EC2AF5D27C5" DiskId="1">
<File Id="VB.Mvc.ViewPage.xft" Name="VB.Mvc.ViewPage.xft" Source="..\..\data\templates\file\VB\VB.Mvc.ViewPage.xft" KeyPath="yes" />
</Component>
<Component Id="VBMvcViewUserControlFileTemplate" Guid="A6272501-2DB7-48B5-AF86-7D53016DF29A" DiskId="1">
<File Id="VB.Mvc.ViewUserControl.xft" Name="VB.Mvc.ViewUserControl.xft" Source="..\..\data\templates\file\VB\VB.Mvc.ViewUserControl.xft" KeyPath="yes" />
</Component>
</Directory>
</Directory>
<Directory Id="ProjectTemplatesFolder" Name="project">

10
src/Setup/Setup.wxs

@ -303,6 +303,16 @@ @@ -303,6 +303,16 @@
<ComponentRef Id="VBFileTemplates"/>
<ComponentRef Id="EmptyVBMvcWebProjectTemplate"/>
<ComponentRef Id="VBMvcWebProjectTemplate"/>
<ComponentRef Id="CSharpMvcControllerFileTemplate"/>
<ComponentRef Id="CSharpMvcViewPageFileTemplate"/>
<ComponentRef Id="CSharpMvcViewContentPageFileTemplate"/>
<ComponentRef Id="CSharpMvcViewMasterPageFileTemplate"/>
<ComponentRef Id="CSharpMvcViewUserControlFileTemplate"/>
<ComponentRef Id="VBMvcControllerFileTemplate"/>
<ComponentRef Id="VBMvcViewPageFileTemplate"/>
<ComponentRef Id="VBMvcViewContentPageFileTemplate"/>
<ComponentRef Id="VBMvcViewMasterPageFileTemplate"/>
<ComponentRef Id="VBMvcViewUserControlFileTemplate"/>
<ComponentRef Id="EmptyHTMLFileTemplate"/>
<ComponentRef Id="EmptyMsBuildFileTemplate"/>
<ComponentRef Id="EmptyResourceFileTemplate"/>

Loading…
Cancel
Save