本文整理汇总了C#中IMethod.GetBaseMethod方法的典型用法代码示例。如果您正苦于以下问题:C# IMethod.GetBaseMethod方法的具体用法?C# IMethod.GetBaseMethod怎么用?C# IMethod.GetBaseMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethod
的用法示例。
在下文中一共展示了IMethod.GetBaseMethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NeedsJsOverloadSuffix
static bool NeedsJsOverloadSuffix(IMethod me)
{
if (Sk.ForceMethodSuffix(me))
return true;
if (me.IsIndexerAccessor()) //TODO: HACK: bug with metaspec - base_type is null in overridden indexer methods
{
//var x = me.HasFlag(entity_flags.f_override);
//var y = me.HasFlag(entity_flags.f_method_Virtual);
return true;
}
if (me.Parameters.IsNullOrEmpty())
return false;
var ce = me.GetDeclaringTypeDefinition();
if (me.IsConstructor)
{
//var ctors = ce.GetConstructors().Where(t => !t.IsGenerated()).ToList(); //isGenerated - metaspec bug? parser generates empty ctor when a ctor with parameters is written
var ctors = ce.GetConstructors().ToList(); //removed "IsGenerated" removed, because of default constructor of structs
if (ctors.Count > 1)
{
if (ctors.Any((m) => m.IsInternal))
{
if (!me.IsInternal && ctors.Count((m) => !m.IsInternal) == 1) return false;
}
return true;
}
return false;
}
var bm = me.GetBaseMethod();
if (bm != null)
return NeedsJsOverloadSuffix(bm);
if (ce != null)
{
var methods = ce.GetAllMethods(me.Name).Where(t => !t.IsExplicitInterfaceImplementation).ToList();
if (methods.Count == 1)
return false;
}
return true;
}