3
3
4
4
namespace MLAPI . Transports . Tasks
5
5
{
6
+ /// <summary>
7
+ /// Represents one or more socket tasks.
8
+ /// </summary>
6
9
public class SocketTasks
7
10
{
11
+ /// <summary>
12
+ /// Gets or sets the underlying SocketTasks.
13
+ /// </summary>
14
+ /// <value>The tasks.</value>
8
15
public SocketTask [ ] Tasks { get ; set ; }
9
16
10
- public bool IsDone
17
+ /// <summary>
18
+ /// Gets a value indicating whether this all tasks is done.
19
+ /// </summary>
20
+ /// <value><c>true</c> if is done; otherwise, <c>false</c>.</value>
21
+ public bool IsDone
11
22
{
12
23
get
13
24
{
@@ -23,6 +34,10 @@ public bool IsDone
23
34
}
24
35
}
25
36
37
+ /// <summary>
38
+ /// Gets a value indicating whether all tasks were sucessful.
39
+ /// </summary>
40
+ /// <value><c>true</c> if success; otherwise, <c>false</c>.</value>
26
41
public bool Success
27
42
{
28
43
get
@@ -39,6 +54,10 @@ public bool Success
39
54
}
40
55
}
41
56
57
+ /// <summary>
58
+ /// Gets a value indicating whether any tasks were successful.
59
+ /// </summary>
60
+ /// <value><c>true</c> if any success; otherwise, <c>false</c>.</value>
42
61
public bool AnySuccess
43
62
{
44
63
get
@@ -55,6 +74,10 @@ public bool AnySuccess
55
74
}
56
75
}
57
76
77
+ /// <summary>
78
+ /// Gets a value indicating whether any tasks are done.
79
+ /// </summary>
80
+ /// <value><c>true</c> if any done; otherwise, <c>false</c>.</value>
58
81
public bool AnyDone
59
82
{
60
83
get
@@ -72,19 +95,54 @@ public bool AnyDone
72
95
}
73
96
}
74
97
98
+ /// <summary>
99
+ /// A single socket task.
100
+ /// </summary>
75
101
public class SocketTask
76
102
{
77
103
// Used for states
104
+ /// <summary>
105
+ /// Gets or sets a value indicating whether this <see cref="T:MLAPI.Transports.Tasks.SocketTask"/> is done.
106
+ /// </summary>
107
+ /// <value><c>true</c> if is done; otherwise, <c>false</c>.</value>
78
108
public bool IsDone { get ; set ; }
109
+ /// <summary>
110
+ /// Gets or sets a value indicating whether this <see cref="T:MLAPI.Transports.Tasks.SocketTask"/> is success.
111
+ /// </summary>
112
+ /// <value><c>true</c> if success; otherwise, <c>false</c>.</value>
79
113
public bool Success { get ; set ; }
80
114
81
115
// These are all set by the transport
116
+ /// <summary>
117
+ /// Gets or sets the transport exception.
118
+ /// </summary>
119
+ /// <value>The transport exception.</value>
82
120
public Exception TransportException { get ; set ; }
121
+ /// <summary>
122
+ /// Gets or sets the socket error.
123
+ /// </summary>
124
+ /// <value>The socket error.</value>
83
125
public SocketError SocketError { get ; set ; }
126
+ /// <summary>
127
+ /// Gets or sets the transport code.
128
+ /// </summary>
129
+ /// <value>The transport code.</value>
84
130
public int TransportCode { get ; set ; }
131
+ /// <summary>
132
+ /// Gets or sets the message.
133
+ /// </summary>
134
+ /// <value>The message.</value>
85
135
public string Message { get ; set ; }
136
+ /// <summary>
137
+ /// Gets or sets the state.
138
+ /// </summary>
139
+ /// <value>The state.</value>
86
140
public object State { get ; set ; }
87
141
142
+ /// <summary>
143
+ /// Gets a done task.
144
+ /// </summary>
145
+ /// <value>The done.</value>
88
146
public static SocketTask Done => new SocketTask ( )
89
147
{
90
148
IsDone = true ,
@@ -96,6 +154,10 @@ public class SocketTask
96
154
TransportException = null
97
155
} ;
98
156
157
+ /// <summary>
158
+ /// Gets a faulty task.
159
+ /// </summary>
160
+ /// <value>The fault.</value>
99
161
public static SocketTask Fault => new SocketTask ( )
100
162
{
101
163
IsDone = true ,
@@ -107,6 +169,10 @@ public class SocketTask
107
169
TransportException = null
108
170
} ;
109
171
172
+ /// <summary>
173
+ /// Gets a working task.
174
+ /// </summary>
175
+ /// <value>The working.</value>
110
176
public static SocketTask Working => new SocketTask ( )
111
177
{
112
178
IsDone = false ,
@@ -118,6 +184,10 @@ public class SocketTask
118
184
TransportException = null
119
185
} ;
120
186
187
+ /// <summary>
188
+ /// Converts to a SocketTasks.
189
+ /// </summary>
190
+ /// <returns>The tasks.</returns>
121
191
public SocketTasks AsTasks ( )
122
192
{
123
193
return new SocketTasks ( )
0 commit comments