本文整理汇总了C#中ITypeInfo.GetNames方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeInfo.GetNames方法的具体用法?C# ITypeInfo.GetNames怎么用?C# ITypeInfo.GetNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo.GetNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComMethodDesc
internal ComMethodDesc(ITypeInfo typeInfo, FUNCDESC funcDesc)
: this(funcDesc.memid) {
_hasTypeInfo = true;
InvokeKind = funcDesc.invkind;
int cNames;
string[] rgNames = new string[1 + funcDesc.cParams];
typeInfo.GetNames(_memid, rgNames, rgNames.Length, out cNames);
if (IsPropertyPut && rgNames[rgNames.Length - 1] == null) {
rgNames[rgNames.Length - 1] = "value";
cNames++;
}
Debug.Assert(cNames == rgNames.Length);
_name = rgNames[0];
_parameters = new ComParamDesc[funcDesc.cParams];
int offset = 0;
for (int i = 0; i < funcDesc.cParams; i++) {
ELEMDESC elemDesc = (ELEMDESC)Marshal.PtrToStructure(
new IntPtr(funcDesc.lprgelemdescParam.ToInt64() + offset),
typeof(ELEMDESC));
_parameters[i] = new ComParamDesc(ref elemDesc, rgNames[1 + i]);
offset += Marshal.SizeOf(typeof(ELEMDESC));
}
}
示例2: ComMethodDesc
internal ComMethodDesc(ITypeInfo typeInfo, FUNCDESC funcDesc)
: this(funcDesc.memid) {
InvokeKind = funcDesc.invkind;
int cNames;
string[] rgNames = new string[1 + funcDesc.cParams];
typeInfo.GetNames(_memid, rgNames, rgNames.Length, out cNames);
if (IsPropertyPut && rgNames[rgNames.Length - 1] == null) {
rgNames[rgNames.Length - 1] = "value";
cNames++;
}
Debug.Assert(cNames == rgNames.Length);
_name = rgNames[0];
_paramCnt = funcDesc.cParams;
}
示例3: ComMethodDesc
internal ComMethodDesc(ITypeInfo typeInfo, FUNCDESC funcDesc)
: this(funcDesc.memid)
{
InvokeKind = funcDesc.invkind;
int cNames;
string[] rgNames = new string[1 + funcDesc.cParams];
typeInfo.GetNames(DispId, rgNames, rgNames.Length, out cNames);
bool skipLast = false;
if (IsPropertyPut && rgNames[rgNames.Length - 1] == null)
{
rgNames[rgNames.Length - 1] = "value";
cNames++;
skipLast = true;
}
Debug.Assert(cNames == rgNames.Length);
_name = rgNames[0];
ParamCount = funcDesc.cParams;
ReturnType = ComUtil.GetTypeFromTypeDesc(funcDesc.elemdescFunc.tdesc);
ParameterInformation = ComUtil.GetParameterInformation(funcDesc, skipLast);
}