TranslationError.cs 585 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.IO;
  3. namespace XUnity.AutoTranslator.Plugin.ExtProtocol
  4. {
  5. public class TranslationError : ProtocolMessage
  6. {
  7. public static readonly string Type = "3";
  8. public Guid Id { get; set; }
  9. public string Reason { get; set; }
  10. internal override void Decode( TextReader reader )
  11. {
  12. Id = new Guid( reader.ReadLine() );
  13. Reason = reader.ReadToEnd();
  14. }
  15. internal override void Encode( TextWriter writer )
  16. {
  17. writer.WriteLine( Id.ToString() );
  18. writer.Write( Reason );
  19. }
  20. }
  21. }