示例#1
0
 private void Attach()
 {
     this.Detach();
     if (this.target != null && this.binding != null)
     {
         this.listener = this.GetListener();
         this.listener.Attach(this.target, this.binding);
     }
 }
示例#2
0
 private BindingListener.DependencyPropertyListener GetListener()
 {
     BindingListener.DependencyPropertyListener dependencyPropertyListener;
     if (BindingListener.freeListeners.Count != 0)
     {
         dependencyPropertyListener = BindingListener.freeListeners[BindingListener.freeListeners.Count - 1];
         BindingListener.freeListeners.RemoveAt(BindingListener.freeListeners.Count - 1);
         return(dependencyPropertyListener);
     }
     dependencyPropertyListener          = new BindingListener.DependencyPropertyListener();
     dependencyPropertyListener.Changed += new EventHandler <BindingChangedEventArgs>(this.HandleValueChanged);
     return(dependencyPropertyListener);
 }
		private void Attach()
		{
			this.Detach();
			if (this.target != null && this.binding != null)
			{
				this.listener = this.GetListener();
				this.listener.Attach(this.target, this.binding);
			}
		}
		private void ReturnListener()
		{
			this.listener.Changed -= new EventHandler<BindingChangedEventArgs>(this.HandleValueChanged);
			BindingListener.freeListeners.Add(this.listener);
			this.listener = null;
		}
		private BindingListener.DependencyPropertyListener GetListener()
		{
			BindingListener.DependencyPropertyListener dependencyPropertyListener;
			if (BindingListener.freeListeners.Count != 0)
			{
				dependencyPropertyListener = BindingListener.freeListeners[BindingListener.freeListeners.Count - 1];
				BindingListener.freeListeners.RemoveAt(BindingListener.freeListeners.Count - 1);
				return dependencyPropertyListener;
			}
			dependencyPropertyListener = new BindingListener.DependencyPropertyListener();
			dependencyPropertyListener.Changed += new EventHandler<BindingChangedEventArgs>(this.HandleValueChanged);
			return dependencyPropertyListener;
		}
示例#6
0
 private void ReturnListener()
 {
     this.listener.Changed -= new EventHandler <BindingChangedEventArgs>(this.HandleValueChanged);
     BindingListener.freeListeners.Add(this.listener);
     this.listener = null;
 }