本文整理汇总了C#中JsonObject.put方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.put方法的具体用法?C# JsonObject.put怎么用?C# JsonObject.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonObject
的用法示例。
在下文中一共展示了JsonObject.put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToJsonObject
public virtual JsonObject ToJsonObject()
{
JsonObject answer = new JsonObject();
answer.put("localRealm", _localRealm);
return answer;
}
示例2: ToJsonObject
public static JsonObject ToJsonObject(BaseException baseException)
{
JsonObject answer = new JsonObject();
answer.put("errorDomain", baseException.ErrorDomain); // null is ok
answer.put("faultCode", baseException.FaultCode);
answer.put("faultMessage", baseException.Message);
answer.put("underlyingFaultMessage", baseException.UnderlyingFaultMessage);
answer.put("originator", baseException.getOriginator());
JsonArray jsonStackTrace;
{
jsonStackTrace = new JsonArray();
String[] stackTrace = ExceptionHelper.getStackTrace(baseException, true);
for (int i = 0, count = stackTrace.Length; i < count; i++)
{
jsonStackTrace.Add(stackTrace[i]);
}
stackTrace = ExceptionHelper.getStackTrace(baseException, false);
for (int i = 0, count = stackTrace.Length; i < count; i++)
{
jsonStackTrace.Add(stackTrace[i]);
}
}
answer.put("stackTrace", jsonStackTrace);
JsonObject faultContext = new JsonObject();
answer.put("faultContext", faultContext);
return answer;
}
示例3: toJsonObject
public JsonObject toJsonObject()
{
JsonObject answer = new JsonObject();
answer.put("identifier", _identifier);
JsonArray subjects = new JsonArray();
foreach (KeyValuePair<String, Subject> kvp in _clients)
{
Subject client = kvp.Value;
JsonObject subjectData = new JsonObject();
subjectData.put("identifier", client.Username);
subjectData.put("password", client.Password);
subjectData.put("label", client.Label);
subjects.Add(subjectData);
}
answer.put("subjects", subjects);
return answer;
}