Skip to content

Commit ffd90cf

Browse files
author
ArthurHub
committed
minor fixes
1 parent a7f4a0c commit ffd90cf

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

Source/Demo/WinForms/GenerateImageForm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ private void GenerateImage()
7979
if (_backgroundColorTSB.SelectedItem != null && _textRenderingHintTSCB.SelectedItem != null)
8080
{
8181
var backgroundColor = Color.FromName(_backgroundColorTSB.SelectedItem.ToString());
82-
TextRenderingHint textRenderingHint;
83-
Enum.TryParse(_textRenderingHintTSCB.SelectedItem.ToString(), out textRenderingHint);
82+
TextRenderingHint textRenderingHint = (TextRenderingHint)Enum.Parse(typeof(TextRenderingHint), _textRenderingHintTSCB.SelectedItem.ToString());
8483
var img = _useGdiPlusTSB.Checked
8584
? HtmlRender.RenderToImageGdiPlus(_html, _pictureBox.ClientSize, textRenderingHint, null, HtmlRenderingHelper.OnStylesheetLoad, HtmlRenderingHelper.OnImageLoad)
8685
: HtmlRender.RenderToImage(_html, _pictureBox.ClientSize, backgroundColor, null, HtmlRenderingHelper.OnStylesheetLoad, HtmlRenderingHelper.OnImageLoad);

Source/Demo/WinForms/HtmlRenderer.Demo.WinForms.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>HtmlRenderer.Demo.WinForms</RootNamespace>
1212
<AssemblyName>HtmlRendererWinFormsDemo</AssemblyName>
13-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
1414
<FileUpgradeFlags>
1515
</FileUpgradeFlags>
1616
<UpgradeBackupLocation>
@@ -31,7 +31,8 @@
3131
<IsWebBootstrapper>false</IsWebBootstrapper>
3232
<UseApplicationTrust>false</UseApplicationTrust>
3333
<BootstrapperEnabled>true</BootstrapperEnabled>
34-
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
34+
<TargetFrameworkProfile>
35+
</TargetFrameworkProfile>
3536
</PropertyGroup>
3637
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3738
<DebugSymbols>true</DebugSymbols>

Source/Demo/WinForms/MainControl.Designer.cs

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/HtmlRenderer.WinForms/Utilities/ClipboardHelper.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
// Sample class for Copying and Pasting HTML fragments to and from the clipboard.
2-
//
3-
// Mike Stall. http://blogs.msdn.com/jmstall
1+
// "Therefore those skilled at the unorthodox
2+
// are infinite as heaven and earth,
3+
// inexhaustible as the great rivers.
4+
// When they come to an end,
5+
// they begin again,
6+
// like the days and months;
7+
// they die and are reborn,
8+
// like the four seasons."
49
//
10+
// - Sun Tsu,
11+
// "The Art of War"
512

613
using System;
714
using System.Text;
@@ -28,12 +35,12 @@ internal static class ClipboardHelper
2835
/// character must be escaped. <br/>
2936
/// </summary>
3037
private const string Header = @"Version:0.9
31-
StartHTML:<<<<<<<<1
32-
EndHTML:<<<<<<<<2
33-
StartFragment:<<<<<<<<3
34-
EndFragment:<<<<<<<<4
35-
StartSelection:<<<<<<<<3
36-
EndSelection:<<<<<<<<4";
38+
StartHTML:<<<<<<<<1
39+
EndHTML:<<<<<<<<2
40+
StartFragment:<<<<<<<<3
41+
EndFragment:<<<<<<<<4
42+
StartSelection:<<<<<<<<3
43+
EndSelection:<<<<<<<<4";
3744

3845
/// <summary>
3946
/// html comment to point the beginning of html fragment

0 commit comments

Comments
 (0)