public EditGlobalDataPanel(WixFiles wixFiles, VoidVoidDelegate reloadAll) : base(wixFiles, "/wix:Wix/*", "Id") { reloadAllPanels = reloadAll; LoadData(); }
private void Q_QueueChanged(object sender, EventArgs e) { VoidVoidDelegate d = delegate { foreach (SongRequestControl src in srControls) { Controls.Remove(src); } int height = 0; foreach (SongRequest sr in q) { SongRequestControl src = new SongRequestControl(sr, this); src.Location = new Point(0, height); height = height + src.Height; Controls.Add(src); srControls.Add(src); } if (!parentForm.songIsPlaying && parentForm.isAutoplayOn() && q.Count() >= 1) { parentForm.playNext(); } parentForm.setSkipEnabled(q.Count() > 0); }; this.Invoke(d); }
// This one fails because we haven't fully detached, so shutdown is waiting for the thread public static int test_0_attach_invoke_block_foreign_thread_delegate() { var del = new VoidVoidDelegate(MethodInvokedFromNative2); bool skipped = mono_test_attach_invoke_block_foreign_thread(null, null, null, null, del); GC.Collect(); // should not hang waiting for the foreign thread return(0); // really we succeed if the app can shut down without hanging }
private void Browser_PlayerReady(object sender, EventArgs e) { VoidVoidDelegate d = delegate { browserReady = true; }; this.Invoke(d); }
public static int test_0_attach_invoke_foreign_thread_delegate() { var del = new VoidVoidDelegate(MethodInvokedFromNative_del); was_called_del = 0; bool skipped = mono_test_attach_invoke_foreign_thread(null, null, null, null, del); GC.Collect(); // should not hang waiting for the foreign thread return(skipped || was_called_del == 5 ? 0 : 1); }
public static int test_0_setjmp_exn_handler() { IntPtr res; Caller.Setup(); VoidVoidDelegate f = new VoidVoidDelegate(Caller.M1); try { mono_test_setjmp_and_call(f, out res); } catch (SpecialExn) { Console.Error.WriteLine("should not have caught a SpecialExn"); return(1); } if (!Caller.called) { Console.Error.WriteLine("delegate not even called"); return(2); } if (!Caller.finally_called) { Console.Error.WriteLine("finally not reached"); return(3); } if (res == IntPtr.Zero) { Console.Error.WriteLine("res should be a GCHandle, was 0"); return(4); } GCHandle h = GCHandle.FromIntPtr(res); object o = h.Target; h.Free(); if (o == null) { Console.Error.WriteLine("GCHandle target was null"); return(5); } else if (o is SpecialExn) { return(0); } else { Console.Error.WriteLine("o was not a SpecialExn, it is {0}", o); return(6); } }
public static int test_0_throw_and_raise_exception() { Caller.Setup(); Caller2.Setup(); VoidVoidDelegate f = new VoidVoidDelegate(Caller.M2); VoidHandleHandleOutDelegate del2 = new VoidHandleHandleOutDelegate(Caller2.Del2); bool outer_managed_callback = false; try { mono_test_setup_ftnptr_eh_callback(f, del2); } catch (Exception e) { outer_managed_callback = true; } if (!outer_managed_callback) { Console.Error.WriteLine("outer managed callback did not throw exception"); return(1); } if (!Caller2.rethrow_called) { Console.Error.WriteLine("exception was not rethrown by eh callback"); return(2); } if (!Caller2.exception_caught) { Console.Error.WriteLine("rethrown exception was not caught"); return(3); } if (!Caller2.return_from_inner_managed_callback) { Console.Error.WriteLine("managed callback called from native eh callback did not return"); return(4); } mono_test_cleanup_ftptr_eh_callback(); return(0); }
public void SubscribeOnEndDrag(VoidVoidDelegate call) { OnMyEndDrag += call; }
public void SubscribeOnBeginDrag(VoidVoidDelegate call) { OnMyBeginDrag += call; }
public void SubscribeOnUnHighlight(VoidVoidDelegate call) { OnUnHighlight += call; }
public void SubscribeOnDoubleClick(VoidVoidDelegate call) { OnDoubleButtonClick += call; }
public static extern void mono_test_setup_ftnptr_eh_callback(VoidVoidDelegate del, VoidHandleHandleOutDelegate inside_eh_callback);
public static extern void mono_test_setjmp_and_call(VoidVoidDelegate del, out IntPtr handle);
public static extern bool mono_test_attach_invoke_block_foreign_thread(string assm_name, string name_space, string class_name, string method_name, VoidVoidDelegate del);