-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUnknownTypeDatafileInfo.cs
More file actions
29 lines (24 loc) · 898 Bytes
/
UnknownTypeDatafileInfo.cs
File metadata and controls
29 lines (24 loc) · 898 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
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using WarHub.ArmouryModel.Source;
namespace WarHub.ArmouryModel.ProjectModel
{
public record UnknownTypeDatafileInfo(string Filepath) : IDatafileInfo, IDatafileInfo<SourceNode>
{
public SourceKind DataKind => SourceKind.Unknown;
public SourceNode Node => throw new InvalidOperationException("There is no data for Unknown datafile.");
public SourceNode GetData(CancellationToken cancellationToken = default) => Node;
public Task<SourceNode> GetDataAsync(CancellationToken cancellationToken = default)
{
var node = Node;
return Task.FromResult(node);
}
public bool TryGetData([NotNullWhen(true)] out SourceNode? node)
{
node = null;
return false;
}
}
}