本文整理汇总了C#中JsonObject.GetUnescaped方法的典型用法代码示例。如果您正苦于以下问题:C# JsonObject.GetUnescaped方法的具体用法?C# JsonObject.GetUnescaped怎么用?C# JsonObject.GetUnescaped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonObject
的用法示例。
在下文中一共展示了JsonObject.GetUnescaped方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleChannelCreatedMessage
private void HandleChannelCreatedMessage(JsonObject raw)
{
var channel = raw.GetUnescaped("channel").FromJson<Channel>();
Logger.DebugFormat("Channel {0}({1}) created", channel.Id, channel.Name);
AddRoom(channel);
}
示例2: HandleChannelRenameMessage
private void HandleChannelRenameMessage(JsonObject raw)
{
var channel = raw.GetUnescaped("channel").FromJson<Channel>();
var oldChannel = _rooms.FirstOrDefault(c => StringComparer.InvariantCultureIgnoreCase.Equals(c.Id, channel.Id));
if (oldChannel == null)
{
return;
}
var oldName = oldChannel.Name;
Logger.DebugFormat("Channel {0} renamed from {1} to {2}", channel.Id, oldName, channel.Name);
if (!string.IsNullOrEmpty(oldName))
{
RemoveRoom(oldChannel);
}
AddRoom(channel);
}
示例3: HandleTeamJoinMessage
private void HandleTeamJoinMessage(JsonObject raw)
{
var newUser = raw.GetUnescaped("user").FromJson<User>();
Logger.DebugFormat("User {0}({1} joined the team", newUser.Id, newUser.Name);
if (!newUser.IsBot)
{
_users.Add(newUser);
}
}