Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Sep 3, 2016
1 parent 154f9ca commit 898da04
Show file tree
Hide file tree
Showing 186 changed files with 876 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace System.Net.NetworkInformation
/// Provides NetworkInformation exceptions to the application.
/// </para>
/// </devdoc>
[Serializable]
public class NetworkInformationException : Win32Exception
{
/// <devdoc>
Expand Down Expand Up @@ -41,6 +42,10 @@ internal NetworkInformationException(string message) : base(message)
{
}

protected NetworkInformationException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
{
}

/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.CSharp/ref/Microsoft.CSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,20 @@ public enum CSharpBinderFlags
ResultIndexed = 64,
ValueFromCompoundAssignment = 128,
}
[System.Serializable]
public partial class RuntimeBinderException : System.Exception
{
public RuntimeBinderException() { }
public RuntimeBinderException(string message) { }
public RuntimeBinderException(string message, System.Exception innerException) { }
protected RuntimeBinderException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
}
[System.Serializable]
public partial class RuntimeBinderInternalCompilerException : System.Exception
{
public RuntimeBinderInternalCompilerException() { }
public RuntimeBinderInternalCompilerException(string message) { }
public RuntimeBinderInternalCompilerException(string message, System.Exception innerException) { }
protected RuntimeBinderInternalCompilerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
}
}
6 changes: 3 additions & 3 deletions src/Microsoft.CSharp/ref/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"dependencies": {
"System.Runtime": "4.0.0",
"System.Runtime": "4.2.0-beta-devapi-24424-01",
"System.Dynamic.Runtime": "4.0.0",
"System.Linq.Expressions": "4.0.0"
},
"frameworks": {
"netstandard1.0": {
"netstandard1.7": {
"imports": [
"dotnet5.1"
"dotnet5.8"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.Serialization;

namespace Microsoft.CSharp.RuntimeBinder
{
Expand All @@ -11,6 +12,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// <see cref="RuntimeBinderException"/> represents a failure to bind in the sense of a usual compiler error, whereas <see cref="RuntimeBinderInternalCompilerException"/>
/// represents a malfunctioning of the runtime binder itself.
/// </summary>
[Serializable]
public class RuntimeBinderException : Exception
{
/// <summary>
Expand Down Expand Up @@ -40,5 +42,9 @@ public RuntimeBinderException(string message, Exception innerException)
: base(message, innerException)
{
}

protected RuntimeBinderException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.Serialization;

namespace Microsoft.CSharp.RuntimeBinder
{
Expand All @@ -11,6 +12,7 @@ namespace Microsoft.CSharp.RuntimeBinder
/// <see cref="RuntimeBinderException"/> represents a failure to bind in the sense of a usual compiler error, whereas <see cref="RuntimeBinderInternalCompilerException"/>
/// represents a malfunctioning of the runtime binder itself.
/// </summary>
[Serializable]
public class RuntimeBinderInternalCompilerException : Exception
{
/// <summary>
Expand Down Expand Up @@ -40,5 +42,9 @@ public RuntimeBinderInternalCompilerException(string message, Exception innerExc
: base(message, innerException)
{
}

protected RuntimeBinderInternalCompilerException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
8 changes: 4 additions & 4 deletions src/Microsoft.CSharp/src/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"System.Diagnostics.Debug": "4.0.10",
"System.Diagnostics.Tools": "4.0.0",
"System.Dynamic.Runtime": "4.0.0",
"System.Globalization": "4.0.10",
"System.Globalization": "4.0.12-beta-devapi-24424-01",
"System.Linq": "4.0.0",
"System.Linq.Expressions": "4.0.0",
"System.ObjectModel": "4.0.10",
Expand All @@ -14,16 +14,16 @@
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Resources.ResourceManager": "4.0.0",
"System.Runtime": "4.0.20",
"System.Runtime": "4.2.0-beta-devapi-24424-01",
"System.Runtime.Extensions": "4.0.10",
"System.Runtime.InteropServices": "4.0.20",
"System.Threading": "4.0.10",
"System.Threading.Tasks": "4.0.10"
},
"frameworks": {
"netstandard1.3": {
"netstandard1.7": {
"imports": [
"dotnet5.4"
"dotnet5.8"
]
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/Microsoft.CSharp/tests/Microsoft.CSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
<ProjectGuid>{82B54697-0251-47A1-8546-FC507D0F3B08}</ProjectGuid>
<AssemblyName>Microsoft.CSharp.Tests</AssemblyName>
<RootNamespace>Microsoft.CSharp.Tests</RootNamespace>
<NugetTargetMoniker>.NETStandard,Version=v1.3</NugetTargetMoniker>
<NugetTargetMoniker>.NETStandard,Version=v1.7</NugetTargetMoniker>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<Compile Include="CSharpArgumentInfoTests.cs" />
<Compile Include="BinarySerializationTests.cs" />
<Compile Include="$(CommonTestPath)\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs">
<Link>Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\pkg\Microsoft.CSharp.pkgproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@

namespace System.ComponentModel
{
[Serializable]
public partial class Win32Exception : System.Exception
{
public Win32Exception() { }
public Win32Exception(int error) { }
public Win32Exception(int error, string message) { }
public Win32Exception(string message) { }
public Win32Exception(string message, System.Exception innerException) { }
protected Win32Exception(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
public int NativeErrorCode { get { return default(int); } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;

namespace System.ComponentModel
{
/// <devdoc>
/// <para>The exception that is thrown for a Win32 error code.</para>
/// </devdoc>
public partial class Win32Exception : Exception
[Serializable]
public partial class Win32Exception : Exception, ISerializable
{
/// <devdoc>
/// <para>Represents the Win32 error code associated with this exception. This
Expand Down Expand Up @@ -68,6 +70,22 @@ public Win32Exception(string message, Exception innerException) : base(message,
HResult = E_FAIL;
}

protected Win32Exception(SerializationInfo info, StreamingContext context) : base(info, context)
{
nativeErrorCode = info.GetInt32(nameof(NativeErrorCode));
}

public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException(nameof(info));
}

info.AddValue(nameof(NativeErrorCode), nativeErrorCode);
base.GetObjectData(info, context);
}

/// <devdoc>
/// <para>Represents the Win32 error code associated with this exception. This
/// field is read-only.</para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static partial class Registry
public static void SetValue(string keyName, string valueName, object value) { }
public static void SetValue(string keyName, string valueName, object value, Microsoft.Win32.RegistryValueKind valueKind) { }
}
[System.Serializable]
public enum RegistryHive
{
ClassesRoot = -2147483648,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Microsoft.Win32
{
/**
* Registry hive values. Useful only for GetRemoteBaseKey
*/
#if REGISTRY_ASSEMBLY
[Serializable]
public
#else
internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace System.ComponentModel.DataAnnotations
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter,
AllowMultiple = false)]
[Serializable]
public sealed class UrlAttribute : DataTypeAttribute
{
public UrlAttribute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Runtime.Serialization;

namespace System.ComponentModel.DataAnnotations
{
/// <summary>
/// Exception used for validation using <see cref="ValidationAttribute" />.
/// </summary>
[Serializable]
public class ValidationException : Exception
{
private ValidationResult _validationResult;
Expand Down Expand Up @@ -67,6 +70,11 @@ public ValidationException(string message, Exception innerException)
{
}

protected ValidationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

/// <summary>
/// Gets the <see>ValidationAttribute</see> instance that triggered this exception.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ private static bool TryValidate(object value, ValidationContext validationContex
/// Private helper class to encapsulate a ValidationAttribute with the failed value and the user-visible
/// target name against which it was validated.
/// </summary>
[Serializable]
private class ValidationError
{
internal ValidationError(ValidationAttribute validationAttribute, object value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Runtime.Serialization;

namespace System.ComponentModel
{
/// <summary>
/// <para>The exception that is thrown when a thread that an operation should execute on no longer exists or is not pumping messages</para>
/// </summary>
[Serializable]
public class InvalidAsynchronousStateException : ArgumentException
{
/// <summary>
Expand All @@ -33,5 +36,9 @@ public InvalidAsynchronousStateException(string message, Exception innerExceptio
: base(message, innerException)
{
}

protected InvalidAsynchronousStateException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace System
{
[Serializable]
internal class InvariantComparer : IComparer
{
private readonly CompareInfo _compareInfo;
Expand Down
13 changes: 11 additions & 2 deletions src/System.Data.Common/src/System/DBNull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
// See the LICENSE file in the project root for more information.

using System;

using System.Runtime.Serialization;

namespace System
{
public sealed class DBNull
[Serializable]
public sealed class DBNull : ISerializable
{
private DBNull()
{
}

private DBNull(SerializationInfo info, StreamingContext context)
{
throw new NotSupportedException(SR.NotSupported_DBNullSerial);
}

public static readonly DBNull Value = new DBNull();

public void GetObjectData(SerializationInfo info, StreamingContext context)
{
UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.NullUnity, null, null);
}

public override String ToString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace System.Data.Common
{
[Serializable]
internal sealed class ReadOnlyCollection<T> : System.Collections.ICollection, ICollection<T>
{
private T[] _items;
Expand Down Expand Up @@ -89,6 +90,7 @@ public int Count
get { return _items.Length; }
}

[Serializable]
internal struct Enumerator<K> : IEnumerator<K>, System.Collections.IEnumerator
{ // based on List<T>.Enumerator
private K[] _items;
Expand Down
8 changes: 6 additions & 2 deletions src/System.Data.Common/src/System/Data/Common/DbException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace System.Data.Common
{
public abstract class DbException :
Exception
[Serializable]
public abstract class DbException : Exception
{
protected DbException() : base()
{
Expand All @@ -22,5 +22,9 @@ protected DbException(System.String message) : base(message)
protected DbException(System.String message, System.Exception innerException) : base(message, innerException)
{
}

protected DbException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

namespace System.Data.Common
{
[Serializable]
sealed internal class NameValuePair
{
readonly private string _name;
readonly private string _value;
[OptionalField(VersionAdded = 2)]
readonly private int _length;
private NameValuePair _next;

Expand Down
Loading

0 comments on commit 898da04

Please sign in to comment.