本文整理汇总了C#中Mono.Cecil.ParameterDefinition.IsOutParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterDefinition.IsOutParameter方法的具体用法?C# ParameterDefinition.IsOutParameter怎么用?C# ParameterDefinition.IsOutParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.ParameterDefinition
的用法示例。
在下文中一共展示了ParameterDefinition.IsOutParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOutAttribute
protected override Mono.Cecil.CustomAttribute GetOutAttribute(ParameterDefinition parameter)
{
if (parameter.IsOutParameter())
{
return GetInOrOutAttribute(parameter, false);
}
return base.GetOutAttribute(parameter);
}
示例2: WriteOutOrRefKeyWord
protected virtual void WriteOutOrRefKeyWord(ParameterDefinition parameter)
{
if (parameter.IsOutParameter())
{
WriteKeyword(KeyWordWriter.Out);
}
else
{
WriteKeyword(KeyWordWriter.ByRef);
}
}
示例3: GetOutAttribute
protected virtual CustomAttribute GetOutAttribute(ParameterDefinition parameter)
{
if (parameter.IsOutParameter())
{
return null;
}
if (parameter == null || !parameter.IsOut)
{
return null;
}
//ModuleDefinition paramDeclaringModule = parameter.Method.ReturnType.Module;
//IMetadataScope referencedCorlib = paramDeclaringModule.TypeSystem.Corlib;
///// The type reference is created this way in order to avoid resolving it.
///// This will help the program print valid code, even in cases when the targeted corlib cannot be found (i.e. decompiling .NET 1.1)
///// The reference to the parameterless constructor is created for the same reason.
//TypeReference outAttributeTypeReference = new TypeReference("System.Runtime.InteropServices", "OutAttribute", paramDeclaringModule, referencedCorlib);
//if (outAttributeTypeReference == null)
//{
// return null;
//}
//MethodReference emptyCtor = new MethodReference(".ctor", paramDeclaringModule.TypeSystem.Void, outAttributeTypeReference);
//return new CustomAttribute(emptyCtor);
return GetInOrOutAttribute(parameter, false);
}