示例#1
0
 private static void ReadPropertyValue(EncryptedMessage data, JsonProperty property)
 {
     if (property.NameEquals(EncryptedMessage_EncryptedMessageTextName))
     {
         data.EncryptedMessageText = property.Value.GetString();
     }
     else if (property.NameEquals(nameof(data.EncryptionData)))
     {
         data.EncryptionData = EncryptionDataSerializer.ReadEncryptionData(property.Value);
     }
 }
 private static void ReadPropertyValue(EncryptedMessage data, JsonProperty property)
 {
     if (property.NameEquals(EncryptedMessage_EncryptedMessageTextName))
     {
         data.EncryptedMessageText = property.Value.GetString();
     }
     else if (property.NameEquals(nameof(data.EncryptionData)))
     {
         data.EncryptionData = EncryptionDataSerializer.ReadEncryptionData(property.Value);
     }
     else
     {
         throw new FormatException($"Failed to deserialize `{typeof(EncryptedMessage).FullName}`. Unrecognized property `{property.Name}`.");
     }
 }