summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/IvyPPC/IvyApplicationBinding.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyApplicationBinding.cs b/CSharp/Ivy/IvyPPC/IvyApplicationBinding.cs
index d76e4a4..c24ae28 100644
--- a/CSharp/Ivy/IvyPPC/IvyApplicationBinding.cs
+++ b/CSharp/Ivy/IvyPPC/IvyApplicationBinding.cs
@@ -126,7 +126,7 @@ namespace IvyBus
}
-
+#if ( SyncContext)
internal void Firevent(System.Threading.SynchronizationContext syncContext, IvyMessageEventArgs e)
{
//// Safely invoke an event:
@@ -148,6 +148,24 @@ namespace IvyBus
else
temp(this, e);
}
+#else
+ internal void Firevent(System.Windows.Forms.Control control, IvyMessageEventArgs e)
+ {
+ //// Safely invoke an event:
+ EventHandler<IvyMessageEventArgs> temp = Callback;
+
+ if (temp == null)
+ {
+ throw new IvyException("(callCallback) Not callback for id " + e.Id);
+ }
+ if (control != null)
+ {
+ control.Invoke(temp,this, e);
+ }
+ else
+ temp(this, e);
+ }
+#endif
}
}