aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/DesktopWidgets/Clock.cs
blob: aa29e2e5e3762374f7c865fc56a1e2f1796f7944 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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();
        }
    }
}