コード例 #1
0
        public SignatureInfoMatchTarget(TypeInfo interfaceTypeInfo, int functionIndex,
            ElemDesc elemDesc, int parameterIndex)
        {
            if (interfaceTypeInfo == null) throw new ArgumentNullException(nameof(interfaceTypeInfo));
            m_interfaceTypeInfo = interfaceTypeInfo;
            m_functionIndex = functionIndex;
            m_funcDesc = interfaceTypeInfo.GetFuncDesc(m_functionIndex);
            m_elemDesc = elemDesc;
            m_parameterIndex = parameterIndex;

            if (m_parameterIndex == 0)
            {
                m_name = "return";
            }
            else
            {
                // the name of the parameter.
                string[] signatureNames = m_interfaceTypeInfo.GetNames(m_funcDesc.memid,
                    m_funcDesc.cParams + 1);
                m_name = signatureNames[m_parameterIndex];
                if (m_name == null || m_name.Trim().Equals(""))
                    m_name = "_unnamed_arg_" + m_parameterIndex;
            }
            // NativeParentFunctionName
            m_nativeParentFunctionName =
                m_interfaceTypeInfo.GetDocumentation(m_funcDesc.memid);

            // NativeSignature
            m_nativeSignature = (new TlbType2String(interfaceTypeInfo, m_elemDesc.tdesc)).GetTypeString();
        }