Beispiel #1
0
        private bool m_useDefaultMarshal; // Whether we marshal by default or marshal by UnmanagedType

        #endregion Fields

        #region Constructors

        public TypeConverter(ConverterInfo info, TypeInfo type, TypeDesc desc, ConversionType conversionType)
        {
            m_info = info;
            m_typeInfo = type;
            m_typeDesc = desc;
            m_conversionType = conversionType;

            m_paramDesc = null;
            m_attribute = null;
            m_conversionLoss = false;
            m_convertedType = null;
            m_nativeIndirections = 0;
            m_convertingNewEnumMember = false;

            ResetUnmanagedType();

            // Do the conversion
            _Convert();
        }
Beispiel #2
0
        /// <summary>
        /// Wrapper for a already converted type
        /// </summary>
        /// <param name="type"></param>
        public TypeConverter(Type type)
        {
            m_info = null;
            m_typeDesc = null;
            m_typeInfo = null;
            m_paramDesc = null;
            m_attribute = null;
            m_conversionLoss = false;
            m_convertedType = type;
            m_nativeIndirections = 0;

            ResetUnmanagedType();
        }
Beispiel #3
0
        /// <summary>
        /// Used in the customized type conversion
        /// </summary>
        /// <param name="type"></param>
        public TypeConverter(Type type, CustomAttributeBuilder attribute, ParameterAttributes parameterAttributesOverride)
        {
            m_info = null;
            m_typeDesc = null;
            m_typeInfo = null;
            m_paramDesc = null;
            m_attribute = attribute;
            m_conversionLoss = false;
            m_convertedType = type;
            m_nativeIndirections = 0;

            m_parameterAttributesOverride = parameterAttributesOverride;

            ResetUnmanagedType();
        }
Beispiel #4
0
        private static bool IsRetVal(ConverterInfo info, ParamDesc paramDesc, FuncDesc funcDesc)
        {
            if (paramDesc.IsRetval)
            {
                // Don't consider it is a RetVal for dispatch functions unless TransformDispRetVal is true
                if (funcDesc.funckind == TypeLibTypes.Interop.FUNCKIND.FUNC_DISPATCH && !info.TransformDispRetVal)
                    return false;

                return true;
            }

            return false;
        }