Skip to content

Commit bf77c16

Browse files
committed
Merge branch 'develop'
2 parents b1fd681 + a9878b1 commit bf77c16

File tree

13 files changed

+84
-207
lines changed

13 files changed

+84
-207
lines changed

TuesPechkin.TestFormsApp/TuesPechkin.TestFormsApp.csproj

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,6 @@
1515
</TargetFrameworkProfile>
1616
<FileAlignment>512</FileAlignment>
1717
</PropertyGroup>
18-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
19-
<PlatformTarget>x86</PlatformTarget>
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
23-
<OutputPath>bin\Debug\</OutputPath>
24-
<DefineConstants>DEBUG;TRACE</DefineConstants>
25-
<ErrorReport>prompt</ErrorReport>
26-
<WarningLevel>4</WarningLevel>
27-
<Prefer32Bit>false</Prefer32Bit>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
30-
<PlatformTarget>x86</PlatformTarget>
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
33-
<OutputPath>bin\Release\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
37-
<Prefer32Bit>false</Prefer32Bit>
38-
</PropertyGroup>
3918
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
4019
<DebugSymbols>true</DebugSymbols>
4120
<OutputPath>bin\x64\Debug\</OutputPath>
@@ -56,26 +35,6 @@
5635
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
5736
<Prefer32Bit>false</Prefer32Bit>
5837
</PropertyGroup>
59-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
60-
<DebugSymbols>true</DebugSymbols>
61-
<OutputPath>bin\Debug\</OutputPath>
62-
<DefineConstants>DEBUG;TRACE</DefineConstants>
63-
<DebugType>full</DebugType>
64-
<PlatformTarget>AnyCPU</PlatformTarget>
65-
<ErrorReport>prompt</ErrorReport>
66-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
67-
<Prefer32Bit>false</Prefer32Bit>
68-
</PropertyGroup>
69-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
70-
<OutputPath>bin\Release\</OutputPath>
71-
<DefineConstants>TRACE</DefineConstants>
72-
<Optimize>true</Optimize>
73-
<DebugType>pdbonly</DebugType>
74-
<PlatformTarget>AnyCPU</PlatformTarget>
75-
<ErrorReport>prompt</ErrorReport>
76-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
77-
<Prefer32Bit>false</Prefer32Bit>
78-
</PropertyGroup>
7938
<ItemGroup>
8039
<Reference Include="System" />
8140
<Reference Include="System.Drawing" />

TuesPechkin.TestWebApp/Controllers/HomeController.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ public class HomeController : Controller
99
{
1010
private static IConverter converter =
1111
new ThreadSafeConverter(
12-
new PdfToolset(
13-
new Win64EmbeddedDeployment(
12+
new RemotingToolset<PdfToolset>(
13+
new Win32EmbeddedDeployment(
1414
new StaticDeployment(
15-
Path.Combine(Path.GetTempPath(), "wkhtmltox.dll")))));
15+
Path.Combine(
16+
Path.GetTempPath(),
17+
Guid.NewGuid().ToString(),
18+
"wkhtmltox.dll")))));
1619

