From a14d111ba22dcf74f83565c1ffef406e8ec31937 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:56:22 +0000 Subject: Utilisateur : Fcolin Date : 4/07/06 Heure : 14:04 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 73) --- CSharp/Ivy/IvyPPC/Ivy.cs | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'CSharp/Ivy/IvyPPC/Ivy.cs') diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index d81c620..3ade724 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/Ivy.cs @@ -308,11 +308,25 @@ namespace IvyBus debug = Properties.Settings.Default.IvyDebug; protocolVersion = Properties.Settings.Default.IvyProtocolVersion; #endif + // get binding from Attribute IvyBinding + //TODO Autobinding attribute +#if (PocketPC) + if (parentControl != null) + AutoBinding(parentControl); +#endif + Assembly assembly = Assembly.GetCallingAssembly(); + if ( assembly != this.GetType().Assembly ) + BindAttibute(assembly); } public Ivy(IContainer container) : this() { container.Add(this); + // get binding from Attribute IvyBinding + //TODO Autobinding attribute + Assembly assembly = Assembly.GetCallingAssembly(); + if (assembly != this.GetType().Assembly) + BindAttibute(assembly); } /// /// Readies the structures for the software bus connexion. @@ -342,6 +356,11 @@ namespace IvyBus { appName = name; ready_message = rdy_message; + // get binding from Attribute IvyBinding + //TODO Autobinding attribute + Assembly assembly = Assembly.GetCallingAssembly(); + if (assembly != this.GetType().Assembly) + BindAttibute(assembly); } protected override void Dispose(bool disposing) @@ -360,7 +379,7 @@ namespace IvyBus } // Autobinding on static method - public void AutoBinding(Type type) + public void BindAttibute(Type type) { if (type == null) return; //Get instance of the IvyBindingAttribute. @@ -383,7 +402,7 @@ namespace IvyBus } } // Autobinding on instance method - public void AutoBinding(object obj) + public void BindAttibute(object obj) { if (obj == null) return; Type type = obj.GetType(); @@ -406,11 +425,11 @@ namespace IvyBus } // Autobinding on IvyBindingAttribute method - public void AutoBinding(Assembly assy) + public void BindAttibute(Assembly assy) { foreach (Type typ in assy.GetTypes()) { - AutoBinding(typ); + BindAttibute(typ); } } @@ -801,10 +820,12 @@ namespace IvyBus { FireEvent(temp,e); } +#if (!PocketPC) catch (SynchronizationLockException ex) { // protect terminaison } +#endif catch (ObjectDisposedException) { // protect terminaison @@ -1147,12 +1168,6 @@ namespace IvyBus public void EndInit() { - //TODO Autobinding attribute -#if (PocketPC) - if (parentControl != null) - AutoBinding(parentControl); -#endif - AutoBinding(Assembly.GetCallingAssembly()); // TODO ugly should be added directly the bindings Dictionary ! foreach (IvyApplicationBinding bind in app_bindings) { -- cgit v1.1