本文整理汇总了C#中Mono.Cecil.ParameterDefinition.IsParamArray方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterDefinition.IsParamArray方法的具体用法?C# ParameterDefinition.IsParamArray怎么用?C# ParameterDefinition.IsParamArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.ParameterDefinition
的用法示例。
在下文中一共展示了ParameterDefinition.IsParamArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoWriteParameterTypeAndName
protected override void DoWriteParameterTypeAndName(TypeReference type, string name, ParameterDefinition reference)
{
if (reference.IsParamArray())
{
WriteKeyword(KeyWordWriter.ParamArray);
WriteSpace();
}
if (!Language.IsValidIdentifier(name))
{
name = Language.ReplaceInvalidCharactersInIdentifier(name);
}
if (Language.IsGlobalKeyword(name))
{
name = Utilities.EscapeName(name, this.Language);
}
Write(name);
// undocumented C# keyword like __arglist
if (!string.IsNullOrEmpty(ToTypeString(type)))
{
WriteAsBetweenSpaces();
WriteReferenceAndNamespaceIfInCollision(type);
}
}
示例2: DoWriteParameterTypeAndName
protected override void DoWriteParameterTypeAndName(TypeReference type, string name, ParameterDefinition reference)
{
if (!Language.IsValidIdentifier(name))
{
name = Language.ReplaceInvalidCharactersInIdentifier(name);
}
if (reference.IsParamArray())
{
WriteKeyword(KeyWordWriter.ParamArray);
WriteSpace();
}
CustomAttribute dynamicAttribute;
if (reference.TryGetDynamicAttribute(out dynamicAttribute))
{
IEnumerator positioningFlagsEnumerator = DynamicHelper.GetDynamicPositioningFlags(dynamicAttribute).GetEnumerator();
if (reference.ParameterType.IsByReference && (reference.ParameterType as ByReferenceType).ElementType == type)
{
if (!positioningFlagsEnumerator.MoveNext() || (bool)positioningFlagsEnumerator.Current)
{
throw new Exception("Invalid argument type for DynamicAttribute");
}
}
WriteDynamicType(type, positioningFlagsEnumerator);
WriteSpace();
}
else
{
// undocumented C# keyword like __arglist
if (!string.IsNullOrEmpty(ToTypeString(type)))
{
WriteReferenceAndNamespaceIfInCollision(type);
WriteSpace();
}
}
if (Language.IsGlobalKeyword(name))
{
name = Utilities.EscapeName(name, this.Language);
}
Write(name);
}