From 39b3b4c62c88cb94ce7a5ecefe38754aac4dc3f7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 May 2017 11:34:17 -0400 Subject: admin.set_acl and other things --- .../DesktopWidgets/HeartbeatWidget.Designer.cs | 62 +++++++++++ ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs | 51 +++++++++ .../DesktopWidgets/HeartbeatWidget.resx | 120 +++++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.Designer.cs create mode 100644 ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.cs create mode 100644 ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.resx (limited to 'ShiftOS.WinForms/DesktopWidgets') diff --git a/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.Designer.cs b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.Designer.cs new file mode 100644 index 0000000..c6a7d83 --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.Designer.cs @@ -0,0 +1,62 @@ +namespace ShiftOS.WinForms.DesktopWidgets +{ + partial class HeartbeatWidget + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lbheartbeat = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lbheartbeat + // + this.lbheartbeat.AutoSize = true; + this.lbheartbeat.Dock = System.Windows.Forms.DockStyle.Fill; + this.lbheartbeat.Location = new System.Drawing.Point(0, 0); + this.lbheartbeat.Name = "lbheartbeat"; + this.lbheartbeat.Size = new System.Drawing.Size(35, 13); + this.lbheartbeat.TabIndex = 0; + this.lbheartbeat.Text = "label1"; + // + // HeartbeatWidget + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.Controls.Add(this.lbheartbeat); + this.Name = "HeartbeatWidget"; + this.Size = new System.Drawing.Size(35, 13); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lbheartbeat; + } +} 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(); + } + } +} diff --git a/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.resx b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/HeartbeatWidget.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file -- cgit v1.2.3