/// <summary> /// </summary> /// <param name="virtualTable"> /// </param> /// <param name="interface"> /// </param> public static void BuildVirtualInterfaceTableLayout(this List<IMethod> virtualTable, IType @interface) { virtualTable.AddMethodsToVirtualInterfaceTableLayout(@interface); }
/// <summary> /// </summary> /// <param name="virtualTable"> /// </param> /// <param name="interface"> /// </param> private static void AddMethodsToVirtualInterfaceTableLayout(this List<IMethod> virtualTable, IType @interface) { var allInterfaces = @interface.GetInterfaces(); var firstChildInterface = allInterfaces != null ? allInterfaces.FirstOrDefault() : null; if (firstChildInterface != null) { // get all virtual methods in current type and replace or append virtualTable.AddMethodsToVirtualInterfaceTableLayout(firstChildInterface); } // get all virtual methods in current type and replace or append virtualTable.AddRange(IlReader.Methods(@interface)); }