Merge pull request #3373 from marek-safar/net-4.6.2
[mono.git] / mcs / class / referencesource / System.Web / HtmlString.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="HtmlString.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 namespace System.Web {
8     //  Simple objects that wraps a string that is assumed to not need HTML encoded.
9     //  It implements IHtmlString, so when calling HttpUtility.HtmlEncode(htmlString), the string won't be encoded.
10     public class HtmlString: IHtmlString {
11
12         private string _htmlString;
13
14         public HtmlString(string value) {
15             _htmlString = value;
16         }
17
18         public string ToHtmlString() {
19             return _htmlString;
20         }
21
22         public override string ToString() {
23             return _htmlString;
24         }
25     }
26 }