summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs35
1 files changed, 25 insertions, 10 deletions
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);
}
/// <summary>
/// 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)
{