aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-05 11:34:17 -0400
committerMichael <[email protected]>2017-05-05 11:34:17 -0400
commit39b3b4c62c88cb94ce7a5ecefe38754aac4dc3f7 (patch)
treef70da64c0fb4b4850e87253cae05d6f234e06e5e /ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs
parenta57b5855f5a2b7e5f89e411a5cbe66dd0dcb50d6 (diff)
downloadshiftos_thereturn-39b3b4c62c88cb94ce7a5ecefe38754aac4dc3f7.tar.gz
shiftos_thereturn-39b3b4c62c88cb94ce7a5ecefe38754aac4dc3f7.tar.bz2
shiftos_thereturn-39b3b4c62c88cb94ce7a5ecefe38754aac4dc3f7.zip
admin.set_acl and other things
Diffstat (limited to 'ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs')
-rw-r--r--ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs
new file mode 100644
index 0000000..d38cdc3
--- /dev/null
+++ b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.WinForms.Tools;
+using ShiftOS.Engine;
+
+namespace ShiftOS.WinForms.DesktopWidgets
+{
+ [DesktopWidget("Server ping", "See the time spent between client requests and server replies in the digital society.")]
+ public partial class HeartbeatWidget : UserControl, IDesktopWidget
+ {
+ public HeartbeatWidget()
+ {
+ InitializeComponent();
+ tmr.Interval = 1;
+ tmr.Tick += (o, a) =>
+ {
+ if(ts != ServerManager.DigitalSocietyPing)
+ {
+ ts = ServerManager.DigitalSocietyPing;
+ lbheartbeat.Text = "Server ping: " + ts.ToString();
+ }
+ };
+ }
+
+ //Fun fact. I misspelled this as "TimeSpam."
+ TimeSpan ts;
+
+ public void OnSkinLoad()
+ {
+ ControlManager.SetupControls(this);
+ }
+
+ public void OnUpgrade()
+ {
+ }
+
+ Timer tmr = new Timer();
+
+ public void Setup()
+ {
+ tmr.Start();
+ }
+ }
+}