forked from DataJuggler/BlazorFileUpload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileListEntryImpl.cs
40 lines (30 loc) · 877 Bytes
/
FileListEntryImpl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.IO;
namespace BlazorInputFile
{
// This is public only because it's used in a JSInterop method signature,
// but otherwise is intended as internal
public class FileListEntryImpl : IFileListEntry
{
internal InputFile Owner { get; set; }
private Stream _stream;
public event EventHandler OnDataRead;
public int Id { get; set; }
public DateTime LastModified { get; set; }
public string Name { get; set; }
public long Size { get; set; }
public string Type { get; set; }
public Stream Data
{
get
{
_stream ??= Owner.OpenFileStream(this);
return _stream;
}
}
internal void RaiseOnDataRead()
{
OnDataRead?.Invoke(this, null);
}
}
}