Your dll stay loaded the whole time, so just add a timer, that checks, lets say every 10 seconds, and if a threshold is exceeded bring up a dialog....pseudocode ahead:
Code:if(threshholdexceeded) { GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); dlgYesNo.SetHeading(GUILocalizeStrings.Get("Warning - PC about to explode")); dlgYesNo.SetLine(1, "Warning, Threshold for CPU Temp exceeded - 100°C!!!"); dlgYesNo.SetLine(2, "Want to show the status window?"); dlgYesNo.DoModal(GUIWindowManager.ActiveWindow); // show the dialog if (dlgYesNo.IsConfirmed) // user clicked yes { GUIWindowManager.ActivateWindow(YOUR_WINDOW_ID); // jump to your plugins window so user can see all values } }
public bool showDialogOnThreshold(ArrayList hits)
{
if (GUIWindowManager.ActiveWindow != GetID)
protected override void OnPageDestroy(int newWindowId)
{
if (timer != null && timer.Enabled)
{
timer.Stop();
}
Info("PAGEDESTROY");
if (wantsAlarm)
startAlarmTimer();
}
2008-04-01 19:15:24.750000 [Info.][11]: Exception :Fehler in der Anwendung.
-2005530516 (D3DERR_INVALIDCALL)
bei Microsoft.DirectX.Direct3D.Device.BeginScene()
bei MediaPortalApp.Render(Single timePassed)
2008-04-01 19:15:24.750000 [Info.][11]: Exception :Fehler in der Anwendung.
2008-04-01 19:15:24.750000 [Info.][11]: site :Void BeginScene()
2008-04-01 19:15:24.750000 [Info.][11]: source :Microsoft.DirectX.Direct3D
2008-04-01 19:15:24.750000 [Info.][11]: stacktrace: bei Microsoft.DirectX.Direct3D.Device.BeginScene()
bei MediaPortalApp.Render(Single timePassed)
SFLog20080413-0001.csv
--------------------------------------------------------------
Seconds
1155
1157
1160
1164
1167
1170
1173
1176
1179
1182
1185
1188
1191
1194
1197