Browse files

Using the Task parallel library for .Net 4.5

Updated the dependencies, using the Task Parallel Library for the Async
method.
  • Loading branch information...
1 parent 8674d98 commit 1a90444a86ba08610a3e85bc6fe62d1a94e1a562 @smsohan committed Mar 7, 2013
View
192 Mvc.Mailer.Test/Mvc.Mailer.Test.csproj
@@ -1,96 +1,98 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{3664DD95-3C70-421E-96CA-9B63EE086C27}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Mvc.Mailer.Test</RootNamespace>
- <AssemblyName>Mvc.Mailer.Test</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </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>
- <PlatformTarget>AnyCPU</PlatformTarget>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.6.1.12217, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\NUnit.2.6.1\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Core" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\MVC4\System.Web.Mvc.dll</HintPath>
- </Reference>
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="ExtensionMethods\HtmlHelperExtensionsTest.cs" />
- <Compile Include="LinkedResourceProviderTest.cs" />
- <Compile Include="MailerBaseTest.cs" />
- <Compile Include="MvcMailMessageTest.cs" />
- <Compile Include="Mocks.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="SmtpClientWrapperTest.cs" />
- <Compile Include="StringResultTest.cs" />
- <Compile Include="TestSmtpClientTest.cs" />
- <Compile Include="ExtensionMethods\UrlHelperExtensionsTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Mvc.Mailer\Mvc.Mailer.csproj">
- <Project>{37B58562-EF1A-47FE-A02E-98C82D5FB5BC}</Project>
- <Name>Mvc.Mailer</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Chrysanthemum.jpg">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
- <!-- 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>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{3664DD95-3C70-421E-96CA-9B63EE086C27}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Mvc.Mailer.Test</RootNamespace>
+ <AssemblyName>Mvc.Mailer.Test</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </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>
+ <Prefer32Bit>false</Prefer32Bit>
+ </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>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\lib\MVC4\System.Web.Mvc.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ExtensionMethods\HtmlHelperExtensionsTest.cs" />
+ <Compile Include="LinkedResourceProviderTest.cs" />
+ <Compile Include="MailerBaseTest.cs" />
+ <Compile Include="MvcMailMessageTest.cs" />
+ <Compile Include="Mocks.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SmtpClientWrapperTest.cs" />
+ <Compile Include="StringResultTest.cs" />
+ <Compile Include="TestSmtpClientTest.cs" />
+ <Compile Include="ExtensionMethods\UrlHelperExtensionsTest.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Mvc.Mailer\Mvc.Mailer.csproj">
+ <Project>{37B58562-EF1A-47FE-A02E-98C82D5FB5BC}</Project>
+ <Name>Mvc.Mailer</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Chrysanthemum.jpg">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+ <!-- 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>
View
128 Mvc.Mailer.Test/MvcMailMessageTest.cs
@@ -1,68 +1,62 @@
-using System;
-using NUnit.Framework;
-using System.Net.Mail;
-using System.IO;
-using Moq;
-
-namespace Mvc.Mailer.Test {
- [TestFixture]
- public class MvcMailMessageTest {
-
- private SmtpClientWrapper _smtpClient;
- private MvcMailMessage _mailMessage;
- private DirectoryInfo _mailDirectory;
-
- [SetUp]
- public void SetUp() {
- var smtpClient = new SmtpClient {
- DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
- };
-
- _mailDirectory = Directory.CreateDirectory(Path.Combine(Environment.CurrentDirectory, "Mails"));
- smtpClient.PickupDirectoryLocation = _mailDirectory.FullName;
- smtpClient.Host = "smtp.gmail.com";
- smtpClient.Port = 597;
- _smtpClient = new SmtpClientWrapper { InnerSmtpClient = smtpClient };
- _mailMessage = new MvcMailMessage { From = new MailAddress("gaga@gaga.com") };
- _mailMessage.To.Add("gigi@gigi.com");
- _mailMessage.Subject = "Hello!";
- _mailMessage.Body = "Mail Body";
- }
-
- [Test]
- public void TestSend() {
- _mailMessage.Send(_smtpClient);
- Assert.Pass("Mail Send working since no exception wast thrown");
- }
-
- [Test]
- public void TestSendAsync() {
- _mailMessage.SendAsync(smtpClient: _smtpClient);
- Assert.Pass("Mail Send Async working since no exception wast thrown");
- }
-
- [Test]
- public void SendAsync_with_userState_should_pass_that() {
- var client = new Mock<ISmtpClient>();
- client.Setup(c => c.SendAsync(_mailMessage, "something"));
- _mailMessage.SendAsync(userState: "something", smtpClient: client.Object);
- client.VerifyAll();
- }
-
- [Test]
- public void In_Test_Mode_should_use_TestSmtpClient() {
- TestSmtpClient.SentMails.Clear();
- MailerBase.IsTestModeEnabled = true;
- _mailMessage.Send();
- Assert.AreEqual(1, TestSmtpClient.SentMails.Count);
- Assert.AreSame(_mailMessage, TestSmtpClient.SentMails[0]);
- }
-
- [TearDown]
- public void TearDown() {
- MailerBase.IsTestModeEnabled = false;
- TestSmtpClient.SentMails.Clear();
- _mailDirectory.Delete(true);
- }
- }
+using System;
+using NUnit.Framework;
+using System.Net.Mail;
+using System.IO;
+using Moq;
+
+namespace Mvc.Mailer.Test {
+ [TestFixture]
+ public class MvcMailMessageTest {
+
+ private SmtpClientWrapper _smtpClient;
+ private MvcMailMessage _mailMessage;
+ private DirectoryInfo _mailDirectory;
+
+ [SetUp]
+ public void SetUp() {
+ var smtpClient = new SmtpClient {
+ DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
+ };
+
+ _mailDirectory = Directory.CreateDirectory(Path.Combine(Environment.CurrentDirectory, "Mails"));
+ smtpClient.PickupDirectoryLocation = _mailDirectory.FullName;
+ smtpClient.Host = "smtp.gmail.com";
+ smtpClient.Port = 597;
+ _smtpClient = new SmtpClientWrapper { InnerSmtpClient = smtpClient };
+ _mailMessage = new MvcMailMessage { From = new MailAddress("gaga@gaga.com") };
+ _mailMessage.To.Add("gigi@gigi.com");
+ _mailMessage.Subject = "Hello!";
+ _mailMessage.Body = "Mail Body";
+ }
+
+ [Test]
+ public void TestSend() {
+ _mailMessage.Send(_smtpClient);
+ Assert.Pass("Mail Send working since no exception wast thrown");
+ }
+
+ [Test]
+ public async void SendAsync_with_userState_should_pass_that() {
+ var client = new Mock<ISmtpClient>();
+ client.Setup(c => c.SendAsync(_mailMessage, "something"));
+ await _mailMessage.SendAsync(userState: "something", smtpClient: client.Object);
+ client.VerifyAll();
+ }
+
+ [Test]
+ public void In_Test_Mode_should_use_TestSmtpClient() {
+ TestSmtpClient.SentMails.Clear();
+ MailerBase.IsTestModeEnabled = true;
+ _mailMessage.Send();
+ Assert.AreEqual(1, TestSmtpClient.SentMails.Count);
+ Assert.AreSame(_mailMessage, TestSmtpClient.SentMails[0]);
+ }
+
+ [TearDown]
+ public void TearDown() {
+ MailerBase.IsTestModeEnabled = false;
+ TestSmtpClient.SentMails.Clear();
+ _mailDirectory.Delete(true);
+ }
+ }
}
View
8 Mvc.Mailer.Test/packages.config
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Moq" version="4.0.10827" targetFramework="net40" />
- <package id="NUnit" version="2.6.1" targetFramework="net40" />
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Moq" version="4.0.10827" targetFramework="net40" />
+ <package id="NUnit" version="2.6.2" targetFramework="net45" />
</packages>
View
208 Mvc.Mailer/Mvc.Mailer.csproj
@@ -1,104 +1,106 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{37B58562-EF1A-47FE-A02E-98C82D5FB5BC}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Mvc.Mailer</RootNamespace>
- <AssemblyName>Mvc.Mailer</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile />
- </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>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Core" />
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="Microsoft.CSharp" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="ExtensionMethods\UrlHelperExtensions.cs" />
- <Compile Include="EmptyHttpContext.cs" />
- <Compile Include="ILinkedResourceProvider.cs" />
- <Compile Include="LinkedResourceProvider.cs" />
- <Compile Include="MvcMailMessage.cs" />
- <Compile Include="SmtpClientBase.cs" />
- <Compile Include="SmtpClientWrapper.cs" />
- <Compile Include="TestSmtpClient.cs" />
- <Compile Include="ISmtpClient.cs" />
- <Compile Include="ExtensionMethods\HtmlHelperExtensions.cs" />
- <Compile Include="MailerBase.cs" />
- <Compile Include="StringResult.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="content\web.config.transform">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- <SubType>Designer</SubType>
- </None>
- <None Include="NuGet\input\tools\cs\IMailerMethodTemplate.cs.t4" />
- <None Include="NuGet\input\tools\cs\MailerMethodTemplate.cs.t4" />
- <None Include="NuGet\input\tools\Mailer.Aspx.ps1" />
- <None Include="NuGet\input\tools\Mailer.Razor.ps1" />
- <None Include="NuGet\input\tools\Install.ps1" />
- <None Include="NuGet\input\tools\cs\IMailerTemplate.cs.t4" />
- <None Include="NuGet\input\tools\cs\MailerTemplate.cs.t4" />
- <None Include="NuGet\input\tools\MailerFunctions.ps1" />
- <None Include="NuGet\input\tools\view\aspx\Mail.text.aspx.cs.t4" />
- <None Include="NuGet\input\tools\view\aspx\Layout.text.Master.cs.t4" />
- <None Include="NuGet\input\tools\view\aspx\Layout.Master.cs.t4" />
- <None Include="NuGet\input\tools\view\aspx\Mail.aspx.cs.t4" />
- <None Include="NuGet\input\tools\view\razor\Layout.text.cshtml.cs.t4" />
- <None Include="NuGet\input\tools\view\razor\Mail.text.cshtml.cs.t4" />
- <None Include="NuGet\input\tools\view\razor\Layout.cshtml.cs.t4" />
- <None Include="NuGet\input\tools\view\razor\Mail.cshtml.cs.t4" />
- <None Include="NuGet\MvcMailer.nuspec">
- <SubType>Designer</SubType>
- </None>
- </ItemGroup>
- <ItemGroup />
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PostBuildEvent>IF NOT EXIST "$(ProjectDir)NuGet\input\lib\40" md "$(ProjectDir)NuGet\input\lib\40"
-copy *.dll "$(ProjectDir)NuGet\input\lib\40"
-xcopy content "$(ProjectDir)NuGet\input\content" /S /Y
-cd "$(ProjectDir)NuGet"
-IF NOT EXIST output md output
-nuget pack mvcmailer.nuspec -b input -o output
-</PostBuildEvent>
- </PropertyGroup>
- <!-- 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>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{37B58562-EF1A-47FE-A02E-98C82D5FB5BC}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Mvc.Mailer</RootNamespace>
+ <AssemblyName>Mvc.Mailer</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </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>
+ <Prefer32Bit>false</Prefer32Bit>
+ </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>
+ <Prefer32Bit>false</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ExtensionMethods\UrlHelperExtensions.cs" />
+ <Compile Include="EmptyHttpContext.cs" />
+ <Compile Include="ILinkedResourceProvider.cs" />
+ <Compile Include="LinkedResourceProvider.cs" />
+ <Compile Include="MvcMailMessage.cs" />
+ <Compile Include="SmtpClientBase.cs" />
+ <Compile Include="SmtpClientWrapper.cs" />
+ <Compile Include="TestSmtpClient.cs" />
+ <Compile Include="ISmtpClient.cs" />
+ <Compile Include="ExtensionMethods\HtmlHelperExtensions.cs" />
+ <Compile Include="MailerBase.cs" />
+ <Compile Include="StringResult.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="content\web.config.transform">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ <SubType>Designer</SubType>
+ </None>
+ <None Include="NuGet\input\tools\cs\IMailerMethodTemplate.cs.t4" />
+ <None Include="NuGet\input\tools\cs\MailerMethodTemplate.cs.t4" />
+ <None Include="NuGet\input\tools\Mailer.Aspx.ps1" />
+ <None Include="NuGet\input\tools\Mailer.Razor.ps1" />
+ <None Include="NuGet\input\tools\Install.ps1" />
+ <None Include="NuGet\input\tools\cs\IMailerTemplate.cs.t4" />
+ <None Include="NuGet\input\tools\cs\MailerTemplate.cs.t4" />
+ <None Include="NuGet\input\tools\MailerFunctions.ps1" />
+ <None Include="NuGet\input\tools\view\aspx\Mail.text.aspx.cs.t4" />
+ <None Include="NuGet\input\tools\view\aspx\Layout.text.Master.cs.t4" />
+ <None Include="NuGet\input\tools\view\aspx\Layout.Master.cs.t4" />
+ <None Include="NuGet\input\tools\view\aspx\Mail.aspx.cs.t4" />
+ <None Include="NuGet\input\tools\view\razor\Layout.text.cshtml.cs.t4" />
+ <None Include="NuGet\input\tools\view\razor\Mail.text.cshtml.cs.t4" />
+ <None Include="NuGet\input\tools\view\razor\Layout.cshtml.cs.t4" />
+ <None Include="NuGet\input\tools\view\razor\Mail.cshtml.cs.t4" />
+ <None Include="NuGet\MvcMailer.nuspec">
+ <SubType>Designer</SubType>
+ </None>
+ </ItemGroup>
+ <ItemGroup />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>IF NOT EXIST "$(ProjectDir)NuGet\input\lib\40" md "$(ProjectDir)NuGet\input\lib\40"
+copy *.dll "$(ProjectDir)NuGet\input\lib\40"
+xcopy content "$(ProjectDir)NuGet\input\content" /S /Y
+cd "$(ProjectDir)NuGet"
+IF NOT EXIST output md output
+nuget pack mvcmailer.nuspec -b input -o output
+</PostBuildEvent>
+ </PropertyGroup>
+ <!-- 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>
View
92 Mvc.Mailer/MvcMailMessage.cs
@@ -1,44 +1,48 @@
-using System.Collections.Generic;
-using System.Net.Mail;
-
-namespace Mvc.Mailer {
- public class MvcMailMessage : MailMessage {
- public string ViewName { get; set; }
- public string MasterName { get; set; }
- public Dictionary<string,string> LinkedResources { get; set; }
-
- /// <summary>
- /// Sends a MailMessage using smtpClient
- /// </summary>
- /// <param name="smtpClient">leave null to use default System.Net.Mail.SmtpClient</param>
- public virtual void Send(ISmtpClient smtpClient = null)
- {
- smtpClient = smtpClient ?? GetSmtpClient();
- using (smtpClient)
- {
- smtpClient.Send(this);
- }
- }
-
- /// <summary>
- /// Asynchronously Sends a MailMessage using smtpClient
- /// </summary>
- /// <param name="userState">The userState</param>
- /// <param name="smtpClient">leave null to use default System.Net.Mail.SmtpClient</param>
- public virtual void SendAsync(object userState = null, ISmtpClient smtpClient = null)
- {
- smtpClient = smtpClient ?? GetSmtpClient();
- smtpClient.SendAsync(this, userState);
- }
-
- public virtual ISmtpClient GetSmtpClient()
- {
- if (MailerBase.IsTestModeEnabled)
- {
- return new TestSmtpClient();
- }
- return new SmtpClientWrapper();
- }
-
- }
-}
+using System.Collections.Generic;
+using System.Net.Mail;
+using System.Threading.Tasks;
+
+namespace Mvc.Mailer {
+ public class MvcMailMessage : MailMessage {
+ public string ViewName { get; set; }
+ public string MasterName { get; set; }
+ public Dictionary<string,string> LinkedResources { get; set; }
+
+ /// <summary>
+ /// Sends a MailMessage using smtpClient
+ /// </summary>
+ /// <param name="smtpClient">leave null to use default System.Net.Mail.SmtpClient</param>
+ public virtual void Send(ISmtpClient smtpClient = null)
+ {
+ smtpClient = smtpClient ?? GetSmtpClient();
+ using (smtpClient)
+ {
+ smtpClient.Send(this);
+ }
+ }
+
+ /// <summary>
+ /// Asynchronously Sends a MailMessage using smtpClient
+ /// </summary>
+ /// <param name="userState">The userState</param>
+ /// <param name="smtpClient">leave null to use default System.Net.Mail.SmtpClient</param>
+ public virtual async Task SendAsync(object userState = null, ISmtpClient smtpClient = null)
+ {
+ await Task.Run(() =>
+ {
+ smtpClient = smtpClient ?? GetSmtpClient();
+ smtpClient.SendAsync(this, userState);
+ });
+ }
+
+ public virtual ISmtpClient GetSmtpClient()
+ {
+ if (MailerBase.IsTestModeEnabled)
+ {
+ return new TestSmtpClient();
+ }
+ return new SmtpClientWrapper();
+ }
+
+ }
+}
View
36 Mvc.Mailer/NuGet/MvcMailer.nuspec
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package>
- <metadata>
- <id>MvcMailer</id>
- <version>4.0</version>
- <authors>S. M. SOHAN, Tyler Mercier</authors>
- <description>
-MvcMailer sends emails using the MVC views as Email Body with no effort. Here's a quick list of features: a) Use Razor/WebForms views b) Use Master pages c) Write Testable Code d) Pass values to your view using ViewBag or ViewModel and e) Generate Absolute URL using Url.Abs method and f) create multi-part emails by just adding a view file, g) scaffold your mailers.
-MvcMailer has a MailerBase class that extends ControllerBase class. So, Mailers are just like your Controllers. As a result, you can use all the controller goodies without any learning curve, period. The end result is a professional looking HTML email body ready for your to send to your website users.
-Visit the Project site for a comprehensive tutorial on MvcMailer. This version is for ASP.Net MVC 4
-</description>
- <dependencies>
- <dependency id="T4Scaffolding" version="1.0.7"/>
- </dependencies>
- <language>en-US</language>
- <projectUrl>https://github.com/smsohan/MvcMailer</projectUrl>
- <licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
- </metadata>
+<?xml version="1.0" encoding="utf-8"?>
+<package>
+ <metadata>
+ <id>MvcMailer</id>
+ <version>4.5</version>
+ <authors>S. M. SOHAN, Tyler Mercier</authors>
+ <description>
+MvcMailer sends emails using the MVC views as Email Body with no effort. Here's a quick list of features: a) Use Razor/WebForms views b) Use Master pages c) Write Testable Code d) Pass values to your view using ViewBag or ViewModel and e) Generate Absolute URL using Url.Abs method and f) create multi-part emails by just adding a view file, g) scaffold your mailers.
+MvcMailer has a MailerBase class that extends ControllerBase class. So, Mailers are just like your Controllers. As a result, you can use all the controller goodies without any learning curve, period. The end result is a professional looking HTML email body ready for your to send to your website users.
+Visit the Project site for a comprehensive tutorial on MvcMailer. This version is for ASP.Net MVC 4.5. For other versions, please check MvcMailer4 and MvcMailer3 packages.
+</description>
+ <dependencies>
+ <dependency id="T4Scaffolding.Core" version="1.0.0"/>
+ </dependencies>
+ <language>en-US</language>
+ <projectUrl>https://github.com/smsohan/MvcMailer</projectUrl>
+ <licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
+ </metadata>
</package>
View
BIN packages/NUnit.2.6.1/NUnit.2.6.1.nupkg
Binary file not shown.
View
BIN packages/NUnit.2.6.1/lib/nunit.framework.dll
Binary file not shown.
View
10,892 packages/NUnit.2.6.1/lib/nunit.framework.xml
0 additions, 10,892 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
30 packages/NUnit.2.6.1/license.txt → packages/NUnit.2.6.2/license.txt
@@ -1,15 +1,15 @@
-Copyright © 2002-2012 Charlie Poole
-Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
-Copyright © 2000-2002 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
-
-Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
-
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
+Copyright © 2002-2012 Charlie Poole
+Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
+Copyright © 2000-2002 Philip A. Craig
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
+
+Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
+
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.

0 comments on commit 1a90444

Please sign in to comment.