OSDN Git Service

Exceptionの派生クラスに必要なコンストラクタを追加 (CA1032)
authorKimura Youichi <kim.upsilon@bucyou.net>
Fri, 11 Jul 2014 15:50:38 +0000 (00:50 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Mon, 21 Jul 2014 06:26:29 +0000 (15:26 +0900)
http://msdn.microsoft.com/ja-jp/library/ms182151.aspx

OpenTween/MemoryImage.cs
OpenTween/TabException.cs
OpenTween/WebApiException.cs

index 6e142ab..52fd8e8 100644 (file)
@@ -194,11 +194,12 @@ namespace OpenTween
     /// <summary>
     /// 不正な画像データに対してスローされる例外
     /// </summary>
+    [Serializable]
     public class InvalidImageException : Exception
     {
         public InvalidImageException() : base() { }
         public InvalidImageException(string message) : base(message) { }
         public InvalidImageException(string message, Exception innerException) : base(message, innerException) { }
-        public InvalidImageException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+        protected InvalidImageException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index 46c62e0..3344b4e 100644 (file)
@@ -22,6 +22,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Serialization;
 using System.Text;
 
 namespace OpenTween
@@ -29,10 +30,12 @@ namespace OpenTween
     /// <summary>
     /// タブの操作時に問題が発生した場合にスローされる例外
     /// </summary>
+    [Serializable]
     public class TabException : Exception
     {
         public TabException() : base() { }
         public TabException(string message) : base(message) { }
         public TabException(string message, Exception innerException) : base(message, innerException) { }
+        protected TabException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index 4874446..27421a8 100644 (file)
@@ -22,6 +22,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Serialization;
 using System.Text;
 
 namespace OpenTween
@@ -29,6 +30,7 @@ namespace OpenTween
     /// <summary>
     /// Twitter などの API 実行時に発生した例外を扱うクラス
     /// </summary>
+    [Serializable]
     public class WebApiException : Exception
     {
         public readonly string ResponseText = null;
@@ -36,6 +38,7 @@ namespace OpenTween
         public WebApiException() : base() { }
         public WebApiException(string message) : base(message) { }
         public WebApiException(string message, Exception innerException) : base(message, innerException) { }
+        protected WebApiException(SerializationInfo info, StreamingContext context) : base(info, context) { }
 
         public WebApiException(string message, string responseText)
             : this(message)