Imported Upstream version 4.2.0.179

Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent aa7da660d6
commit c042cd0c52
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -36,6 +36,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Diagnostics.Contracts;
namespace System.Reflection {
@@ -60,9 +61,56 @@ namespace System.Reflection {
}
}
abstract class RuntimeEventInfo : EventInfo, ISerializable
{
internal BindingFlags BindingFlags {
get {
return 0;
}
}
public override Module Module {
get {
return GetRuntimeModule ();
}
}
internal RuntimeType GetDeclaringTypeInternal ()
{
return (RuntimeType) DeclaringType;
}
RuntimeType ReflectedTypeInternal {
get {
return (RuntimeType) ReflectedType;
}
}
internal RuntimeModule GetRuntimeModule ()
{
return GetDeclaringTypeInternal ().GetRuntimeModule ();
}
#region ISerializable
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException("info");
Contract.EndContractBlock();
MemberInfoSerializationHolder.GetSerializationInfo(
info,
Name,
ReflectedTypeInternal,
null,
MemberTypes.Event);
}
#endregion
}
[Serializable]
[StructLayout (LayoutKind.Sequential)]
internal sealed class MonoEvent: EventInfo, ISerializable
internal sealed class MonoEvent: RuntimeEventInfo
{
#pragma warning disable 169
IntPtr klass;
@@ -158,13 +206,6 @@ namespace System.Reflection {
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
}
// ISerializable
public void GetObjectData (SerializationInfo info, StreamingContext context)
{
MemberInfoSerializationHolder.Serialize (info, Name, ReflectedType,
ToString(), MemberTypes.Event);
}
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}