Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dynamicprops class

Superclasses: handle

Superclass for classes that support dynamic properties

Description

dynamicprops is an abstract class derived from the handle class. Subclass dynamicprops to define classes that support dynamic properties.

classdef MyClass < dynamicprops makes MyClass a subclass of the dynamicprops class. Classes derived from dynamicprops can create objects that support dynamic properties (also know as instance properties). Dynamic properties are associated with a specific object of the class, but are not part of the class definition. Use dynamic properties to attach temporary data to objects.

Note

The isequal function always returns false when comparing objects that have dynamic properties, even if the properties have the same name and value. If you need to compare objects that contain dynamic properties, overload isequal for your class.

Methods

This class defines one method addprop and, as a subclass of the handle class, inherits all the handle class methods.

addpropAdd dynamic property

Events

PropertyAdded

Triggered when a property is added

NotifyAccess = private, ListenAccess = public

PropertyRemoved

Triggered when a property is removed

NotifyAccess = private, ListenAccess = public

ObjectBeingDestroyed

Triggered when the object is destroyed

NotifyAccess = private, ListenAccess = public

Event Data

The PropertyAdded and PropertyRemoved events pass event.DynamicPropertyEvent objects to listeners.

Property

Value

PropertyName

Name of property being added or removed

Source

Object that is the source of the event

EventName

Name of event

Attributes

ConstructOnLoadtrue
HandleCompatibletrue

To learn about attributes of classes, see Class Attributes.

Examples

Subclass dynamicprops

Derive a class from the dynamicprops class:

classdef MyClass < dynamicprops
   ...
end

Introduced in R2008a

Was this topic helpful?