The Cascaded RealTimeStylus Model
The Cascaded RealTimeStylus Model |
Overview of the cascaded model for the RealTimeStylus class.
The cascaded RealTimeStylus model allows you to use two RealTimeStylus objects, each running on its own thread. With this model, you attach a secondary RealTimeStylus object to a primary RealTimeStylus object. The secondary RealTimeStylus object is attached as the only asynchronous plug-in in the primary RealTimeStylus object's asynchronous plug-in collection.
The cascaded RealTimeStylus model may be useful in the following scenarios.
- You can add certain tasks that may be computationally demanding yet still require real-time access to the tablet pen's data stream—such as multistroke gesture recognition—to the secondary RealTimeStylus object's synchronous plug-in collection.
- You can spread the computational load of your synchronous plug-ins over two threads, reducing delays in ink collection on some Tablet PCs.
Constraints
If you use the default RealTimeStylus constructor, you create a RealTimeStylus object that can only accept input from another RealTimeStylus object.
The following list describes the constraints associated with using the cascaded RealTimeStylus model.
- Only two RealTimeStylus objects may be used, a primary RealTimeStylus object and a secondary RealTimeStylus object.
- The primary RealTimeStylus object must be created with a constructor that uses the attachedControl or handle parameter. The secondary RealTimeStylus object must be created with the no-argument constructor.
- The secondary RealTimeStylus object must be the only asynchronous plug-in in the primary RealTimeStylus object's asynchronous plug-in collection.
- A secondary RealTimeStylus object only functions while it is attached to one primary RealTimeStylus object. If it is added to more than one primary RealTimeStylus object, it stops functioning and an ErrorData object is added to the primary RealTimeStylus objects' input queues.
- The behavior of some of the secondary RealTimeStylus object's members is modified. The following table describes the modified behavior of these members.
Member Behavior GetDesiredPacketDescription This method returns the information from the primary RealTimeStylus object. If the secondary RealTimeStylus is not attached to a primary RealTimeStylus object, this method returns the default value. SetDesiredPacketDescription This method raises an InvalidOperationException exception. GetStyluses This method returns the information from the primary RealTimeStylus object. If the secondary RealTimeStylus is not attached to a primary RealTimeStylus object, this method returns an empty array. Enabled Getting this property returns the information from the primary RealTimeStylus object. If the secondary RealTimeStylus is not attached to a primary RealTimeStylus object, getting this property returns the default value. Note: Setting this property raises an InvalidOperationException exception.WindowInputRectangle Getting this property returns the information from the primary RealTimeStylus object. If the secondary RealTimeStylus is not attached to a primary RealTimeStylus object, getting this property returns the default value. Note: Setting this property raises an InvalidOperationException exception.