33
44namespace MLAPI . Transports . Tasks
55{
6+ /// <summary>
7+ /// Represents one or more socket tasks.
8+ /// </summary>
69 public class SocketTasks
710 {
11+ /// <summary>
12+ /// Gets or sets the underlying SocketTasks.
13+ /// </summary>
14+ /// <value>The tasks.</value>
815 public SocketTask [ ] Tasks { get ; set ; }
916
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
1122 {
1223 get
1324 {
@@ -23,6 +34,10 @@ public bool IsDone
2334 }
2435 }
2536
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>
2641 public bool Success
2742 {
2843 get
@@ -39,6 +54,10 @@ public bool Success
3954 }
4055 }
4156
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>
4261 public bool AnySuccess
4362 {
4463 get
@@ -55,6 +74,10 @@ public bool AnySuccess
5574 }
5675 }
5776
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>
5881 public bool AnyDone
5982 {
6083 get
@@ -72,19 +95,54 @@ public bool AnyDone
7295 }
7396 }
7497
98+ /// <summary>
99+ /// A single socket task.
100+ /// </summary>
75101 public class SocketTask
76102 {
77103 // 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>
78108 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>
79113 public bool Success { get ; set ; }
80114
81115 // These are all set by the transport
116+ /// <summary>
117+ /// Gets or sets the transport exception.
118+ /// </summary>
119+ /// <value>The transport exception.</value>
82120 public Exception TransportException { get ; set ; }
121+ /// <summary>
122+ /// Gets or sets the socket error.
123+ /// </summary>
124+ /// <value>The socket error.</value>
83125 public SocketError SocketError { get ; set ; }
126+ /// <summary>
127+ /// Gets or sets the transport code.
128+ /// </summary>
129+ /// <value>The transport code.</value>
84130 public int TransportCode { get ; set ; }
131+ /// <summary>
132+ /// Gets or sets the message.
133+ /// </summary>
134+ /// <value>The message.</value>
85135 public string Message { get ; set ; }
136+ /// <summary>
137+ /// Gets or sets the state.
138+ /// </summary>
139+ /// <value>The state.</value>
86140 public object State { get ; set ; }
87141
142+ /// <summary>
143+ /// Gets a done task.
144+ /// </summary>
145+ /// <value>The done.</value>
88146 public static SocketTask Done => new SocketTask ( )
89147 {
90148 IsDone = true ,
@@ -96,6 +154,10 @@ public class SocketTask
96154 TransportException = null
97155 } ;
98156
157+ /// <summary>
158+ /// Gets a faulty task.
159+ /// </summary>
160+ /// <value>The fault.</value>
99161 public static SocketTask Fault => new SocketTask ( )
100162 {
101163 IsDone = true ,
@@ -107,6 +169,10 @@ public class SocketTask
107169 TransportException = null
108170 } ;
109171
172+ /// <summary>
173+ /// Gets a working task.
174+ /// </summary>
175+ /// <value>The working.</value>
110176 public static SocketTask Working => new SocketTask ( )
111177 {
112178 IsDone = false ,
@@ -118,6 +184,10 @@ public class SocketTask
118184 TransportException = null
119185 } ;
120186
187+ /// <summary>
188+ /// Converts to a SocketTasks.
189+ /// </summary>
190+ /// <returns>The tasks.</returns>
121191 public SocketTasks AsTasks ( )
122192 {
123193 return new SocketTasks ( )
0 commit comments