diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-12-15 18:32:52 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-12-15 18:32:52 +0100 |
| commit | 0819cdcf926fe7d54e85cbee440c2b334676b2b3 (patch) | |
| tree | fb02c6ddc20fe8ad1d3966f9d0819c9d98aab93f /src/IML | |
| parent | aba894f6a5bb41200e969ccdd7045800ff36e74a (diff) | |
emit bind datasource handler methods
modifié : src/CompilerServices/CompilerServices.cs
modifié : src/IML/Context.cs
modifié : src/Instantiator.cs
Diffstat (limited to 'src/IML')
| -rw-r--r-- | src/IML/Context.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/IML/Context.cs b/src/IML/Context.cs index 4f9ba30d..79ab8a31 100644 --- a/src/IML/Context.cs +++ b/src/IML/Context.cs @@ -83,5 +83,13 @@ namespace Crow.IML CompilerServices.emitSetCurInterface (il); } + public void emitDataSourceChangedHandlerAddition(int index){ + il.Emit(OpCodes.Ldloc_0);//load ref to current graphic object + il.Emit(OpCodes.Ldarg_0);//load ref to this instanciator onto the stack + il.Emit(OpCodes.Ldfld, typeof(Instantiator).GetField("dataSourceChangedDelegates", BindingFlags.Instance | BindingFlags.NonPublic)); + il.Emit(OpCodes.Ldc_I4, index);//load delegate index + il.Emit(OpCodes.Callvirt, typeof(List<Delegate>).GetMethod("get_Item", new Type[] { typeof(Int32) })); + il.Emit(OpCodes.Callvirt, typeof(GraphicObject).GetEvent("DataSourceChanged").AddMethod);//call add event + } } }
\ No newline at end of file |