-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDataBin.cs
More file actions
30 lines (25 loc) · 716 Bytes
/
DataBin.cs
File metadata and controls
30 lines (25 loc) · 716 Bytes
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
using System;
using System.Threading.Tasks;
namespace H.Necessaire
{
public class DataBin : DataBinMeta
{
#region Construct
private readonly Func<DataBinMeta, Task<ImADataBinStream>> streamFactory;
public DataBin(Func<DataBinMeta, Task<ImADataBinStream>> streamFactory)
{
this.streamFactory = streamFactory;
}
/// <summary>
/// For serialization
/// </summary>
private DataBin() { }
#endregion
public virtual async Task<ImADataBinStream> OpenDataBinStream()
{
if (streamFactory is null)
return null;
return await streamFactory(this);
}
}
}