Skip to content

Commit 60d96bb

Browse files
comments
1 parent a89ee1e commit 60d96bb

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/React.AspNet/ActionHtmlString.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright (c) 2014-Present, Facebook, Inc.
33
* All rights reserved.
44
*
@@ -24,19 +24,28 @@ namespace React.Web.Mvc
2424
namespace React.AspNet
2525
#endif
2626
{
27+
/// <summary>
28+
/// IHtmlString or IHtmlString action wrapper implementation
29+
/// </summary>
2730
public class ActionHtmlString : IHtmlString
2831
{
2932
private readonly Action<TextWriter> _textWriter;
3033

34+
/// <summary>
35+
/// Constructor IHtmlString or IHtmlString action wrapper implementation
36+
/// </summary>
37+
/// <param name="textWriter"></param>
3138
public ActionHtmlString(Action<TextWriter> textWriter)
3239
{
3340
_textWriter = textWriter;
3441
}
3542

3643
#if LEGACYASPNET
37-
[ThreadStatic]
44+
[ThreadStatic]
3845
private static StringWriter _sharedStringWriter;
3946

47+
/// <summary>Returns an HTML-encoded string.</summary>
48+
/// <returns>An HTML-encoded string.</returns>
4049
public string ToHtmlString()
4150
{
4251
var stringWriter = _sharedStringWriter;
@@ -53,6 +62,12 @@ public string ToHtmlString()
5362
return stringWriter.ToString();
5463
}
5564
#else
65+
/// <summary>
66+
/// Writes the content by encoding it with the specified <paramref name="encoder" />
67+
/// to the specified <paramref name="writer" />.
68+
/// </summary>
69+
/// <param name="writer">The <see cref="T:System.IO.TextWriter" /> to which the content is written.</param>
70+
/// <param name="encoder">The <see cref="T:System.Text.Encodings.Web.HtmlEncoder" /> which encodes the content to be written.</param>
5671
public void WriteTo(TextWriter writer, HtmlEncoder encoder)
5772
{
5873
_textWriter(writer);

0 commit comments

Comments
 (0)