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

Contents of /trunk/NexusPowerControl/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations) (download)
Sat Oct 22 22:31:33 2011 UTC (8 years, 1 month ago) by william
File size: 2118 byte(s)
*** implement theme button clicks

1 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 public partial class Form1 : Form
13 {
14 public Form1()
15 {
16 InitializeComponent();
17 }
18
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
26 if (theme.ThemeLoaded)
27 {
28 pic_main.Image = Image.FromFile(theme.MainImage);
29 }
30
31
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 }
39
40 private void btnShutdown_Click(object sender, EventArgs e)
41 {
42 // shutdown the computer
43 }
44
45 private void btnRestart_Click(object sender, EventArgs e)
46 {
47 // restart the computer
48 }
49
50 private void btnLogoff_Click(object sender, EventArgs e)
51 {
52 // logoff the current user
53 }
54
55 private void btnLockScreen_Click(object sender, EventArgs e)
56 {
57 // lock the screen
58 }
59
60 private void btnSleep_Click(object sender, EventArgs e)
61 {
62 // put the computer to sleep
63 }
64
65 private void btnClose_Click(object sender, EventArgs e)
66 {
67 // close this dialog
68 this.Close();
69 }
70
71
72
73 }
74 }

  ViewVC Help
Powered by ViewVC 1.1.22