/[NexusPowerControl]/trunk/NexusPowerControl/MainUI.cs
ViewVC logotype

Annotation of /trunk/NexusPowerControl/MainUI.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13 - (hide annotations) (download)
Sat Oct 22 23:15:43 2011 UTC (9 years, 7 months ago) by william
File size: 2120 byte(s)
*** add desktop blur form / with timer to launch MainUI

1 william 4 using System;
2     using System.Collections.Generic;
3     using System.ComponentModel;
4     using System.Data;
5     using System.Drawing;
6     using System.Linq;
7     using System.Text;
8     using System.Windows.Forms;
9    
10     namespace NexusPowerControl
11     {
12 william 13 public partial class MainUI : Form
13 william 4 {
14 william 13 public MainUI()
15 william 4 {
16     InitializeComponent();
17     }
18 william 8
19     private void Form1_Load(object sender, EventArgs e)
20     {
21     // load theme
22     ThemeLoader loader = new ThemeLoader();
23     loader.LoadThemeOrDefault(NexusPowerControl.Properties.Settings.Default.ActiveThemeName);
24     ThemeLoader.ThemeDefinition theme = loader.GetLoadedTheme();
25 william 10
26     if (theme.ThemeLoaded)
27     {
28     pic_main.Image = Image.FromFile(theme.MainImage);
29     }
30    
31 william 11
32     btnShutdown.OnClickEvent += new EventHandler(btnShutdown_Click);
33     btnRestart.OnClickEvent += new EventHandler(btnRestart_Click);
34     btnLogoff.OnClickEvent += new EventHandler(btnLogoff_Click);
35     btnLockScreen.OnClickEvent += new EventHandler(btnLockScreen_Click);
36     btnSleep.OnClickEvent += new EventHandler(btnSleep_Click);
37     btnClose.OnClickEvent += new EventHandler(btnClose_Click);
38 william 8 }
39 william 10
40     private void btnShutdown_Click(object sender, EventArgs e)
41     {
42 william 12 // shutdown the computer
43 william 10 }
44    
45     private void btnRestart_Click(object sender, EventArgs e)
46     {
47 william 12 // restart the computer
48 william 10 }
49    
50     private void btnLogoff_Click(object sender, EventArgs e)
51     {
52 william 12 // logoff the current user
53 william 10 }
54    
55     private void btnLockScreen_Click(object sender, EventArgs e)
56     {
57 william 12 // lock the screen
58 william 10 }
59    
60     private void btnSleep_Click(object sender, EventArgs e)
61     {
62 william 12 // put the computer to sleep
63 william 10 }
64    
65     private void btnClose_Click(object sender, EventArgs e)
66     {
67 william 12 // close this dialog
68 william 11 this.Close();
69     }
70 william 10
71 william 11
72    
73 william 4 }
74     }

  ViewVC Help
Powered by ViewVC 1.1.22