diff options
| author | Michael VanOverbeek <[email protected]> | 2017-05-21 12:21:41 +0000 |
|---|---|---|
| committer | Michael VanOverbeek <[email protected]> | 2017-05-21 12:21:41 +0000 |
| commit | 31cc9148dd23737df16d8456a42d003cd31dd488 (patch) | |
| tree | f699644cd0384e80a673099374649b7350d6e02d /ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs | |
| parent | 3b1c71e6710c06a9e390f449589bd30cb2f4b7dd (diff) | |
| download | shiftos_thereturn-31cc9148dd23737df16d8456a42d003cd31dd488.tar.gz shiftos_thereturn-31cc9148dd23737df16d8456a42d003cd31dd488.tar.bz2 shiftos_thereturn-31cc9148dd23737df16d8456a42d003cd31dd488.zip | |
holy ashit
Diffstat (limited to 'ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs')
| -rw-r--r-- | ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs | 51 |
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..b0dc552 --- /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() + " MS"; + } + }; + } + + //Fun fact. I misspelled this as "TimeSpam." + long ts = 0; + + public void OnSkinLoad() + { + ControlManager.SetupControls(this); + } + + public void OnUpgrade() + { + } + + Timer tmr = new Timer(); + + public void Setup() + { + tmr.Start(); + } + } +} |
