diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-02 12:28:36 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-06-02 12:28:36 +0200 |
| commit | c54c8b8e7e369dbba890efdb35a015740d1d95ea (patch) | |
| tree | f2b7ed73e93c4170e22e3713d4c66e02eeb40d76 /src/Interface.cs | |
| parent | b56c22ad826a49b7ea0013c1ca78cf64169fc326 (diff) | |
listbox update
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index a9da051a..0d0425ed 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -139,16 +139,21 @@ namespace go fi.SetValue(es.Source, del); } } - - foreach (DynAttribute binding in Bindings) { -// Type tSource = binding.Source.GetType (); -// if (!tSource.GetInterfaces ().Any (i => i.Name == "IValueChange")){ -// Debug.WriteLine ("Binding source does not implement IValueChange."); -// continue; -// } - //MemberInfo mi = binding.Source.GetType ().GetMember (binding.MemberName); + while (Bindings.Count > 0) { + DynAttribute binding = Bindings [0]; + Bindings.RemoveAt (0); CompilerServices.CreateBinding (binding, hostClass); } +// foreach (DynAttribute binding in Bindings) { +//// Type tSource = binding.Source.GetType (); +//// if (!tSource.GetInterfaces ().Any (i => i.Name == "IValueChange")){ +//// Debug.WriteLine ("Binding source does not implement IValueChange."); +//// continue; +//// } +// //MemberInfo mi = binding.Source.GetType ().GetMember (binding.MemberName); +// CompilerServices.CreateBinding (binding, hostClass); +// } +// Bindings.Clear (); } public static GraphicObject Load(Stream stream, Type type, object hostClass = null) { @@ -185,17 +190,22 @@ namespace go fi.SetValue(es.Source, del); } } - - foreach (DynAttribute binding in Bindings) { - // Type tSource = binding.Source.GetType (); - // if (!tSource.GetInterfaces ().Any (i => i.Name == "IValueChange")){ - // Debug.WriteLine ("Binding source does not implement IValueChange."); - // continue; - // } - //MemberInfo mi = binding.Source.GetType ().GetMember (binding.MemberName); + while (Bindings.Count > 0) { + DynAttribute binding = Bindings [0]; + Bindings.RemoveAt (0); CompilerServices.CreateBinding (binding, hostClass); } +// foreach (DynAttribute binding in Bindings) { +// // Type tSource = binding.Source.GetType (); +// // if (!tSource.GetInterfaces ().Any (i => i.Name == "IValueChange")){ +// // Debug.WriteLine ("Binding source does not implement IValueChange."); +// // continue; +// // } +// //MemberInfo mi = binding.Source.GetType ().GetMember (binding.MemberName); +// CompilerServices.CreateBinding (binding, hostClass); +// } +// Bindings.Clear (); return result; } |