Exemplo n.º 1
0
        public PowerManager()
        {
            // See GUID values in WinNT.h.
            MaximumPerformance = NewPlan("8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c");
            Balanced = NewPlan("381b4222-f694-41f0-9685-ff5bb260df2e");
            PowerSourceOptimized = NewPlan("a1841308-3541-4fab-bc81-f71556f20b4a");

            // Add handler for power mode state changing.
            Microsoft.Win32.SystemEvents.PowerModeChanged += new Microsoft.Win32.PowerModeChangedEventHandler(PowerModeChangedHandler);
        }
 public void SetPowerPlan(PowerPlan powerPlan)
 {
     this.PowerPlanTb.Text = powerPlan.name;
     this.powerPlan = powerPlan;
 }
Exemplo n.º 3
0
 public void SetActive(PowerPlan plan)
 {
     PowerSetActiveScheme(IntPtr.Zero, ref plan.guid);
 }