本文整理汇总了C#中Mono.Cecil.MethodDefinition.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# MethodDefinition.Accept方法的具体用法?C# MethodDefinition.Accept怎么用?C# MethodDefinition.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.MethodDefinition
的用法示例。
在下文中一共展示了MethodDefinition.Accept方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteMethodSignature
/// <summary>
/// Write a method signature to the text buffer
/// </summary>
/// <param name="mdef">Method definition</param>
protected override void WriteMethodSignature(MethodDefinition mdef)
{
mdef.Accept(this);
if (mdef.GenericParameters.Count > 0)
{
foreach (GenericParameter genparam in mdef.GenericParameters)
{
if (genparam.Constraints.Count > 0)
{
Write([email protected], ESpaceSurrounder.Both);
genparam.Accept(this);
VisitVisitableCollection(GENERIC_CONSTRAINT_LIST_START, String.Empty, BASIC_SEPARATOR, false, genparam.Constraints);
}
}
}
}
示例2: WriteMethodSignature
/// <summary>
/// Write a method signature to the text buffer
/// </summary>
/// <param name="mdef">Method definition</param>
protected override void WriteMethodSignature(MethodDefinition mdef)
{
mdef.Accept(this);
if (mdef.GenericParameters.Count <= 0)
return;
foreach (var genparam in mdef.GenericParameters.Where(genparam => genparam.Constraints.Count > 0))
{
Write([email protected], ESpaceSurrounder.Both);
genparam.Accept(this);
VisitVisitableCollection(GenericConstraintListStart, String.Empty, BasicSeparator, false, genparam.Constraints);
}
}
示例3: WriteMethodSignature
/// <summary>
/// Write a method signature to the text buffer
/// </summary>
/// <param name="mdef">Method definition</param>
protected override void WriteMethodSignature(MethodDefinition mdef)
{
if (IsUnsafe(mdef))
{
WriteComment("This method is 'unsafe' and cannot be used in VB.NET");
Write(Comment);
}
mdef.Accept(this);
if (mdef.ReturnType.FullName == typeof (void).FullName)
return;
Write(EVisualBasicKeyword.As, ESpaceSurrounder.Both);
VisitTypeReference(mdef.ReturnType);
}