-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadOnlyEntity.cs
More file actions
94 lines (68 loc) · 2.74 KB
/
ReadOnlyEntity.cs
File metadata and controls
94 lines (68 loc) · 2.74 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System.Collections.Generic;
using Ipfs.CoreApi;
using OwlCore.ComponentModel;
using OwlCore.Storage;
using WindowsAppCommunity.Sdk.Models;
namespace WindowsAppCommunity.Sdk.Nomad;
/// <inheritdoc cref="IReadOnlyEntity" />
public class ReadOnlyEntity : IDelegable<IEntity>, IReadOnlyEntity
{
/// <inheritdoc/>
public required string Id { get; init; }
/// <summary>
/// The client to use for communicating with ipfs.
/// </summary>
public required ICoreApi Client { get; init; }
/// <summary>
/// Handles the connections for this entity.
/// </summary>
public required ReadOnlyConnectionCollection InnerConnections { get; init; }
/// <summary>
/// Handles the images collection for this entity.
/// </summary>
public required ReadOnlyImagesCollection InnerImages { get; init; }
/// <summary>
/// Handles the links collection for this entity.
/// </summary>
public required ReadOnlyLinksCollection InnerLinks { get; init; }
/// <inheritdoc />
public required IEntity Inner { get; init; }
/// <inheritdoc />
public string Name => Inner.Name;
/// <inheritdoc />
public string Description => Inner.Description;
/// <inheritdoc />
public string ExtendedDescription => Inner.ExtendedDescription;
/// <inheritdoc />
public bool? ForgetMe => Inner.ForgetMe;
/// <inheritdoc />
public bool IsUnlisted => Inner.IsUnlisted;
/// <inheritdoc />
public Link[] Links => InnerLinks.Links;
/// <inheritdoc />
public event EventHandler<string>? NameUpdated;
/// <inheritdoc />
public event EventHandler<string>? DescriptionUpdated;
/// <inheritdoc />
public event EventHandler<string>? ExtendedDescriptionUpdated;
/// <inheritdoc />
public event EventHandler<bool?>? ForgetMeUpdated;
/// <inheritdoc />
public event EventHandler<bool>? IsUnlistedUpdated;
/// <inheritdoc />
public event EventHandler<IReadOnlyConnection[]>? ConnectionsAdded;
/// <inheritdoc />
public event EventHandler<IReadOnlyConnection[]>? ConnectionsRemoved;
/// <inheritdoc />
public event EventHandler<Link[]>? LinksAdded;
/// <inheritdoc/>
public event EventHandler<Link[]>? LinksRemoved;
/// <inheritdoc />
public event EventHandler<IFile[]>? ImagesAdded;
/// <inheritdoc />
public event EventHandler<IFile[]>? ImagesRemoved;
/// <inheritdoc />
public IAsyncEnumerable<IReadOnlyConnection> GetConnectionsAsync(CancellationToken cancellationToken = default) => InnerConnections.GetConnectionsAsync(cancellationToken);
/// <inheritdoc />
public IAsyncEnumerable<IFile> GetImageFilesAsync(CancellationToken cancellationToken) => InnerImages.GetImageFilesAsync(cancellationToken);
}