17-
//
1820
// GET: /Home/
1921
public ActionResult Index()
2022
{
21-
var html = "<p>Just some test HTML</p>";
22-
var doc = new HtmlToPdfDocument(html);
23-
23+
var doc = new HtmlToPdfDocument();
24+
doc.Objects.Add(new ObjectSettings { PageUrl = "www.google.com " });
25+
2426
for (var i = 0; i < 5; i++)
2527
{
2628
var result = converter.Convert(doc);

TuesPechkin.TestWebApp/TuesPechkin.TestWebApp.csproj

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@
2424
<RestorePackages>true</RestorePackages>
2525
<TargetFrameworkProfile />
2626
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28-
<DebugSymbols>true</DebugSymbols>
29-
<DebugType>full</DebugType>
30-
<Optimize>false</Optimize>
31-
<OutputPath>bin\</OutputPath>
32-
<DefineConstants>DEBUG;TRACE</DefineConstants>
33-
<ErrorReport>prompt</ErrorReport>
34-
<WarningLevel>4</WarningLevel>
35-
<Prefer32Bit>false</Prefer32Bit>
36-
</PropertyGroup>
37-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
38-
<DebugType>full</DebugType>
39-
<Optimize>true</Optimize>
40-
<OutputPath>bin\</OutputPath>
41-
<DefineConstants>TRACE</DefineConstants>
42-
<ErrorReport>prompt</ErrorReport>
43-
<WarningLevel>4</WarningLevel>
44-
<Prefer32Bit>false</Prefer32Bit>
45-
<DebugSymbols>true</DebugSymbols>
46-
</PropertyGroup>
4727
<ItemGroup>
4828
<Reference Include="Microsoft.CSharp" />
4929
<Reference Include="System" />
@@ -236,9 +216,9 @@
236216
<Content Include="packages.config" />
237217
</ItemGroup>
238218
<ItemGroup>
239-
<ProjectReference Include="..\TuesPechkin.Wkhtmltox.Win64\TuesPechkin.Wkhtmltox.Win64.csproj">
240-
<Project>{f77cffca-1cf0-49c8-98b6-5c6009c6be63}</Project>
241-
<Name>TuesPechkin.Wkhtmltox.Win64</Name>
219+
<ProjectReference Include="..\TuesPechkin.Wkhtmltox.Win32\TuesPechkin.Wkhtmltox.Win32.csproj">
220+
<Project>{1bcd70ef-32ef-4339-9ccf-ea07415a39a9}</Project>
221+
<Name>TuesPechkin.Wkhtmltox.Win32</Name>
242222
</ProjectReference>
243223
<ProjectReference Include="..\TuesPechkin\TuesPechkin.csproj">
244224
<Project>{023df833-b252-48b3-b6af-dbbb13e39b13}</Project>
@@ -249,6 +229,25 @@
249229
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
250230
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
251231
</PropertyGroup>
232+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
233+
<DebugSymbols>true</DebugSymbols>
234+
<OutputPath>bin\</OutputPath>
235+
<DefineConstants>DEBUG;TRACE</DefineConstants>
236+
<DebugType>full</DebugType>
237+
<PlatformTarget>x86</PlatformTarget>
238+
<ErrorReport>prompt</ErrorReport>
239+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
240+
</PropertyGroup>
241+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
242+
<DebugSymbols>true</DebugSymbols>
243+
<OutputPath>bin\</OutputPath>
244+
<DefineConstants>TRACE</DefineConstants>
245+
<Optimize>true</Optimize>
246+
<DebugType>full</DebugType>
247+
<PlatformTarget>x86</PlatformTarget>
248+
<ErrorReport>prompt</ErrorReport>
249+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
250+
</PropertyGroup>
252251
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
253252
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
254253
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

TuesPechkin.Tests/GeneralTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ public void ConvertsAfterAppDomainRecycles()
4545
new RemotingToolset<PdfToolset>(
4646
new StaticDeployment(dllPath)));
4747

48-
var document = new HtmlToPdfDocument("<p>some html</p>");
48+
var document = new HtmlToPdfDocument
49+
{
50+
Objects =
51+
{
52+
new ObjectSettings { PageUrl = "www.google.com" }
53+
}
54+
};
4955

5056
AppDomain.CurrentDomain.SetData("result", converter.Convert(document));
5157
};

TuesPechkin.Tests/TuesPechkin.Tests.csproj

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,6 @@
4141
<PropertyGroup>
4242
<StartupObject />
4343
</PropertyGroup>
44-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
45-
<DebugSymbols>true</DebugSymbols>
46-
<OutputPath>bin\x64\Debug\</OutputPath>
47-
<DefineConstants>DEBUG;TRACE</DefineConstants>
48-
<DebugType>full</DebugType>
49-
<PlatformTarget>x64</PlatformTarget>
50-
<ErrorReport>prompt</ErrorReport>
51-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
52-
<Prefer32Bit>false</Prefer32Bit>
53-
</PropertyGroup>
54-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
55-
<OutputPath>bin\x64\Release\</OutputPath>
56-
<DefineConstants>TRACE</DefineConstants>
57-
<Optimize>true</Optimize>
58-
<DebugType>pdbonly</DebugType>
59-
<PlatformTarget>x64</PlatformTarget>
60-
<ErrorReport>prompt</ErrorReport>
61-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
62-
<Prefer32Bit>false</Prefer32Bit>
63-
</PropertyGroup>
64-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
65-
<DebugSymbols>true</DebugSymbols>
66-
<OutputPath>bin\Debug\</OutputPath>
67-
<DefineConstants>DEBUG;TRACE</DefineConstants>
68-
<DebugType>full</DebugType>
69-
<PlatformTarget>AnyCPU</PlatformTarget>
70-
<ErrorReport>prompt</ErrorReport>
71-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
72-
<Prefer32Bit>false</Prefer32Bit>
73-
</PropertyGroup>
74-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
75-
<OutputPath>bin\Release\</OutputPath>
76-
<DefineConstants>TRACE</DefineConstants>
77-
<Optimize>true</Optimize>
78-
<DebugType>pdbonly</DebugType>
79-
<PlatformTarget>AnyCPU</PlatformTarget>
80-
<ErrorReport>prompt</ErrorReport>
81-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
82-
<Prefer32Bit>false</Prefer32Bit>
83-
</PropertyGroup>
8444
<ItemGroup>
8545
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
8646
<Reference Include="System" />

