File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections . Generic ;
3
3
using System . IO ;
4
4
using System . Linq ;
5
+ using System . Runtime . Serialization ;
5
6
using System . Text ;
6
7
using System . Threading . Tasks ;
7
8
8
9
namespace Ipfs . Api
9
10
{
10
11
/// <inheritdoc />
12
+ [ DataContract ]
11
13
public class Block : IDataBlock
12
14
{
13
15
long ? size ;
14
16
15
17
/// <inheritdoc />
18
+ [ DataMember ]
16
19
public Cid Id { get ; set ; }
17
20
18
21
/// <inheritdoc />
22
+ [ DataMember ]
19
23
public byte [ ] DataBytes { get ; set ; }
20
24
21
25
/// <inheritdoc />
@@ -28,6 +32,7 @@ public Stream DataStream
28
32
}
29
33
30
34
/// <inheritdoc />
35
+ [ DataMember ]
31
36
public long Size
32
37
{
33
38
get
Original file line number Diff line number Diff line change 4
4
using System . Text ;
5
5
using Newtonsoft . Json . Linq ;
6
6
using System . IO ;
7
+ using System . Runtime . Serialization ;
7
8
8
9
namespace Ipfs . Api
9
10
{
@@ -13,6 +14,7 @@ namespace Ipfs.Api
13
14
/// <remarks>
14
15
/// Initially an <b>MerkleNode</b> is just constructed with its Cid.
15
16
/// </remarks>
17
+ [ DataContract ]
16
18
public class MerkleNode : IMerkleNode < IMerkleLink > , IEquatable < MerkleNode >
17
19
{
18
20
bool hasBlockStats ;
@@ -91,11 +93,13 @@ internal IpfsClient IpfsClient
91
93
}
92
94
93
95
/// <inheritdoc />
96
+ [ DataMember ]
94
97
public Cid Id { get ; private set ; }
95
98
96
99
/// <summary>
97
100
/// The name for the node. If unknown it is "" (not null).
98
101
/// </summary>
102
+ [ DataMember ]
99
103
public string Name
100
104
{
101
105
get { return name ; }
@@ -105,6 +109,7 @@ public string Name
105
109
/// <summary>
106
110
/// Size of the raw, encoded node.
107
111
/// </summary>
112
+ [ DataMember ]
108
113
public long BlockSize
109
114
{
110
115
get
@@ -116,6 +121,7 @@ public long BlockSize
116
121
117
122
/// <inheritdoc />
118
123
/// <seealso cref="BlockSize"/>
124
+ [ DataMember ]
119
125
public long Size
120
126
{
121
127
get
@@ -126,6 +132,7 @@ public long Size
126
132
127
133
128
134
/// <inheritdoc />
135
+ [ DataMember ]
129
136
public IEnumerable < IMerkleLink > Links
130
137
{
131
138
get
@@ -140,6 +147,7 @@ public IEnumerable<IMerkleLink> Links
140
147
}
141
148
142
149
/// <inheritdoc />
150
+ [ DataMember ]
143
151
public byte [ ] DataBytes
144
152
{
145
153
get
Original file line number Diff line number Diff line change 4
4
using System . Linq ;
5
5
using System . IO ;
6
6
using System . Text ;
7
+ using System . Runtime . Serialization ;
7
8
8
9
namespace Ipfs . Api
9
10
{
@@ -13,6 +14,7 @@ namespace Ipfs.Api
13
14
/// <remarks>
14
15
/// The <see cref="PubSubApi"/> is used to publish and subsribe to a message.
15
16
/// </remarks>
17
+ [ DataContract ]
16
18
public class PublishedMessage : IPublishedMessage
17
19
{
18
20
/// <summary>
@@ -33,15 +35,19 @@ public PublishedMessage(string json)
33
35
}
34
36
35
37
/// <inheritdoc />
38
+ [ DataMember ]
36
39
public Peer Sender { get ; private set ; }
37
40
38
41
/// <inheritdoc />
42
+ [ DataMember ]
39
43
public IEnumerable < string > Topics { get ; private set ; }
40
44
41
45
/// <inheritdoc />
46
+ [ DataMember ]
42
47
public byte [ ] SequenceNumber { get ; private set ; }
43
48
44
49
/// <inheritdoc />
50
+ [ DataMember ]
45
51
public byte [ ] DataBytes { get ; private set ; }
46
52
47
53
/// <inheritdoc />
@@ -54,6 +60,7 @@ public Stream DataStream
54
60
}
55
61
56
62
/// <inheritdoc />
63
+ [ DataMember ]
57
64
public long Size
58
65
{
59
66
get { return DataBytes . Length ; }
You can’t perform that action at this time.
0 commit comments