Skip to content

Commit 1ea19d5

Browse files
committed
Made an exception serializable and removed another.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 01b4fa4 commit 1ea19d5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/Generator/Generators/CSharp/CSharpSources.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,10 +3291,4 @@ public int GetHashCode(Parameter obj)
32913291
}
32923292
}
32933293
}
3294-
3295-
internal class SymbolNotFoundException : Exception
3296-
{
3297-
public SymbolNotFoundException(string msg) : base(msg)
3298-
{}
3299-
}
33003294
}

src/Generator/Utils/ExpressionEvaluator.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using System.Globalization;
55
using System.Linq;
66
using System.Reflection;
7+
using System.Runtime.Serialization;
8+
using System.Security.Permissions;
79
using System.Text.RegularExpressions;
810

911
/// <summary>
@@ -1345,6 +1347,7 @@ public TResult Func16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T1
13451347
}
13461348
}
13471349

1350+
[Serializable]
13481351
public class ExpressionEvaluatorSyntaxErrorException : Exception
13491352
{
13501353
public ExpressionEvaluatorSyntaxErrorException() : base()
@@ -1354,6 +1357,17 @@ public ExpressionEvaluatorSyntaxErrorException(string message) : base(message)
13541357
{ }
13551358
public ExpressionEvaluatorSyntaxErrorException(string message, Exception innerException) : base(message, innerException)
13561359
{ }
1360+
1361+
protected ExpressionEvaluatorSyntaxErrorException(SerializationInfo info, StreamingContext context)
1362+
: base(info, context)
1363+
{
1364+
}
1365+
1366+
[SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)]
1367+
public override void GetObjectData(SerializationInfo info, StreamingContext context)
1368+
{
1369+
base.GetObjectData(info, context);
1370+
}
13571371
}
13581372

13591373
internal class VariableEvaluationEventArg : EventArgs

0 commit comments

Comments
 (0)