TuesPechkin.Tests/TuesPechkinTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static TuesPechkinTests()
3535
[TestCleanup]
3636
public void TestCleanup()
3737
{
38-
converter.Invoke(() => toolset.Unload());
38+
toolset.Unload();
3939
}
4040

4141
protected AppDomain GetAppDomain(string name)

TuesPechkin.sln

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,15 @@ Global
3434
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Debug|Any CPU.Build.0 = Debug|Any CPU
3535
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Release|Any CPU.ActiveCfg = Release|Any CPU
3636
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.ActiveCfg = Release|Any CPU
48-
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.ActiveCfg = Debug|x64
38+
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.ActiveCfg = Release|x64
39+
{35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.Build.0 = Release|x64
40+
{D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.ActiveCfg = Debug|x86
41+
{D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.ActiveCfg = Release|x86
42+
{D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.Build.0 = Release|x86
43+
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.ActiveCfg = Debug|x86
44+
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.ActiveCfg = Release|x86
45+
{B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.Build.0 = Release|x86
4946
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Debug|Any CPU.ActiveCfg = Debug|x86
5047
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Debug|Any CPU.Build.0 = Debug|x86
5148
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Release|Any CPU.ActiveCfg = Release|x86

TuesPechkin/NestingToolset.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public abstract class NestingToolset : MarshalByRefObject, IToolset
99
{
1010
public abstract event EventHandler Unloaded;
1111

12+
internal event EventHandler BeforeUnload;
13+
1214
public IDeployment Deployment { get; protected set; }
1315

1416
public bool Loaded { get; protected set; }
@@ -24,6 +26,14 @@ public override object InitializeLifetimeService()
2426
return null;
2527
}
2628

29+
internal void OnBeforeUnload(object sender)
30+
{
31+
if (BeforeUnload != null)
32+
{
33+
BeforeUnload(sender, EventArgs.Empty);
34+
}
35+
}
36+
2737
public void AddObject(IntPtr converter, IntPtr objectConfig, byte[] html)
2838
{
2939
NestedToolset.AddObject(converter, objectConfig, html);

TuesPechkin/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,11 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
85
[assembly: AssemblyTitle("TuesPechkin")]
96
[assembly: AssemblyDescription(".NET wrapper for wkhtmltopdf; supports 32-bit, 64-bit, multi-threaded and IIS environments.")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
127
[assembly: AssemblyProduct("TuesPechkin")]
138
[assembly: AssemblyCopyright("Copyright 2014 Derek Gray")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
9+
[assembly: AssemblyVersion("2.0.1")]
1610

17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2011
[assembly: ComVisible(false)]
21-
22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
2312
[assembly: Guid("11f63696-7105-436d-9ec6-2fee54c40b11")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.0.0")]
36-
[assembly: AssemblyFileVersion("2.0.0")]

TuesPechkin/RemotingToolset.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,7 @@ public override void Unload()
6262
{
6363
if (Loaded)
6464
{
65-
NestedToolset.Unload();
66-
6765
TearDownAppDomain(null, EventArgs.Empty);
68-
69-
if (Unloaded != null)
70-
{
71-
Unloaded(this, EventArgs.Empty);
72-
}
7366
}
7467
}
7568

@@ -99,6 +92,8 @@ private void TearDownAppDomain(object sender, EventArgs e)
9992
return;
10093
}
10194

95+
OnBeforeUnload((ActionShim)(() => NestedToolset.Unload()));
96+
10297
AppDomain.Unload(remoteDomain);
10398

10499
var expected = Path.Combine(

0 commit comments

Comments
 (0)