From afb675609ed84b3ecb259bed81efac7d00448b75 Mon Sep 17 00:00:00 2001 From: Endy Tjahjono Date: Thu, 16 Feb 2012 14:48:13 +0700 Subject: [PATCH] Support for VB.NET projects --- .../tools/cs/IMailerMethodTemplate.vb.t4 | 5 +++ .../input/tools/cs/IMailerTemplate.vb.t4 | 17 ++++++++ .../input/tools/cs/MailerMethodTemplate.vb.t4 | 17 ++++++++ .../NuGet/input/tools/cs/MailerTemplate.vb.t4 | 41 +++++++++++++++++++ .../input/tools/view/aspx/Layout.Master.vb.t4 | 17 ++++++++ .../tools/view/aspx/Layout.text.Master.vb.t4 | 5 +++ .../input/tools/view/aspx/Mail.aspx.vb.t4 | 11 +++++ .../tools/view/aspx/Mail.text.aspx.vb.t4 | 8 ++++ .../tools/view/razor/Layout.cshtml.vb.t4 | 8 ++++ .../tools/view/razor/Layout.text.cshtml.vb.t4 | 4 ++ .../input/tools/view/razor/Mail.cshtml.vb.t4 | 4 ++ .../tools/view/razor/Mail.text.cshtml.vb.t4 | 4 ++ 12 files changed, 141 insertions(+) create mode 100644 Mvc.Mailer/NuGet/input/tools/cs/IMailerMethodTemplate.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/cs/IMailerTemplate.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/cs/MailerMethodTemplate.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/cs/MailerTemplate.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.Master.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.text.Master.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.aspx.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.text.aspx.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/razor/Layout.cshtml.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/razor/Layout.text.cshtml.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/razor/Mail.cshtml.vb.t4 create mode 100644 Mvc.Mailer/NuGet/input/tools/view/razor/Mail.text.cshtml.vb.t4 diff --git a/Mvc.Mailer/NuGet/input/tools/cs/IMailerMethodTemplate.vb.t4 b/Mvc.Mailer/NuGet/input/tools/cs/IMailerMethodTemplate.vb.t4 new file mode 100644 index 0000000..be725f1 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/cs/IMailerMethodTemplate.vb.t4 @@ -0,0 +1,5 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vb" #> + +MailMessage <#= Model.MethodName #>(); + diff --git a/Mvc.Mailer/NuGet/input/tools/cs/IMailerTemplate.vb.t4 b/Mvc.Mailer/NuGet/input/tools/cs/IMailerTemplate.vb.t4 new file mode 100644 index 0000000..7a1d06b --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/cs/IMailerTemplate.vb.t4 @@ -0,0 +1,17 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vb" #> +Imports System.Collections.Generic +Imports System.Linq +Imports System.Web +Imports Mvc.Mailer +Imports System.Net.Mail + +Namespace <#= Model.Namespace #>.Mailers + + Public Interface I<#= Model.MailerName #> +<# foreach(var mailerMethod in Model.MailerMethods) {#> + Function <#= mailerMethod #>() As MailMessage +<# } #> + End Interface + +End Namespace diff --git a/Mvc.Mailer/NuGet/input/tools/cs/MailerMethodTemplate.vb.t4 b/Mvc.Mailer/NuGet/input/tools/cs/MailerMethodTemplate.vb.t4 new file mode 100644 index 0000000..1e7a196 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/cs/MailerMethodTemplate.vb.t4 @@ -0,0 +1,17 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vb" #> + +Public Overridable Function <#= mailerMethod #>() As MailMessage<# if( Model.Interface) { #> Implements I<#= Model.MailerName #>.<#= mailerMethod #> +<# } else { #> + +<# } #> + Dim mailMessage = New MailMessage() With { + .Subject = "<#= mailerMethod #>" + } + + 'mailMessage.To.Add("some-email@example.com") + 'ViewBag.data = someObject + PopulateBody(mailMessage, viewName:="<#= mailerMethod #>") + + Return mailMessage +End Function diff --git a/Mvc.Mailer/NuGet/input/tools/cs/MailerTemplate.vb.t4 b/Mvc.Mailer/NuGet/input/tools/cs/MailerTemplate.vb.t4 new file mode 100644 index 0000000..ec7e8ed --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/cs/MailerTemplate.vb.t4 @@ -0,0 +1,41 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vb" #> +Imports System.Collections.Generic +Imports System.Linq +Imports System.Web +Imports Mvc.Mailer +Imports System.Net.Mail + +Namespace <#= Model.Namespace #>.Mailers + + Public Class <#= Model.MailerName #> + Inherits MailerBase +<# if( Model.Interface) { #> + Implements I<#= Model.MailerName #> +<# } #> + + Public Sub New() + MyBase.New() + MasterName = "_Layout" + End Sub + +<# foreach(var mailerMethod in Model.MailerMethods) {#> + Public Overridable Function <#= mailerMethod #>() As MailMessage<# if( Model.Interface) { #> Implements I<#= Model.MailerName #>.<#= mailerMethod #> +<# } else { #> + +<# } #> + Dim mailMessage = New MailMessage() With { + .Subject = "<#= mailerMethod #>" + } + + 'mailMessage.To.Add("some-email@example.com") + 'ViewBag.data = someObject + PopulateBody(mailMessage, viewName:="<#= mailerMethod #>") + + Return mailMessage + End Function +<# } #> + + End Class + +End Namespace diff --git a/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.Master.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.Master.vb.t4 new file mode 100644 index 0000000..be2a853 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.Master.vb.t4 @@ -0,0 +1,17 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="Master" #> +<%@ Master Language="VB" Inherits="System.Web.Mvc.ViewMasterPage" %> + + + + + + <asp:ContentPlaceHolder ID="TitleContent" runat="server" /> + + +
+ + +
+ + diff --git a/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.text.Master.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.text.Master.vb.t4 new file mode 100644 index 0000000..f28e92e --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/aspx/Layout.text.Master.vb.t4 @@ -0,0 +1,5 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="text.Master" #> +<%@ Master Language="VB" Inherits="System.Web.Mvc.ViewMasterPage" %> + + diff --git a/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.aspx.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.aspx.vb.t4 new file mode 100644 index 0000000..bfd76da --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.aspx.vb.t4 @@ -0,0 +1,11 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="aspx" #> + +<%@ Page Title="" Language="VB" MasterPageFile="~/Views/<#= Model.MailerName #>/_Layout.Master" Inherits="System.Web.Mvc.ViewPage" %> + + + + + + HTML View for <#= Model.MailerName #>#<#= Model.ViewName #> + diff --git a/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.text.aspx.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.text.aspx.vb.t4 new file mode 100644 index 0000000..80c9d53 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/aspx/Mail.text.aspx.vb.t4 @@ -0,0 +1,8 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="text.aspx" #> + +<%@ Page Title="" Language="VB" MasterPageFile="~/Views/<#= Model.MailerName #>/_Layout.text.Master" Inherits="System.Web.Mvc.ViewPage" %> + + + TEXT View for <#= Model.MailerName #>#<#= Model.ViewName #> + diff --git a/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.cshtml.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.cshtml.vb.t4 new file mode 100644 index 0000000..264c178 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.cshtml.vb.t4 @@ -0,0 +1,8 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vbhtml" #> + + + + @RenderBody() + + \ No newline at end of file diff --git a/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.text.cshtml.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.text.cshtml.vb.t4 new file mode 100644 index 0000000..94471d4 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/razor/Layout.text.cshtml.vb.t4 @@ -0,0 +1,4 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="text.vbhtml" #> + +@RenderBody() \ No newline at end of file diff --git a/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.cshtml.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.cshtml.vb.t4 new file mode 100644 index 0000000..ffa3445 --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.cshtml.vb.t4 @@ -0,0 +1,4 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vbhtml" #> + +HTML View for <#= Model.MailerName #>#<#= Model.ViewName #> \ No newline at end of file diff --git a/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.text.cshtml.vb.t4 b/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.text.cshtml.vb.t4 new file mode 100644 index 0000000..754abef --- /dev/null +++ b/Mvc.Mailer/NuGet/input/tools/view/razor/Mail.text.cshtml.vb.t4 @@ -0,0 +1,4 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="text.vbhtml" #> + +Text View for <#= Model.MailerName #>#<#= Model.ViewName #> \ No newline at end of file