Boo.Lang.Compiler.Steps.EmitAssembly.GetMappedFieldInfo C# (CSharp) Метод

GetMappedFieldInfo() приватный Метод

Retrieves the FieldInfo for a field as mapped on a generic type.
private GetMappedFieldInfo ( IType targetType, IField source ) : FieldInfo
targetType IType
source IField
Результат System.Reflection.FieldInfo
        private FieldInfo GetMappedFieldInfo(IType targetType, IField source)
        {
            FieldInfo fi = GetFieldInfo(source);
            if (!fi.DeclaringType.IsGenericTypeDefinition)
            {
                // HACK: .NET Reflection doesn't allow calling TypeBuilder.GetField(Type, FieldInfo)
                // on types that aren't generic definitions (like open constructed types), so we have
                // to manually find the corresponding FieldInfo on the declaring type's definition
                // before mapping it
                Type definition = fi.DeclaringType.GetGenericTypeDefinition();
                fi = definition.GetField(fi.Name);
            }
            return TypeBuilder.GetField(GetSystemType(targetType), fi);
        }
EmitAssembly