/// <summary> /// Converts a MethodBase[] into a MethodInformation[] /// </summary> /// <returns>the ComMethodInformation[] corresponding to methods</returns> internal static ComMethodInformation[] GetMethodInformationArray(COM.ITypeInfo typeInfo, Collection <int> methods, bool skipLastParameters) { int methodCount = methods.Count; int count = 0; ComMethodInformation[] returnValue = new ComMethodInformation[methodCount]; foreach (int index in methods) { IntPtr pFuncDesc; typeInfo.GetFuncDesc(index, out pFuncDesc); COM.FUNCDESC funcdesc = ClrFacade.PtrToStructure <COM.FUNCDESC>(pFuncDesc); returnValue[count++] = ComUtil.GetMethodInformation(funcdesc, skipLastParameters); typeInfo.ReleaseFuncDesc(pFuncDesc); } return(returnValue); }
internal static ComMethodInformation[] GetMethodInformationArray( ITypeInfo typeInfo, Collection <int> methods, bool skipLastParameters) { int count = methods.Count; int num = 0; ComMethodInformation[] methodInformationArray = new ComMethodInformation[count]; foreach (int method in methods) { IntPtr ppFuncDesc; typeInfo.GetFuncDesc(method, out ppFuncDesc); System.Runtime.InteropServices.ComTypes.FUNCDESC structure = (System.Runtime.InteropServices.ComTypes.FUNCDESC)Marshal.PtrToStructure(ppFuncDesc, typeof(System.Runtime.InteropServices.ComTypes.FUNCDESC)); methodInformationArray[num++] = ComUtil.GetMethodInformation(structure, skipLastParameters); typeInfo.ReleaseFuncDesc(ppFuncDesc); } return(methodInformationArray); }