FileDataSetEntry
A file entry in a form.
using AngleSharp.Dom.Io;
using AngleSharp.Network;
using System.Text;
namespace AngleSharp.Html
{
internal sealed class FileDataSetEntry : FormDataSetEntry
{
private readonly IFile _value;
public string FileName {
get {
if (_value == null)
return string.Empty;
return _value.Name;
}
}
public string ContentType {
get {
if (_value == null)
return MimeTypeNames.Binary;
return _value.Type;
}
}
public FileDataSetEntry(string name, IFile value, string type)
: base(name, type)
{
_value = value;
}
public override bool Contains(string boundary, Encoding encoding)
{
if (_value == null || _value.Body == null)
return false;
return false;
}
public override void Accept(IFormDataSetVisitor visitor)
{
visitor.File(this, FileName, ContentType, _value);
}
}
}