internal sealed override IEnumerable <MethodInfo> CoreGetDeclaredMethods(NameFilter optionalNameFilter, RuntimeTypeInfo reflectedType, RuntimeTypeInfo contextTypeInfo) { MetadataReader reader = Reader; foreach (MethodHandle methodHandle in DeclaredMethodAndConstructorHandles) { Method method = methodHandle.GetMethod(reader); if (NativeFormatMetadataReaderExtensions.IsConstructor(ref method, reader)) { continue; } if (optionalNameFilter == null || optionalNameFilter.Matches(method.Name, reader)) { yield return(RuntimeNamedMethodInfo <NativeFormatMethodCommon> .GetRuntimeNamedMethodInfo(new NativeFormatMethodCommon(methodHandle, this, contextTypeInfo), reflectedType)); } } }
internal sealed override IEnumerable <ConstructorInfo> CoreGetDeclaredConstructors(NameFilter optionalNameFilter, RuntimeTypeInfo contextTypeInfo) { // // - It may sound odd to get a non-null name filter for a constructor search, but Type.GetMember() is an api that does this. // // - All GetConstructor() apis act as if BindingFlags.DeclaredOnly were specified. So the ReflectedType will always be the declaring type and so is not passed to this method. // MetadataReader reader = Reader; foreach (MethodHandle methodHandle in DeclaredMethodAndConstructorHandles) { Method method = methodHandle.GetMethod(reader); if (!NativeFormatMetadataReaderExtensions.IsConstructor(ref method, reader)) { continue; } if (optionalNameFilter == null || optionalNameFilter.Matches(method.Name, reader)) { yield return(RuntimePlainConstructorInfo <NativeFormatMethodCommon> .GetRuntimePlainConstructorInfo(new NativeFormatMethodCommon(methodHandle, this, contextTypeInfo))); } } }