Fix serialization of custom exceptions.

This commit is contained in:
RoosterDragon
2015-12-29 20:11:39 +00:00
parent b5f24c3fa6
commit 5f13fa0343
3 changed files with 18 additions and 0 deletions

View File

@@ -11,9 +11,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
namespace OpenRA.Utility
{
[Serializable]
public class NoSuchCommandException : Exception
{
public readonly string Command;
@@ -22,6 +24,12 @@ namespace OpenRA.Utility
{
Command = command;
}
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("Command", Command);
}
}
class Program