2007-01-16 Marek Sieradzki <marek.sieradzki@gmail.com>
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / InternalLoggerException.cs
index d12cc389573875985b74333e09f5b06ffc405c91..e1b3933a0c12d8bbc0b404cb11b4ebe9bd1ee249 100644 (file)
@@ -29,6 +29,7 @@
 
 using System;
 using System.Runtime.Serialization;
+using System.Security.Permissions;
 using Microsoft.Build.Framework;
 
 namespace Microsoft.Build.BuildEngine {
@@ -41,7 +42,7 @@ namespace Microsoft.Build.BuildEngine {
                
                public InternalLoggerException ()
                {
-                       throw new System.InvalidOperationException(
+                       throw new System.InvalidOperationException (
                                "An InternalLoggerException can only be thrown by the MSBuild engine. " +
                                "The public constructors of this class cannot be used to create an " +
                                "instance of the exception.");
@@ -57,14 +58,16 @@ namespace Microsoft.Build.BuildEngine {
                {
                }
 
-               protected InternalLoggerException (SerializationInfo info, StreamingContext context)
+               // FIXME: I made it private temporarily, later we can change it to internal (but not protected)
+               private InternalLoggerException (SerializationInfo info, StreamingContext context)
                        : base (info, context)
                {
-                       buildEventArgs = (BuildEventArgs) info.GetValue("BuildEventArgs", typeof(BuildEventArgs));
-                       errorCode = info.GetString("ErrorCode");
-                       helpKeyword = info.GetString("HelpKeywordPrefix");
+                       buildEventArgs = (BuildEventArgs) info.GetValue ("BuildEventArgs", typeof (BuildEventArgs));
+                       errorCode = info.GetString ("ErrorCode");
+                       helpKeyword = info.GetString ("HelpKeywordPrefix");
                }
 
+               [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
                public override void GetObjectData (SerializationInfo info,
                                                    StreamingContext context)
                {