Remove obsolete Rest event.
This commit is contained in:
parent
3e6cc78a2c
commit
656c9afdb2
1 changed files with 0 additions and 27 deletions
|
|
@ -250,30 +250,6 @@ namespace Rests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Event
|
|
||||||
[Obsolete("This class will be removed in the next release")]
|
|
||||||
public class RestRequestEventArgs : HandledEventArgs
|
|
||||||
{
|
|
||||||
public RequestEventArgs Request { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete("This method will be removed in the next release")]
|
|
||||||
public static HandlerList<RestRequestEventArgs> RestRequestEvent = new HandlerList<RestRequestEventArgs>();
|
|
||||||
|
|
||||||
private static bool OnRestRequestCall(RequestEventArgs request)
|
|
||||||
{
|
|
||||||
if (RestRequestEvent == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var args = new RestRequestEventArgs
|
|
||||||
{
|
|
||||||
Request = request,
|
|
||||||
};
|
|
||||||
RestRequestEvent.Invoke(null, args);
|
|
||||||
return args.Handled;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the <see cref="HttpListener"/> receives a request
|
/// Called when the <see cref="HttpListener"/> receives a request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -285,9 +261,6 @@ namespace Rests
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
throw new NullReferenceException("obj");
|
throw new NullReferenceException("obj");
|
||||||
|
|
||||||
if (OnRestRequestCall(e))
|
|
||||||
return;
|
|
||||||
|
|
||||||
var str = JsonConvert.SerializeObject(obj, Formatting.Indented);
|
var str = JsonConvert.SerializeObject(obj, Formatting.Indented);
|
||||||
var jsonp = e.Request.Parameters["jsonp"];
|
var jsonp = e.Request.Parameters["jsonp"];
|
||||||
if (!string.IsNullOrWhiteSpace(jsonp))
|
if (!string.IsNullOrWhiteSpace(jsonp))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue