1 /* 2 * Copyright (C) 2009 Jordi Mas i Hernàndez <jmas@softcatala.org> 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License as 6 * published by the Free Software Foundation; either version 2 of the 7 * License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public 15 * License along with this program; if not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 using System; 19 using Gtk; 20 21 namespace gbrainy.Clients.Classical 22 { 23 public class GtkSynchronize :System.ComponentModel.ISynchronizeInvoke 24 { GtkSynchronize()25 public GtkSynchronize () 26 { 27 28 } 29 30 // true if the caller must call Invoke; otherwise, false. 31 public bool InvokeRequired { 32 get { 33 return true; 34 } 35 } 36 BeginInvoke(Delegate method, object[] args)37 public IAsyncResult BeginInvoke (Delegate method, object[] args) 38 { 39 Application.Invoke (delegate { 40 method.DynamicInvoke (args); 41 }); 42 43 return null; 44 } 45 EndInvoke(IAsyncResult result)46 public object EndInvoke (IAsyncResult result) 47 { 48 return null; 49 } 50 51 // Use Invoke when the control's main thread is different from the calling thread to marshal the call to the proper thread. Invoke(Delegate method, object[] args)52 public object Invoke (Delegate method, object[] args) 53 { 54 return null; 55 } 56 } 57 } 58