Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
44 lines (39 loc) · 1.33 KB

File metadata and controls

44 lines (39 loc) · 1.33 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AustinHarris.JsonRpc
{
/// <summary>
/// Provides access to a context specific to each JsonRpc method invocation.
/// This is a convienence class that wraps calls to Context specific methods on AustinHarris.JsonRpc.Handler
/// </summary>
public class JsonRpcContext
{
private JsonRpcContext(object value)
{
Value = value;
}
/// <summary>
/// The data associated with this context.
/// </summary>
public object Value { get; private set; }
/// <summary>
/// Allows you to set the exception used in in the JsonRpc response.
/// Warning: Must be called from within the execution context of the jsonRpc method to function.
/// </summary>
/// <param name="exception"></param>
public static void SetException(JsonRpcException exception)
{
Handler.RpcSetException(exception);
}
/// <summary>
/// Must be called from within the execution context of the jsonRpc Method to return the context
/// </summary>
/// <returns></returns>
public static JsonRpcContext Current()
{
return new JsonRpcContext(Handler.RpcContext());
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.