Detect closing Repetier-Host
Hi!
I'm developing a webcam controller for Repetier-Host, using their Plugin development skills.
I can choose, open and close my webcams using my Plugin; but if I close directly Repetier-Host (using X windows button), my webcam still open. So I would like to introduce the "webcam-closing-command" in the "closing-RepetierHost" routine.
Thanks
Comments
RegisterNamedEvent("core:printerSettingsChanged", UpdateScripts);
The "UpdateScripts" as you have defined is a "FunctionStringObject(string function, object val)". But I don't know the second argument of "FunctionStringObject", its defined as "object val"... What do I have to put? I've tried diferents types of variables (int, string...).
void UpdateScripts(string evt, object data)
c# will do the rest. You won't use the second argument here. There are some events where they contain event specific content and need to be cast to right type. here just ignor eit.
The code is (if it helps someone):
------------------------------
public void PreInitilaize(IHost _host)
{
host=_host;
host.RegisterNameEvent("core:closing", ClosingApplication_Event);
}
void ClosingApplication_Event(string evt, object data)
{
webcam.ClosingWebCam();
}
------------------------------
Thanks