Skip to content

Commit

Permalink
#749 - Remove the obsolete serialization APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sys27 committed Dec 10, 2023
1 parent e2fd897 commit 2a976ce
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Globalization;
using System.Runtime.Serialization;

namespace xFunc.Maths.Analyzers.TypeAnalyzers;

Expand Down Expand Up @@ -79,14 +78,4 @@ public BinaryParameterTypeMismatchException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="BinaryParameterTypeMismatchException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected BinaryParameterTypeMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Globalization;
using System.Runtime.Serialization;

namespace xFunc.Maths.Analyzers.TypeAnalyzers;

Expand Down Expand Up @@ -48,14 +47,4 @@ public DifferentParameterTypeMismatchException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="DifferentParameterTypeMismatchException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected DifferentParameterTypeMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Globalization;
using System.Runtime.Serialization;

namespace xFunc.Maths.Analyzers.TypeAnalyzers;

Expand Down Expand Up @@ -64,16 +63,6 @@ public ParameterTypeMismatchException(string message, Exception inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ParameterTypeMismatchException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected ParameterTypeMismatchException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Gets the expected parameter type.
/// </summary>
Expand Down
14 changes: 7 additions & 7 deletions xFunc.Maths/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Builder Add(IExpression summand)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Add(double summand)
=> Add((IExpression)new Number(summand));
=> Add(new Number(summand));

/// <summary>
/// Creates the <seealso cref="Expressions.Add"/> operation. The Current state is used as summand.
Expand Down Expand Up @@ -109,7 +109,7 @@ public Builder Div(IExpression denominator)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Div(double denominator)
=> Div((IExpression)new Number(denominator));
=> Div(new Number(denominator));

/// <summary>
/// Creates the <seealso cref="Expressions.Div"/> operation. The Current state is used as numerator.
Expand Down Expand Up @@ -152,7 +152,7 @@ public Builder Mul(IExpression factor)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Mul(double factor)
=> Mul((IExpression)new Number(factor));
=> Mul(new Number(factor));

/// <summary>
/// Creates the <seealso cref="Expressions.Mul"/> operation. The Current state is used as factor.
Expand Down Expand Up @@ -183,7 +183,7 @@ public Builder Log(IExpression @base)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Log(double @base)
=> Log((IExpression)new Number(@base));
=> Log(new Number(@base));

/// <summary>
/// Creates the <seealso cref="Expressions.Log"/> operation. The Current state is used as argument.
Expand Down Expand Up @@ -250,7 +250,7 @@ public Builder Pow(IExpression exponent)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Pow(double exponent)
=> Pow((IExpression)new Number(exponent));
=> Pow(new Number(exponent));

/// <summary>
/// Creates the <seealso cref="Expressions.Pow"/> operation. The Current state is used as base of power.
Expand Down Expand Up @@ -281,7 +281,7 @@ public Builder Root(IExpression degree)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Root(double degree)
=> Root((IExpression)new Number(degree));
=> Root(new Number(degree));

/// <summary>
/// Creates the <seealso cref="Expressions.Root"/> operation. The Current state is used as radicand.
Expand Down Expand Up @@ -324,7 +324,7 @@ public Builder Sub(IExpression subtrahend)
/// <returns>The builder.</returns>
/// <exception cref="ArgumentNullException">The Current builder is empty.</exception>
public Builder Sub(double subtrahend)
=> Sub((IExpression)new Number(subtrahend));
=> Sub(new Number(subtrahend));

/// <summary>
/// Creates the <seealso cref="Expressions.Sub"/> operation. The Current state is used as minuend.
Expand Down
11 changes: 0 additions & 11 deletions xFunc.Maths/Expressions/ExecutionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;

namespace xFunc.Maths.Expressions;

Expand Down Expand Up @@ -40,16 +39,6 @@ public ExecutionException(string message, Exception inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ExecutionException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected ExecutionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Creates an instance of <see cref="ExecutionException"/> with the message of unsupported result.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions xFunc.Maths/Expressions/Matrices/InvalidMatrixException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths.Expressions.Matrices;

/// <summary>
Expand Down Expand Up @@ -36,14 +34,4 @@ public InvalidMatrixException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="InvalidMatrixException"/> class.
/// </summary>
/// <param name="info">The object that holds the serialized object data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
protected InvalidMatrixException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
12 changes: 0 additions & 12 deletions xFunc.Maths/Expressions/Parameters/ParameterIsReadOnlyException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths.Expressions.Parameters;

/// <summary>
Expand Down Expand Up @@ -60,16 +58,6 @@ public ParameterIsReadOnlyException(string message, string parameterName, Except
ParameterName = parameterName;
}

/// <summary>
/// Initializes a new instance of the <see cref="ParameterIsReadOnlyException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected ParameterIsReadOnlyException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Gets the parameter name.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions xFunc.Maths/Expressions/Units/UnitIsNotSupportedException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths.Expressions.Units;

/// <summary>
Expand Down Expand Up @@ -31,16 +29,6 @@ public UnitIsNotSupportedException(string? unit, Exception? inner)
Unit = unit;
}

/// <summary>
/// Initializes a new instance of the <see cref="UnitIsNotSupportedException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected UnitIsNotSupportedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Gets the unsupported unit.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions xFunc.Maths/Expressions/Units/ValueIsNotSupportedException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths.Expressions.Units;

/// <summary>
Expand Down Expand Up @@ -31,16 +29,6 @@ public ValueIsNotSupportedException(object value, Exception? inner)
Value = value;
}

/// <summary>
/// Initializes a new instance of the <see cref="ValueIsNotSupportedException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected ValueIsNotSupportedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Gets a value to converts.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions xFunc.Maths/InvalidResultException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths;

/// <summary>
Expand Down Expand Up @@ -36,14 +34,4 @@ public InvalidResultException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="InvalidResultException"/> class.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext" /> that contains contextual information about the source or destination.</param>
protected InvalidResultException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
12 changes: 0 additions & 12 deletions xFunc.Maths/ParseException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Runtime.Serialization;

namespace xFunc.Maths;

/// <summary>
Expand Down Expand Up @@ -36,14 +34,4 @@ public ParseException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ParseException"/> class with serialized data.
/// </summary>
/// <param name="info">The object that holds the serialized object data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
protected ParseException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
11 changes: 0 additions & 11 deletions xFunc.Maths/TokenizeException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.Serialization;

namespace xFunc.Maths;

Expand Down Expand Up @@ -49,14 +48,4 @@ public TokenizeException(string message, Exception inner)
: base(message, inner)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="TokenizeException"/> class with serialized data.
/// </summary>
/// <param name="info">The object that holds the serialized object data.</param>
/// <param name="context">The contextual information about the source or destination.</param>
protected TokenizeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
2 changes: 1 addition & 1 deletion xFunc.Maths/xFunc.Maths.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<RootNamespace>xFunc.Maths</RootNamespace>
<PackageId>xFunc.Maths</PackageId>
Expand Down

0 comments on commit 2a976ce

Please sign in to comment.