Exemplo n.º 1
0
 /// <summary>
 /// Returns an array of all the listeners that have been associated
 /// with the named property.
 /// <para>
 /// Only the listeners in this context are returned.
 ///
 /// </para>
 /// </summary>
 /// <param name="propertyName"> the specified property </param>
 /// <returns> all of the {@code PropertyChangeListener}s associated with
 ///         the named property; if no such listeners have been added or
 ///         if {@code propertyName} is {@code null} or invalid, an empty
 ///         array is returned
 /// </returns>
 /// <seealso cref= #addPropertyChangeListener </seealso>
 /// <seealso cref= #removePropertyChangeListener </seealso>
 public virtual PropertyChangeListener[] GetPropertyChangeListeners(String propertyName)
 {
     lock (this)
     {
         return(CurrentChangeSupport.GetPropertyChangeListeners(propertyName));
     }
 }
Exemplo n.º 2
0
        // ***************************************************************
        // ***************************************************************


        /// <summary>
        /// Support for reporting bound property changes for Object properties.
        /// This method can be called when a bound property has changed and it will
        /// send the appropriate PropertyChangeEvent to any registered
        /// PropertyChangeListeners.
        /// </summary>
        /// <param name="propertyName"> the property whose value has changed </param>
        /// <param name="oldValue"> the property's previous value </param>
        /// <param name="newValue"> the property's new value </param>
        private void FirePropertyChange(String propertyName, Object oldValue, Object newValue)
        {
            if (oldValue != null && newValue != null && oldValue.Equals(newValue))
            {
                return;
            }
            CurrentChangeSupport.FirePropertyChange(propertyName, oldValue, newValue);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Removes a {@code PropertyChangeListener} from the listener list
 /// for a specific property.
 /// <para>
 /// The {@code PropertyChangeListener} must be from this context.
 /// </para>
 /// <para>
 /// If {@code propertyName} or {@code listener} is {@code null} or invalid,
 /// no exception is thrown and no action is taken.
 ///
 /// </para>
 /// </summary>
 /// <param name="propertyName"> the specified property </param>
 /// <param name="listener"> the PropertyChangeListener to be removed
 /// </param>
 /// <seealso cref= #addPropertyChangeListener </seealso>
 /// <seealso cref= #getPropertyChangeListeners </seealso>
 public virtual void RemovePropertyChangeListener(String propertyName, PropertyChangeListener listener)
 {
     lock (this)
     {
         if (listener == null)
         {
             return;
         }
         CurrentChangeSupport.RemovePropertyChangeListener(propertyName, listener);
     }
 }