public static bool hasCflow(dnlib.DotNet.MethodDef methods) { for (int i = 0; i < methods.Body.Instructions.Count; i++) { if (methods.Body.Instructions[i].OpCode == OpCodes.Switch) { return(true); } } return(false); }
/// <summary> /// Default constructor /// </summary> internal MethodDef(Resolver resolver, dnlib.DotNet.MethodDef source) : base(resolver, source, ResolveOperator(source, resolver, out var isOperator)) { // If the source is null.. if (source is null) { // throw an exception throw new ArgumentNullException(nameof(source)); } Operator = isOperator; IsAsync = ResolveAsync(source); Inheritance = ResolveInheritance(source); Generics = ResolveGenerics(source, resolver); Returns = ResolveReturn(source); }
private static MemberInheritance ResolveInheritance(dnlib.DotNet.MethodDef source) { if (source.IsVirtual && (source.Attributes & MethodAttributes.NewSlot) == 0) { return(MemberInheritance.Override); } if (source.IsAbstract) { return(MemberInheritance.Abstract); } if (source.IsVirtual) { return(MemberInheritance.Virtual); } return(MemberInheritance.Normal); }
private static AccessorType ResolveAccessor(dnlib.DotNet.MethodDef method) => method.Access switch {
static string RetrieveConverterName(Resolver resolver, dnlib.DotNet.MethodDef input) => resolver.Resolve(input.ReturnType).DisplayName;
// ReSharper disable once CyclomaticComplexity private static string ResolveOperator(dnlib.DotNet.MethodDef source, Resolver resolver, out OperatorType @operator) { // Assume that the source is a normal operator @operator = OperatorType.Normal;