-
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unneeded NETSTANDARD1_6 compiler directives and unneeded usings (
#317) * Remove unneeded preprocessor directives. * Remove unnecessary usings
- Loading branch information
Showing
10 changed files
with
25 additions
and
83 deletions.
There are no files selected for viewing
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,19 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace DynamicExpresso | ||
{ | ||
/// <summary> | ||
/// Setting the default number types when no suffix is specified | ||
/// </summary> | ||
public enum DefaultNumberType | ||
{ | ||
Default = 0, //(Int by default or Double if real number) | ||
Int = 1, | ||
Long = 2, | ||
Single = 3, | ||
Double = 4, | ||
Decimal = 5 | ||
} | ||
/// <summary> | ||
/// Setting the default number types when no suffix is specified | ||
/// </summary> | ||
public enum DefaultNumberType | ||
{ | ||
Default = 0, //(Int by default or Double if real number) | ||
Int = 1, | ||
Long = 2, | ||
Single = 3, | ||
Double = 4, | ||
Decimal = 5 | ||
} | ||
} |
12 changes: 2 additions & 10 deletions
12
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,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 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 | ||
} | ||
} |
12 changes: 2 additions & 10 deletions
12
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,31 @@ | ||
#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
12 changes: 2 additions & 10 deletions
12
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,26 @@ | ||
#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 | ||
} | ||
} |
12 changes: 2 additions & 10 deletions
12
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,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 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 | ||
} | ||
} |
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