2using System.ServiceModel;
31 mMainWindow = System.Windows.Forms.Control.FromHandle(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle) as System.Windows.Forms.Form;
36 someParameter = someParameter.ToLowerInvariant();
46 mMainWindow.WindowState = System.Windows.Forms.FormWindowState.Minimized;
49 mMainWindow.WindowState = System.Windows.Forms.FormWindowState.Maximized;
55 System.Windows.Forms.MessageBox.Show(
"Could not get main window");
57 return System.Windows.Forms.MessageBox.Show(
58 $
"Plugin does something on remote request: {someParameter}\nSucceeded?",
59 "Remote request to plugin",
60 System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes;
62 private static ServiceHost
mHost;
65 System.Diagnostics.Trace.WriteLine(
"Remote plugin service failed.");
70 internal static void StartService()
82 if (
mHost?.State == CommunicationState.Opened)
Classes and interfaces that are meant for plugins. The classes and interfaces below this namespace ar...
Interaction with Chronos crossing the process barrier. A normal Chronos plugin is a class library loa...
The classes in this namespace demonstrate how to interact with the Chronos sample list.
Very basic service, only to show that you can trigger some action from outside and get a response.
To avoid duplicating the endpoint definition in server and client.
Example for communication with external programs.
static void StopService()
System.Windows.Forms.Form mMainWindow
bool DoSomething(string someParameter)
Just uses a messagebox to show the external request.
static void HostFaultedHandler(object sender, EventArgs e)