ExcelDna.Loader.XlParameterInfo.GetMarshalAsAttribute C# (CSharp) Метод

GetMarshalAsAttribute() приватный статический Метод

private static GetMarshalAsAttribute ( Type marshalTypeRef ) : CustomAttributeBuilder
marshalTypeRef System.Type
Результат System.Reflection.Emit.CustomAttributeBuilder
        private static CustomAttributeBuilder GetMarshalAsAttribute(Type marshalTypeRef)
        {
            // CONSIDER: Caching some of the metadata loaded here
            Type[] ctorParams = new Type[] { typeof(UnmanagedType) };
            ConstructorInfo classCtorInfo = typeof(MarshalAsAttribute).GetConstructor(ctorParams);

            CustomAttributeBuilder builder = new CustomAttributeBuilder(
                                classCtorInfo,
                                new object[] { UnmanagedType.CustomMarshaler },
                                new FieldInfo[] { typeof(MarshalAsAttribute).GetField("MarshalTypeRef") },
                                new object[] { marshalTypeRef });
            return builder;
        }

Same methods

XlParameterInfo::GetMarshalAsAttribute ( Type marshalTypeRef, string marshalCookie ) : CustomAttributeBuilder
XlParameterInfo::GetMarshalAsAttribute ( UnmanagedType unmanagedType ) : CustomAttributeBuilder