aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-12-23 11:08:25 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-12-23 12:46:00 +0100
commitdecb4506152e9acd51200a9fb99076eaa4a78f63 (patch)
treed8c823d92ec8807d594c74b8d1b017b9e464907d /src/GraphicObjects
parent88ddb3a0896f3f5639ddd5eb7edc6133874b913f (diff)
Remove old datasource handler if not null
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs86
1 files changed, 1 insertions, 85 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 52450c34..b7913abd 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -538,12 +538,9 @@ namespace Crow
if (dataSource == value)
return;
- DataSourceChangeEventArgs dse = new DataSourceChangeEventArgs (dataSource, null);
-
+ DataSourceChangeEventArgs dse = new DataSourceChangeEventArgs (dataSource, value);
dataSource = value;
- dse.NewDataSource = DataSource;
-
OnDataSourceChanged (this, dse);
NotifyValueChanged ("DataSource", DataSource);
@@ -1237,87 +1234,6 @@ namespace Crow
ParentChanged.Raise (sender, e);
}
- #region Binding
-// public void BindMember(string _member, string _expression){
-// Bindings.Add(new Binding (this, _member, _expression));
-// }
-// public virtual void ResolveBindings()
-// {
-// if (Bindings.Count == 0)
-// return;
-// #if DEBUG_BINDING
-// Debug.WriteLine ("Resolve Bindings => " + this.ToString ());
-// #endif
-//
-// CompilerServices.ResolveBindings (Bindings);
-// }
-
- /// <summary>
- /// Remove dynamic delegates by ids from dataSource
- /// and delete ref of this in Shared interface refs
- /// </summary>
-// public virtual void ClearBinding(){
-// //dont clear binding if dataSource is not null,
-// foreach (Binding b in Bindings) {
-// try {
-// if (!b.Resolved)
-// continue;
-// //cancel compiled events
-// if (b.Target == null){
-// continue;
-// #if DEBUG_BINDING
-// Debug.WriteLine("Clear binding canceled for => " + b.ToString());
-// #endif
-// }
-// if (b.Target.Instance != DataSource){
-// #if DEBUG_BINDING
-// Debug.WriteLine("Clear binding canceled for => " + b.ToString());
-// #endif
-// continue;
-// }
-// #if DEBUG_BINDING
-// Debug.WriteLine("ClearBinding => " + b.ToString());
-// #endif
-// if (string.IsNullOrEmpty (b.DynMethodId)) {
-// b.Resolved = false;
-// if (b.Source.Member.MemberType == MemberTypes.Event)
-// removeEventHandler (b);
-// //TODO:check if full reset is necessary
-// continue;
-// }
-// MemberReference mr = null;
-// if (b.Target == null)
-// mr = b.Source;
-// else
-// mr = b.Target;
-// Type dataSourceType = mr.Instance.GetType();
-// EventInfo evtInfo = dataSourceType.GetEvent ("ValueChanged");
-// FieldInfo evtFi = CompilerServices.GetEventHandlerField (dataSourceType, "ValueChanged");
-// MulticastDelegate multicastDelegate = evtFi.GetValue (mr.Instance) as MulticastDelegate;
-// if (multicastDelegate != null) {
-// foreach (Delegate d in multicastDelegate.GetInvocationList()) {
-// if (d.Method.Name == b.DynMethodId)
-// evtInfo.RemoveEventHandler (mr.Instance, d);
-// }
-// }
-// b.Reset ();
-// } catch (Exception ex) {
-// Debug.WriteLine("\t Error: " + ex.ToString());
-// }
-// }
-// }
-// void removeEventHandler(Binding b){
-// FieldInfo fiEvt = CompilerServices.GetEventHandlerField (b.Source.Instance.GetType(), b.Source.Member.Name);
-// MulticastDelegate multiDel = fiEvt.GetValue (b.Source.Instance) as MulticastDelegate;
-// if (multiDel != null) {
-// foreach (Delegate d in multiDel.GetInvocationList()) {
-// if (d.Method.Name == b.Target.Member.Name)
-// b.Source.Event.RemoveEventHandler (b.Source.Instance, d);
-// }
-// }
-// }
- #endregion
-
#region IXmlSerializable
public virtual System.Xml.Schema.XmlSchema GetSchema ()
{