summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:55:41 +0000
committerfcolin2007-02-01 09:55:41 +0000
commit4adecce965ffd9b2796f7a50c3acc893e284be06 (patch)
treea58226b0570e33d47e1faee0d1aa07e13fb2d2b4 /CSharp/Ivy/IvyPPC
parent3f1264b13c41d1983535c3bd0f756db4031417ec (diff)
downloadivy-csharp-4adecce965ffd9b2796f7a50c3acc893e284be06.zip
ivy-csharp-4adecce965ffd9b2796f7a50c3acc893e284be06.tar.gz
ivy-csharp-4adecce965ffd9b2796f7a50c3acc893e284be06.tar.bz2
ivy-csharp-4adecce965ffd9b2796f7a50c3acc893e284be06.tar.xz
Utilisateur : Fcolin Date : 8/02/06 Heure : 17:13 Archivé dans $/CSharp/Ivy/IvyPPC Commentaire: clarification du type de retour sur die (vss 52)
Diffstat (limited to 'CSharp/Ivy/IvyPPC')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs48
1 files changed, 15 insertions, 33 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index cded94b..276825f 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -27,29 +27,6 @@ namespace IvyBus
/// <summary> The Main bus Class
/// </summary>
///
-
-#if (PocketPC)
- public class CreateDelegate
- {
- object eventtarget;
- MethodInfo mymethod;
- object [] methodparams = new Object[2];
-
- public void Invoke(object sender, System.EventArgs e)
- {
- methodparams[1] = e;
- mymethod.Invoke(eventtarget, methodparams);
- }
-
- public CreateDelegate(MethodInfo mi, object eventTarget, object eventObject)
- {
- eventtarget = eventTarget;
- mymethod = mi;
- methodparams[0] = eventObject;
- methodparams[1] = null;
- }
- }
-#endif
#if (!PocketPC)
[ToolboxItemFilter("System.Windows.Forms.Form",ToolboxItemFilterType.Allow)]
@@ -58,11 +35,13 @@ namespace IvyBus
#endif
public class Ivy : System.ComponentModel.Component
{
- /* Event handler */
+ /* return value for Die Event */
+ public enum ApplicationExit { FORCE_EXIT, DONT_EXIT };
+ /* Event handler */
public delegate void DirectMessageHandler (IvyClient app, int id, string arg );
public delegate void ClientConnectedHandler (IvyClient app);
public delegate void ClientDisconnectedHandler (IvyClient app);
- public delegate bool DieHandler (IvyClient app, int id, string arg );
+ public delegate ApplicationExit DieHandler(IvyClient app, int id, string arg);
public delegate void ClientAddBindingHandler (IvyClient app, string arg );
public delegate void ClientRemoveBindingHandler (IvyClient app, string arg );
@@ -377,12 +356,13 @@ namespace IvyBus
{
//TODO check paramater type MessageHandler
Debug.WriteLine("IvyBinding '" + attr.GetExpression(null) + "' to Method " + m.Name);
+ MessageHandler handler;
#if (PocketPC)
- //bindMsg(attr.GetExpression(null), (MessageHandler) DynamicMethod.CreateDelegate(m));
-
+ handler = null; // TODO
#else
- bindMsg(attr.GetExpression(null), (MessageHandler)Delegate.CreateDelegate(typeof(MessageHandler),m));
+ handler = (MessageHandler)Delegate.CreateDelegate(typeof(MessageHandler), m)
#endif
+ bindMsg(attr.GetExpression(null), handler);
}
}
}
@@ -397,11 +377,13 @@ namespace IvyBus
{
//TODO check paramater type MessageHandler
traceDebug("IvyBinding '" + attr.GetExpression(obj) + "' to Method " + m.Name);
+ MessageHandler handler;
#if (PocketPC)
- //bindMsg(attr.GetExpression(obj), (MessageHandler) new CreateDelegate( m, obj, null));
+ handler = null; // TODO
#else
- bindMsg(attr.GetExpression(obj), (MessageHandler)Delegate.CreateDelegate(typeof(MessageHandler), obj, m));
+ handler = (MessageHandler)Delegate.CreateDelegate(typeof(MessageHandler), obj, m);
#endif
+ bindMsg(attr.GetExpression(obj), handler);
}
}
@@ -793,15 +775,15 @@ namespace IvyBus
else BindingRemove( app,regexp);
}
}
- internal bool FireDie (IvyClient app, int id, string arg )
+ internal ApplicationExit FireDie(IvyClient app, int id, string arg)
{
if ( dieReceived != null )
{
if (IsSynchronous())
- return (bool )syncControl.Invoke( dieReceived, new object[]{app,id,arg});
+ return (ApplicationExit)syncControl.Invoke(dieReceived, new object[] { app, id, arg });
else return dieReceived( app, id, arg);
}
- return false;
+ return ApplicationExit.FORCE_EXIT;
}