diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
commit | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch) | |
tree | e5435159cd1bf0519276363a6fe1663d1721bed3 /src/mscorlib/src/System/Reflection/EventInfo.cs | |
parent | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff) | |
download | coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2 coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip |
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/mscorlib/src/System/Reflection/EventInfo.cs')
-rw-r--r-- | src/mscorlib/src/System/Reflection/EventInfo.cs | 55 |
1 files changed, 9 insertions, 46 deletions
diff --git a/src/mscorlib/src/System/Reflection/EventInfo.cs b/src/mscorlib/src/System/Reflection/EventInfo.cs index 3fd1951b6c..0eabb9d03a 100644 --- a/src/mscorlib/src/System/Reflection/EventInfo.cs +++ b/src/mscorlib/src/System/Reflection/EventInfo.cs @@ -19,9 +19,6 @@ namespace System.Reflection [Serializable] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_EventInfo))] -#pragma warning disable 618 - [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] -#pragma warning restore 618 [System.Runtime.InteropServices.ComVisible(true)] public abstract class EventInfo : MemberInfo, _EventInfo { @@ -123,7 +120,7 @@ namespace System.Reflection throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotSupportedOnWinRTEvent")); // Must be a normal non-WinRT event - Contract.Assert(addMethod.ReturnType == typeof(void)); + Debug.Assert(addMethod.ReturnType == typeof(void)); #endif // FEATURE_COMINTEROP addMethod.Invoke(target, new object[] { handler }); @@ -140,13 +137,13 @@ namespace System.Reflection #if FEATURE_COMINTEROP ParameterInfo[] parameters = removeMethod.GetParametersNoCopy(); - Contract.Assert(parameters != null && parameters.Length == 1); + Debug.Assert(parameters != null && parameters.Length == 1); if (parameters[0].ParameterType == typeof(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotSupportedOnWinRTEvent")); // Must be a normal non-WinRT event - Contract.Assert(parameters[0].ParameterType.BaseType == typeof(MulticastDelegate)); + Debug.Assert(parameters[0].ParameterType.BaseType == typeof(MulticastDelegate)); #endif // FEATURE_COMINTEROP removeMethod.Invoke(target, new object[] { handler }); @@ -190,35 +187,6 @@ namespace System.Reflection } } #endregion - -#if !FEATURE_CORECLR - Type _EventInfo.GetType() - { - return base.GetType(); - } - - void _EventInfo.GetTypeInfoCount(out uint pcTInfo) - { - throw new NotImplementedException(); - } - - void _EventInfo.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo) - { - throw new NotImplementedException(); - } - - void _EventInfo.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) - { - throw new NotImplementedException(); - } - - // If you implement this method, make sure to include _EventInfo.Invoke in VM\DangerousAPIs.h and - // include _EventInfo in SystemDomain::IsReflectionInvocationMethod in AppDomain.cpp. - void _EventInfo.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) - { - throw new NotImplementedException(); - } -#endif } [Serializable] @@ -228,7 +196,6 @@ namespace System.Reflection private int m_token; private EventAttributes m_flags; private string m_name; - [System.Security.SecurityCritical] private void* m_utf8name; private RuntimeTypeCache m_reflectedTypeCache; private RuntimeMethodInfo m_addMethod; @@ -244,12 +211,11 @@ namespace System.Reflection { // Used for dummy head node during population } - [System.Security.SecurityCritical] // auto-generated internal RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeTypeCache reflectedTypeCache, out bool isPrivate) { Contract.Requires(declaredType != null); Contract.Requires(reflectedTypeCache != null); - Contract.Assert(!reflectedTypeCache.IsGlobal); + Debug.Assert(!reflectedTypeCache.IsGlobal); MetadataImport scope = declaredType.GetRuntimeModule().MetadataImport; @@ -305,28 +271,27 @@ namespace System.Reflection public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { if (attributeType == null) - throw new ArgumentNullException("attributeType"); + throw new ArgumentNullException(nameof(attributeType)); Contract.EndContractBlock(); RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"),"attributeType"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"),nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } - [System.Security.SecuritySafeCritical] // auto-generated public override bool IsDefined(Type attributeType, bool inherit) { if (attributeType == null) - throw new ArgumentNullException("attributeType"); + throw new ArgumentNullException(nameof(attributeType)); Contract.EndContractBlock(); RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"),"attributeType"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"),nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } @@ -341,7 +306,6 @@ namespace System.Reflection public override MemberTypes MemberType { get { return MemberTypes.Event; } } public override String Name { - [System.Security.SecuritySafeCritical] // auto-generated get { if (m_name == null) @@ -373,11 +337,10 @@ namespace System.Reflection #endregion #region ISerializable - [System.Security.SecurityCritical] // auto-generated_required public void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); Contract.EndContractBlock(); MemberInfoSerializationHolder.GetSerializationInfo( |