
176 Chapter 7: Creating an Operation
Creating a New Generalized Operation iTool Developer’s Guide
RETURN, 1
END
Discussion
The ExampleOp operation RecordFinalValues method simply loops through the
supplied list of target objects, recording the new value for the STYLE property in the
IDLitCommand object associated with each target.
Creating a GetProperty Method
The operation class GetProperty method retrieves property values from the operation
object instance or from instance data of other associated objects. It should retrieve the
requested property value, either from the operation object’s instance data or by
calling another class’ GetProperty method.
Note
Any property registered with a call to the RegisterProperty method must be listed as
a keyword to the GetProperty method either of the operation class or one of its
superclasses.
See “IDLitOperation::GetProperty” (IDL Reference Guide) for additional details.
Example GetProperty Method
The following example code shows a very simple GetProperty method for the
ExampleOp operation:
PRO ExampleOp::GetProperty, _REF_EXTRA = _extra
; get superclass properties
IF (N_ELEMENTS(_extra) GT 0) THEN $
self->IDLitOperation::GetProperty, _EXTRA = _extra
END
Discussion
The GetProperty method first defines the keywords it will accept. There must be a
keyword for each property of the operation type. The keyword inheritance
mechanism allows properties to be retrieved from the
ExampleOp class’ superclasses
without knowing the names of the properties.