Ejemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        /// constructor
        /* ----------------------------------------------------------------- */
        public UserSetting()
        {
            try {
                RegistryKey subkey = Registry.LocalMachine.OpenSubKey(REG_ROOT, false);
                if (subkey != null) {
                    _version = subkey.GetValue(REG_PRODUCT_VERSION, REG_VALUE_UNKNOWN) as string;
                }

                OperatingSystem info = Environment.OSVersion;
                if (info.Version.Major > 5) this._scheme = new PowerSchemeVista();
                else this._scheme = new PowerSchemeXP();
                this._default.ProfileName = this._scheme.Active.Name;
                this._default.ACValues.MonitorTimeout = this._scheme.Active.Policy.user.VideoTimeoutAc;
                this._default.ACValues.DiskTimeout = this._scheme.Active.Policy.user.SpindownTimeoutAc;
                this._default.ACValues.StandByTimeout = this._scheme.Active.Policy.user.IdleTimeoutAc;
                this._default.ACValues.HibernationTimeout = this._scheme.Active.Policy.mach.DozeS4TimeoutAc;
                this._default.ACValues.ThrottlePolicy = (PowerThrottlePolicy)this._scheme.Active.Policy.user.ThrottlePolicyAc;
                this._default.ACValues.DimTimeout = this._scheme.Active.DimTimeout;
            }
            catch (Exception /* err */) {
                // Nothing to do
            }
        }
Ejemplo n.º 2
0
 public PowerSchemeEventArgs(IPowerScheme powerScheme)
 {
     PowerScheme = powerScheme;
 }
Ejemplo n.º 3
0
 /* ----------------------------------------------------------------- */
 /// constructor
 /* ----------------------------------------------------------------- */
 public ScheduleForm(IPowerScheme scheme)
 {
     this._scheme = scheme;
     this.Initialize();
 }
Ejemplo n.º 4
0
 public StatePowerScheme(IPowerScheme powerScheme, object value = null)
 {
     PowerScheme = powerScheme;
     Value       = value;
 }