IDesignTimeControl Interface
Represents a DTC object that is an ActiveX control able to communicate with other controls using Choice objects.
Syntax
IDesignTimeControl
Remarks
To create a DTC object, implement these properties and methods. Choices-compliant (DTC) HTML editors call QueryInterface on contained design-time controls for the IDesignTimeControl interface and call methods on this interface to allow the control to publish and subscribe to choices. ActiveX controls must also implement the IPersistRuntimeText interface for the editor to recognize them as design-time controls.
DTC objects subscribe to choices in one of three ways:
-
Adding ChoiceFilter objects to the ChoiceSink object and listening for the OnChoiceChange method. (recommended)
-
Calling the AvailableChoices property on its IDesignTimeControlSite object. This is useful for populating popups in the user interface.
-
Examining the Choices collection passed to the OnRebind method. (Not recommended)
DTCs publish choices by adding two types of choices:
-
Static choices that remain in effect until removed by calling the Revoke method. Typically, these choices are the most efficient. They are created by adding new Choices in the Choices call of the IDesignTimeControlSite object. The Choices engine monitors changes to these choices and fires the appropriate rebinding mechanism automatically.
-
Dynamic choices are temporary and must be regenerated each time unless bound to a ChoiceSink. These choices are generated by calling the AddChoice method directly on the temporary Choices collection passed to the OnGetChoices method. Although dynamic choices are less efficient and can be difficult to use, they may be appropriate where the set of choices is constantly changing asynchronously. For example, dynamic choices might be useful if the choices are based on the tree within the file system.