-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRequestEventArgs.cs
53 lines (48 loc) · 1.73 KB
/
RequestEventArgs.cs
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
using System;
namespace HttpServer
{
/// <summary>
/// A request have been received.
/// </summary>
/// <remarks>
/// </remarks>
public class RequestEventArgs : EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="RequestEventArgs"/> class.
/// </summary>
/// <param name="context">context that received the request.</param>
/// <param name="request">Received request.</param>
/// <param name="response">Response to send.</param>
public RequestEventArgs(IHttpContext context, IRequest request, IResponse response)
{
Context = context;
Response = response;
Request = request;
}
/// <summary>
/// Gets context that received the request.
/// </summary>
/// <remarks>
/// Do not forget to set <see cref="IsHandled"/> to <c>true</c> if you are sending
/// back a response manually through <see cref="IHttpContext.Stream"/>.
/// </remarks>
public IHttpContext Context { get; private set; }
/// <summary>
/// Gets or sets if the request have been handled.
/// </summary>
/// <remarks>
/// The library will not attempt to send the response object
/// back to the client if this property is set to <c>true</c>.
/// </remarks>
public bool IsHandled { get; set; }
/// <summary>
/// Gets request object.
/// </summary>
public IRequest Request { get; private set; }
/// <summary>
/// Gets response object.
/// </summary>
public IResponse Response { get; private set; }
}
}