Adding Context Participant Control to an Application
To enable an application to become a context participant create a class that implements the IContextParticipant interface. The class implementation is required to be a COM object. As a result the ComVisibleAttribute is required when declaring the class.
C#
[ComVisible(true)]T
public class ContextParticipant:IContextParticipant
{
}
VB
<ComVisible(True)>_
Public Class ContextParticipant
Implements IContextParticipant
End Class
Joining a Context Session To become a participant in a context session:
First create a Context Manager. The LEADTOOLS CCOW SDK provides a convenient method that allows you easily create a Context Manager. To create the Context Manager do the following:
IContextManager ContextManager = Utils.COMCreateObject
Once a context manager has been created, call the IContextManager.JoinCommonContext method to become a participant.
Current Context Participant State
After an application has joined a context session, call the IContextData.GetItemNames method and the IContextData.GetItemValues method to get the current context session state.
Leave or Suspend a Link to a Context Session
Rejoining a Context Session
If an application has suspended its participation in a context session by calling the IContextManager.SuspendParticipation method it can rejoin the session by calling the IContextManager.ResumeParticipation method. If the application has disconnected from the context session by calling the IContextManager.LeaveCommonContext method it will need to call the IContextManager.JoinCommonContext method to rejoin the context session.
Initiating a Context Change
When initiating a context change, an application needs to perform the following steps:
Handling a Survey To handle a survey request an application needs to respond to the IContextParticipant.ContextChangesPending method. It should return the appropriate response string (accept, conditionally _accept) based on the current application state.
Handling Survey Failure During a context change transaction, the application that instigated the context transaction informs participants that it has completed the context change by calling the ContextManager.EndContextChanges. If any participant applications are unable to make the change, the user will be informed that there is a problem. To complete the changes the instigating application will need to call IContextmanager.LeaveCommonContext. This disconnects the instigating application from the context session and prevents spreading the changes to the other session participants.
Participating in a Secure Context System In order to participate in a context system and securely bind to the ContextManager, an application needs to perform the following steps:
Authentication Repository The LEADTOOLS CCOW SDK implements the interface IAuthenticationRepository. Users wishing to implement an Authentication Repository need to derive a class from the IAuthenticationRepository interface.
public class AuthenticationRepository:IAuthenticationRepository
{
}
All context agents (mapping, annotation and action) implement the Leadtools.Ccow.IContextAgent interface. The difference between the context agents is in the implementation of the agent's Leadtools.Ccow.IContextParticipant.ContextChangesPending(System.Int32,System.String@) method.
Products |
Support |
Feedback: Implementing a Common Context in an Application |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.