開発に使用するリポジトリ
修订版 | 26d32919fdc5d5a24404223f26ead7ce87a660bb (tree) |
---|---|
时间 | 2014-07-21 15:27:20 |
作者 | Kimura Youichi <kim.upsilon@bucy...> |
Commiter | Kimura Youichi |
WebApiExceptionをシリアライズに対応できるように修正 (CA2240)
@@ -38,7 +38,6 @@ namespace OpenTween | ||
38 | 38 | public WebApiException() : base() { } |
39 | 39 | public WebApiException(string message) : base(message) { } |
40 | 40 | public WebApiException(string message, Exception innerException) : base(message, innerException) { } |
41 | - protected WebApiException(SerializationInfo info, StreamingContext context) : base(info, context) { } | |
42 | 41 | |
43 | 42 | public WebApiException(string message, string responseText) |
44 | 43 | : this(message) |
@@ -51,5 +50,17 @@ namespace OpenTween | ||
51 | 50 | { |
52 | 51 | this.ResponseText = responseText; |
53 | 52 | } |
53 | + | |
54 | + protected WebApiException(SerializationInfo info, StreamingContext context) | |
55 | + : base(info, context) | |
56 | + { | |
57 | + this.ResponseText = info.GetString("ResponseText"); | |
58 | + } | |
59 | + | |
60 | + public override void GetObjectData(SerializationInfo info, StreamingContext context) | |
61 | + { | |
62 | + base.GetObjectData(info, context); | |
63 | + info.AddValue("ResponseText", this.ResponseText); | |
64 | + } | |
54 | 65 | } |
55 | 66 | } |