Freigeben über


Object State Foundation Class

Category Application
Default Catalog Visual FoxPro Catalog\Foundation Classes\Application
Class _objectstate
Base Class Custom
Class Library _app.vcx
Parent Class _custom
Sample ...\Samples\Solution\Ffc\environ.scx

Remarks

This class determines the state of an object. It saves and/or restores object property settings automatically or explicitly.

To use, drop the class on a project or form or, from the Component Gallery Item Shortcut Menu, select Add to Project or Add to Form. When you add the class to a form, provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods Description
aProperties[1,3] property The array for saving/restoring properties
of oObject.
Default: .F.
lAutomatic    property Specifies whether oObject properties are
saved and restored.
If this attribute is true (.T.), the
_ObjectState object will restore all the
attributes you've saved for its target
object when the _ObjectState object is
destroyed.
Default: .F.
oObject Reference to the target object whose
state is being saved.
Default: .NULL.
Restore method Restores the value of a property for
oObject if the value has changed. If
tcWhichProperty is not passed, all saved
properties of oObject are restored.
(This method is called with no argument
in the _ObjectState.Destroy( ) event
when _ObjectState.lAutomatic is true (.T.).
Syntax: Restore(tcWhichProperty)
Return:tcSave
Arguments:
tcWhichProperty specifies the property to
be restored.
tcSave specifies the value to be restored.
Save method Saves the current value of a property for oObject. You can use this instead of the tlSave argument of the Set method.
Syntax: Save(tcProperty, tcTypeValue)
Return: none
Arguments:
tcProperty specifies the property being
accessed.
tcTypeValue specifies the value being
saved for tcProperty.
Set method Sets a property to a new value for
oObject.
Syntax: Set(tcProperty, tvValue, tlSave)
Return:
Arguments:
tcProperty specifies the property to set.
tvValue specifies the value tcProperty is
to be set to.
tlSave specifies whether the current
value is retained for later restoration.

See Also

Guidelines for Using Visual FoxPro Foundation Classes | Visual FoxPro Foundation Classes A-Z | Visual FoxPro Foundation Classes