Chronos Plugins  5.2.0
This documentation covers the plugin interfaces definitions and an example implementation.
MockPlugin.RemoteAccessTester.MessageTesterForm Class Reference

Shows how to communicate from an external program with a Plugin in order to trigger actions in Chronos. More...

+ Inheritance diagram for MockPlugin.RemoteAccessTester.MessageTesterForm:
+ Collaboration diagram for MockPlugin.RemoteAccessTester.MessageTesterForm:

Public Member Functions

 MessageTesterForm ()
 

Properties

IMockPlugin Service [get]
 Get the service when it is needed for the first time. More...
 

Private Member Functions

void tbMessage_KeyDown (object sender, KeyEventArgs e)
 When enter is pressed, send our parameter to the plugin provided service and show the result. More...
 

Private Attributes

IMockPlugin mService
 

Detailed Description

Shows how to communicate from an external program with a Plugin in order to trigger actions in Chronos.

Definition at line 10 of file RemoteTest.cs.

Constructor & Destructor Documentation

◆ MessageTesterForm()

MockPlugin.RemoteAccessTester.MessageTesterForm.MessageTesterForm ( )

Definition at line 12 of file RemoteTest.cs.

13  {
14  InitializeComponent();
15  }

Member Function Documentation

◆ tbMessage_KeyDown()

void MockPlugin.RemoteAccessTester.MessageTesterForm.tbMessage_KeyDown ( object  sender,
KeyEventArgs  e 
)
private

When enter is pressed, send our parameter to the plugin provided service and show the result.

Parameters
sender
e

Definition at line 40 of file RemoteTest.cs.

41  {
42  if (e.KeyCode == Keys.Enter)
43  {
44  try
45  {
46  var retval = Service.DoSomething(tbMessage.Text);
47  lvRequests.Items.Add(string.Format("Request {0}: Result {1}",tbMessage.Text, retval));
48  }
49  catch (Exception ex)
50  {
51  MessageBox.Show("Error accessing plugin: " + ex.Message);
52  }
53  }
54  }
bool DoSomething(string someParameter)
IMockPlugin Service
Get the service when it is needed for the first time.
Definition: RemoteTest.cs:23

References MockPlugin.RemoteAccessTester.IMockPlugin.DoSomething(), and MockPlugin.RemoteAccessTester.MessageTesterForm.Service.

Member Data Documentation

◆ mService

IMockPlugin MockPlugin.RemoteAccessTester.MessageTesterForm.mService
private

Definition at line 17 of file RemoteTest.cs.

Property Documentation

◆ Service

IMockPlugin MockPlugin.RemoteAccessTester.MessageTesterForm.Service
getprivate

Get the service when it is needed for the first time.

Definition at line 22 of file RemoteTest.cs.

23  {
24  get
25  {
26  if (mService == null)
27  {
28  var endpoint = new EndpointAddress(EndpointDef.Endpoint);
29  mService = ChannelFactory<IMockPlugin>.CreateChannel(new NetTcpBinding(), endpoint);
30  }
31  return mService;
32  }
33  }

Referenced by MockPlugin.RemoteAccessTester.MessageTesterForm.tbMessage_KeyDown().


The documentation for this class was generated from the following file: