// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.Framework.Internal;
using Microsoft.Framework.WebEncoders;
namespace Microsoft.AspNet.Mvc.Rendering
{
///
/// String content which knows how to write itself.
///
public class HtmlString : IHtmlContent
{
private readonly string _input;
///
/// Returns an with empty content.
///
public static readonly HtmlString Empty = new HtmlString(string.Empty);
///
/// Creates a new instance of .
///
/// string to initialize .
public HtmlString(string input)
{
_input = input;
}
///
public void WriteTo([NotNull] TextWriter writer, [NotNull] IHtmlEncoder encoder)
{
writer.Write(_input);
}
///
public override string ToString()
{
return _input;
}
}
}