本文整理匯總了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);
}