-
-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unneeded preprocessor directives.
- Loading branch information
Showing
7 changed files
with
13 additions
and
59 deletions.
There are no files selected for viewing
11 changes: 2 additions & 9 deletions
11
src/DynamicExpresso.Core/Exceptions/AssignmentOperatorDisabledException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,33 @@ | ||
#if !NETSTANDARD1_6 | ||
using System; | ||
using System.Runtime.Serialization; | ||
using System.Security.Permissions; | ||
#endif | ||
|
||
namespace DynamicExpresso.Exceptions | ||
{ | ||
#if !NETSTANDARD1_6 | ||
[Serializable] | ||
#endif | ||
public class AssignmentOperatorDisabledException : ParseException | ||
{ | ||
public AssignmentOperatorDisabledException(string operatorString, int position) | ||
: base(string.Format("Assignment operator '{0}' not allowed", operatorString), position) | ||
: base(string.Format("Assignment operator '{0}' not allowed", operatorString), position) | ||
{ | ||
OperatorString = operatorString; | ||
} | ||
|
||
public string OperatorString { get; private set; } | ||
|
||
#if !NETSTANDARD1_6 | ||
protected AssignmentOperatorDisabledException( | ||
SerializationInfo info, | ||
StreamingContext context) | ||
: base(info, context) | ||
: base(info, context) | ||
{ | ||
OperatorString = info.GetString("OperatorString"); | ||
} | ||
|
||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
info.AddValue("OperatorString", OperatorString); | ||
|
||
base.GetObjectData(info, context); | ||
} | ||
#endif | ||
} | ||
} |
11 changes: 2 additions & 9 deletions
11
src/DynamicExpresso.Core/Exceptions/DuplicateParameterException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
#if !NETSTANDARD1_6 | ||
using System; | ||
using System.Runtime.Serialization; | ||
using System.Security.Permissions; | ||
#endif | ||
|
||
namespace DynamicExpresso.Exceptions | ||
{ | ||
#if !NETSTANDARD1_6 | ||
[Serializable] | ||
#endif | ||
public class DuplicateParameterException : DynamicExpressoException | ||
{ | ||
public DuplicateParameterException(string identifier) | ||
: base(string.Format("The parameter '{0}' was defined more than once", identifier)) | ||
: base(string.Format("The parameter '{0}' was defined more than once", identifier)) | ||
{ | ||
Identifier = identifier; | ||
} | ||
public string Identifier { get; private set; } | ||
|
||
#if !NETSTANDARD1_6 | ||
protected DuplicateParameterException( | ||
SerializationInfo info, | ||
StreamingContext context) | ||
: base(info, context) | ||
: base(info, context) | ||
{ | ||
Identifier = info.GetString("Identifier"); | ||
} | ||
|
||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
info.AddValue("Identifier", Identifier); | ||
|
||
base.GetObjectData(info, context); | ||
} | ||
#endif | ||
} | ||
} |
6 changes: 1 addition & 5 deletions
6
src/DynamicExpresso.Core/Exceptions/DynamicExpressoException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
using System; | ||
using System; | ||
|
||
namespace DynamicExpresso.Exceptions | ||
{ | ||
#if !NETSTANDARD1_6 | ||
[Serializable] | ||
#endif | ||
public class DynamicExpressoException : Exception | ||
{ | ||
public DynamicExpressoException() { } | ||
public DynamicExpressoException(string message) : base(message) { } | ||
public DynamicExpressoException(string message, Exception inner) : base(message, inner) { } | ||
|
||
#if !NETSTANDARD1_6 | ||
protected DynamicExpressoException( | ||
System.Runtime.Serialization.SerializationInfo info, | ||
System.Runtime.Serialization.StreamingContext context) | ||
: base(info, context) { } | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 2 additions & 9 deletions
11
src/DynamicExpresso.Core/Exceptions/ReflectionNotAllowedException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
#if !NETSTANDARD1_6 | ||
using System; | ||
using System.Security.Permissions; | ||
using System.Runtime.Serialization; | ||
#endif | ||
|
||
namespace DynamicExpresso.Exceptions | ||
{ | ||
#if !NETSTANDARD1_6 | ||
[Serializable] | ||
#endif | ||
public class ReflectionNotAllowedException : ParseException | ||
{ | ||
public ReflectionNotAllowedException() | ||
: base("Reflection expression not allowed. To enable reflection use Interpreter.EnableReflection().", 0) | ||
: base("Reflection expression not allowed. To enable reflection use Interpreter.EnableReflection().", 0) | ||
{ | ||
} | ||
|
||
#if !NETSTANDARD1_6 | ||
protected ReflectionNotAllowedException( | ||
SerializationInfo info, | ||
StreamingContext context) | ||
: base(info, context) | ||
: base(info, context) | ||
{ | ||
} | ||
|
||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
#endif | ||
} | ||
} |
11 changes: 2 additions & 9 deletions
11
src/DynamicExpresso.Core/Exceptions/UnknownIdentifierException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,33 @@ | ||
#if !NETSTANDARD1_6 | ||
using System; | ||
using System.Runtime.Serialization; | ||
using System.Security.Permissions; | ||
#endif | ||
|
||
namespace DynamicExpresso.Exceptions | ||
{ | ||
#if !NETSTANDARD1_6 | ||
[Serializable] | ||
#endif | ||
public class UnknownIdentifierException : ParseException | ||
{ | ||
public UnknownIdentifierException(string identifier, int position) | ||
: base(string.Format("Unknown identifier '{0}'", identifier), position) | ||
: base(string.Format("Unknown identifier '{0}'", identifier), position) | ||
{ | ||
Identifier = identifier; | ||
} | ||
|
||
public string Identifier { get; private set; } | ||
|
||
#if !NETSTANDARD1_6 | ||
protected UnknownIdentifierException( | ||
SerializationInfo info, | ||
StreamingContext context) | ||
: base(info, context) | ||
: base(info, context) | ||
{ | ||
Identifier = info.GetString("Identifier"); | ||
} | ||
|
||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] | ||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
info.AddValue("Identifier", Identifier); | ||
|
||
base.GetObjectData(info, context); | ||
} | ||
#endif | ||
} | ||
} |