diff --git a/src/XamlX/IL/RuntimeContext.cs b/src/XamlX/IL/RuntimeContext.cs index e8a16b6a..f8ae98b7 100644 --- a/src/XamlX/IL/RuntimeContext.cs +++ b/src/XamlX/IL/RuntimeContext.cs @@ -558,14 +558,16 @@ void MethodStub(string name) .Emit(OpCodes.Ldfld, current) .Emit(OpCodes.Ret); - enumeratorBuilder.DefineMethod(typeSystem.FindType("System.Void"), new IXamlType[0], "Reset", true, false, - true).Generator + enumeratorBuilder.DefineMethod(typeSystem.FindType("System.Void"), new IXamlType[0], + enumeratorObjectType.FullName+".Reset", false, false, + true, enumeratorObjectType.FindMethod(m => m.Name == "Reset")).Generator .Emit(OpCodes.Newobj, typeSystem.FindType("System.NotSupportedException").FindConstructor(new List())) .Emit(OpCodes.Throw); - + var disposeGen = enumeratorBuilder.DefineMethod(typeSystem.FindType("System.Void"), new IXamlType[0], - "Dispose", true, false, true ).Generator; + "System.IDisposable.Dispose", false, false, true, + typeSystem.GetType("System.IDisposable").FindMethod(m => m.Name == "Dispose")).Generator; var disposeRet = disposeGen.DefineLabel(); disposeGen .Emit(OpCodes.Ldarg_0) @@ -579,8 +581,9 @@ void MethodStub(string name) var boolType = typeSystem.GetType("System.Boolean"); var moveNext = enumeratorBuilder.DefineMethod(boolType, new IXamlType[0], - "MoveNext", true, - false, true).Generator; + enumeratorObjectType.FullName+".MoveNext", false, + false, true, + enumeratorObjectType.FindMethod(m => m.Name == "MoveNext")).Generator; const int stateInit = 0;