Skip to content

Instantly share code, notes, and snippets.

@marek-safar
Created March 30, 2012 17:30
Show Gist options
  • Save marek-safar/2253170 to your computer and use it in GitHub Desktop.
Save marek-safar/2253170 to your computer and use it in GitHub Desktop.
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/GtkWorkarounds.cs
@@ -686,8 +686,10 @@ namespace Mono.TextEditor
il.Emit (OpCodes.Ldloc, loc_obj);
il.Emit (OpCodes.Brfalse, IL_002b);
+ var tref = typeof (GLib.Object).Assembly.GetType ("GLib.ToggleRef");
il.Emit (OpCodes.Ldloc, loc_obj);
- il.Emit (OpCodes.Callvirt, typeof (GLib.Object).Assembly.GetType ("GLib.ToggleRef").GetProperty ("Target")
+ il.Emit (OpCodes.Castclass, tref);
+ il.Emit (OpCodes.Callvirt, tref.GetProperty ("Target").GetGetMethod ());
il.Emit (OpCodes.Isinst, typeof (Gtk.Container));
il.Emit (OpCodes.Stloc, loc_container);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment