diff options
Diffstat (limited to 'ShiftOS.WinForms/DesktopWidgets/Clock.cs')
| -rw-r--r-- | ShiftOS.WinForms/DesktopWidgets/Clock.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/DesktopWidgets/Clock.cs b/ShiftOS.WinForms/DesktopWidgets/Clock.cs new file mode 100644 index 0000000..aa29e2e --- /dev/null +++ b/ShiftOS.WinForms/DesktopWidgets/Clock.cs @@ -0,0 +1,45 @@ +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.Engine; + +namespace ShiftOS.WinForms.DesktopWidgets +{ + [DesktopWidget("Clock", "Show a clock on the desktop.")] + [RequiresUpgrade("desktop_clock_widget")] + public partial class Clock : UserControl, IDesktopWidget + { + public Clock() + { + InitializeComponent(); + tmr = new Timer(); + tmr.Tick += (o, a) => + { + lbtime.Text = Applications.Terminal.GetTime(); + }; + tmr.Interval = 100; + } + + Timer tmr = new Timer(); + + public void OnSkinLoad() + { + Tools.ControlManager.SetupControls(this); + } + + public void OnUpgrade() + { + } + + public void Setup() + { + tmr.Start(); + } + } +} |
