共用方式為


PropertyChangeSupport Class

Definition

This is a utility class that can be used by beans that support bound properties.

[Android.Runtime.Register("java/beans/PropertyChangeSupport", DoNotGenerateAcw=true)]
public class PropertyChangeSupport : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable
[<Android.Runtime.Register("java/beans/PropertyChangeSupport", DoNotGenerateAcw=true)>]
type PropertyChangeSupport = class
    inherit Object
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
PropertyChangeSupport
Attributes
Implements

Remarks

This is a utility class that can be used by beans that support bound properties. It manages a list of listeners and dispatches PropertyChangeEvents to them. You can use an instance of this class as a member field of your bean and delegate these types of work to it. The PropertyChangeListener can be registered for all properties or for a property specified by name.

Here is an example of PropertyChangeSupport usage that follows the rules and recommendations laid out in the JavaBeans&trade; specification:

public class MyBean {
                private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);

                public void addPropertyChangeListener(PropertyChangeListener listener) {
                    this.pcs.addPropertyChangeListener(listener);
                }

                public void removePropertyChangeListener(PropertyChangeListener listener) {
                    this.pcs.removePropertyChangeListener(listener);
                }

                private String value;

                public String getValue() {
                    return this.value;
                }

                public void setValue(String newValue) {
                    String oldValue = this.value;
                    this.value = newValue;
                    this.pcs.firePropertyChange("value", oldValue, newValue);
                }

                [...]
            }

A PropertyChangeSupport instance is thread-safe.

This class is serializable. When it is serialized it will save (and restore) any listeners that are themselves serializable. Any non-serializable listeners will be skipped during serialization.

Java documentation for java.beans.PropertyChangeSupport.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

PropertyChangeSupport(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

PropertyChangeSupport(Object)

Constructs a PropertyChangeSupport object.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AddPropertyChangeListener(IPropertyChangeListener)

Add a PropertyChangeListener to the listener list.

AddPropertyChangeListener(String, IPropertyChangeListener)

Add a PropertyChangeListener for a specific property.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FireIndexedPropertyChange(String, Int32, Boolean, Boolean)

Reports a boolean bound indexed property update to listeners that have been registered to track updates of all properties or a property with the specified name.

FireIndexedPropertyChange(String, Int32, Int32, Int32)

Reports an integer bound indexed property update to listeners that have been registered to track updates of all properties or a property with the specified name.

FireIndexedPropertyChange(String, Int32, Object, Object)

Reports a bound indexed property update to listeners that have been registered to track updates of all properties or a property with the specified name.

FirePropertyChange(PropertyChangeEvent)

Fires a property change event to listeners that have been registered to track updates of all properties or a property with the specified name.

FirePropertyChange(String, Boolean, Boolean)

Reports a boolean bound property update to listeners that have been registered to track updates of all properties or a property with the specified name.

FirePropertyChange(String, Int32, Int32)

Reports an integer bound property update to listeners that have been registered to track updates of all properties or a property with the specified name.

FirePropertyChange(String, Object, Object)

Reports a bound property update to listeners that have been registered to track updates of all properties or a property with the specified name.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPropertyChangeListeners()

Returns an array of all the listeners that were added to the PropertyChangeSupport object with addPropertyChangeListener().

GetPropertyChangeListeners(String)

Returns an array of all the listeners which have been associated with the named property.

HasListeners(String)

Check if there are any listeners for a specific property, including those registered on all properties.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RemovePropertyChangeListener(IPropertyChangeListener)

Remove a PropertyChangeListener from the listener list.

RemovePropertyChangeListener(String, IPropertyChangeListener)

Remove a PropertyChangeListener for a specific property.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to