aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Controls/Notification.cs
blob: b5e1693e6a9ac88eb55af5c414c340d904458f19 (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
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;

namespace ShiftOS
{
    public partial class Notification : UserControl
    {
        public Notification(string title, string text)
        {
            InitializeComponent();
            Title = title;
            Message = text;
            var t = new Timer();
            t.Interval = 5000;
            t.Tick += (object s, EventArgs a) =>
            {
                this.Dispose();
            };
            t.Start();
        }

        public string Title { get; set; }
        public string Message { get; set; }

        private void Notification_Load(object sender, EventArgs e)
        {
            API.PlaySound(Properties.Resources.rolldown);
            lbtitle.Text = Title;
            lbmessage.Text = Message;
        }
    }
}