From aa971b484c6d8b068a7584605ef012c470af5946 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Fri, 18 Jun 2010 11:59:30 +0200 Subject: [PATCH] simplify silverlight support for the Serializable attribute --- src/Numerics/Complex32.cs | 2 -- src/Numerics/LinearAlgebra/Double/Matrix.cs | 2 -- src/Numerics/LinearAlgebra/Double/Vector.cs | 2 -- src/Numerics/Permutation.cs | 2 -- src/Numerics/Statistics/Histogram.cs | 4 ---- src/Silverlight/SerializableAttribute.cs | 9 +++++++++ src/Silverlight/Silverlight.csproj | 1 + 7 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 src/Silverlight/SerializableAttribute.cs diff --git a/src/Numerics/Complex32.cs b/src/Numerics/Complex32.cs index c9ec34b0..a2eb05d4 100644 --- a/src/Numerics/Complex32.cs +++ b/src/Numerics/Complex32.cs @@ -71,9 +71,7 @@ namespace MathNet.Numerics /// Wikipedia /// /// -#if !SILVERLIGHT [Serializable] -#endif [StructLayout(LayoutKind.Sequential)] public struct Complex32 : IFormattable, IEquatable, IPrecisionSupport { diff --git a/src/Numerics/LinearAlgebra/Double/Matrix.cs b/src/Numerics/LinearAlgebra/Double/Matrix.cs index 937787ef..15512d4f 100644 --- a/src/Numerics/LinearAlgebra/Double/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Double/Matrix.cs @@ -35,9 +35,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// Defines the base class for Matrix classes. /// -#if !SILVERLIGHT [Serializable] -#endif public abstract partial class Matrix : #if SILVERLIGHT IFormattable, IEquatable diff --git a/src/Numerics/LinearAlgebra/Double/Vector.cs b/src/Numerics/LinearAlgebra/Double/Vector.cs index b87d40fd..60068cf5 100644 --- a/src/Numerics/LinearAlgebra/Double/Vector.cs +++ b/src/Numerics/LinearAlgebra/Double/Vector.cs @@ -37,9 +37,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// /// Defines the base class for Vector classes. /// -#if !SILVERLIGHT [Serializable] -#endif public abstract class Vector : #if SILVERLIGHT IFormattable, IEnumerable, IEquatable diff --git a/src/Numerics/Permutation.cs b/src/Numerics/Permutation.cs index 598e46aa..976f2f8e 100644 --- a/src/Numerics/Permutation.cs +++ b/src/Numerics/Permutation.cs @@ -41,9 +41,7 @@ namespace MathNet.Numerics /// /// Class to represent a permutation for a subset of the natural numbers. /// -#if !SILVERLIGHT [Serializable] -#endif public class Permutation { #region fields diff --git a/src/Numerics/Statistics/Histogram.cs b/src/Numerics/Statistics/Histogram.cs index 7e750356..f567310c 100644 --- a/src/Numerics/Statistics/Histogram.cs +++ b/src/Numerics/Statistics/Histogram.cs @@ -39,9 +39,7 @@ namespace MathNet.Numerics.Statistics /// A consists of a series of s, /// each representing a region limited by a lower bound (exclusive) and an upper bound (inclusive). /// -#if !SILVERLIGHT [Serializable] -#endif public class Bucket : #if SILVERLIGHT IComparable @@ -225,9 +223,7 @@ namespace MathNet.Numerics.Statistics /// /// A class which computes histograms of data. /// -#if !SILVERLIGHT [Serializable] -#endif public class Histogram { /// diff --git a/src/Silverlight/SerializableAttribute.cs b/src/Silverlight/SerializableAttribute.cs new file mode 100644 index 00000000..3cab6ee9 --- /dev/null +++ b/src/Silverlight/SerializableAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace MathNet.Numerics +{ + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] + public class SerializableAttribute : Attribute + { + } +} diff --git a/src/Silverlight/Silverlight.csproj b/src/Silverlight/Silverlight.csproj index 169b6e65..55d984be 100644 --- a/src/Silverlight/Silverlight.csproj +++ b/src/Silverlight/Silverlight.csproj @@ -360,6 +360,7 @@ Version.tt +