Esempio n. 1
0
 private void pwrEvents_PowerLineStatusChanged(object sender, Events.EventArgsValues <PowerLineStatus> e)
 {
     if (e.NewValue == PowerLineStatus.Online)
     {
         this.Log.LogLineDate("The computer was connected to the power network", Trigger.Log.Type.PowerEvent);
     }
     else
     {
         this.Log.LogLineDate("The computer was disconnected from the power network", Trigger.Log.Type.PowerEvent);
     }
 }
        private void networkEvents_IpAddrChanged(object sender, Events.EventArgsValues <NetworkInterface> e)
        {
            this.Log.LogLineDate("IP changed: " + e.OldValue.Name + ":", Log.Type.NetworkEvent);
            UnicastIPAddressInformationCollection ipsOld = e.OldValue.GetIPProperties().UnicastAddresses;
            UnicastIPAddressInformationCollection ipsNew = e.NewValue.GetIPProperties().UnicastAddresses;

            for (int i = 0; i < Math.Max(ipsOld.Count, ipsNew.Count); i++)
            {
                if (ipsOld.Count > i)
                {
                    this.Log.LogTextDate(ipsOld[i].Address.ToString().PadRight(40), Log.Type.NetworkEvent);
                }
                else
                {
                    this.Log.LogTextDate(new String(' ', 40), Log.Type.NetworkEvent);
                }
                this.Log.LogText(" | ", Log.Type.NetworkEvent);
                if (ipsNew.Count > i)
                {
                    this.Log.LogText(ipsNew[i].Address.ToString(), Log.Type.NetworkEvent);
                }
                this.Log.Line(Log.Type.NetworkEvent);
            }
        }
Esempio n. 3
0
 private void pwrEvents_PowerSchemeChanged(object sender, Events.EventArgsValues <PowerScheme> e)
 {
     this.Log.LogLineDate("Power scheme changed: " + e.OldValue.Name + " --> " + e.NewValue.Name, Trigger.Log.Type.PowerEvent);
 }
Esempio n. 4
0
 private void pwrEvents_BatteryStatusChanged(object sender, Events.EventArgsValues <BatteryChargeStatus> e)
 {
     this.Log.LogLineDate("The status of the battery changed: " + e.OldValue.ToString() + " -> " + e.NewValue.ToString() + " (" + Status.Power.BatteryLifePercent.ToString() + "%)", Trigger.Log.Type.PowerEvent);
 }
 void screenEvents_ScreenRefreshRateChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The refresh rate of \"" + e.NewValue.Name + "\" has changed: " + e.OldValue.Frequency + "Hz -> " + e.NewValue.Frequency + "Hz", Log.Type.ScreenEvent);
 }
 void screenEvents_ScreenOrientationChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The orientation of \"" + e.NewValue.Name + "\" has changed: " + e.OldValue.Orientation + " -> " + e.NewValue.Orientation, Log.Type.ScreenEvent);
 }
 void screenEvents_ScreenLocationChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The Location of \"" + e.NewValue.Name + "\" has changed: " + e.OldValue.Bounds.X + "|" + e.OldValue.Bounds.Y + " -> " + e.NewValue.Bounds.X + "|" + e.NewValue.Bounds.Y, Log.Type.ScreenEvent);
 }
 void screenEvents_PrimaryScreenChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The primary screen is not \"" + e.OldValue.Name + "\" anymore but now \"" + e.NewValue.Name + "\"", Log.Type.ScreenEvent);
 }
 void screenEvents_ScreenResolutionChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The resolution of \"" + e.NewValue.Name + "\" has changed: " + e.OldValue.Bounds.Width + "x" + e.OldValue.Bounds.Height + " -> " + e.NewValue.Bounds.Width + "x" + e.NewValue.Bounds.Height, Log.Type.ScreenEvent);
 }
Esempio n. 10
0
 void screenEvents_ScreenColorDepthChanged(object sender, Events.EventArgsValues <ScreenEx> e)
 {
     this.Log.LogLineDate("The screen color depth of \"" + e.NewValue.Name + "\" has changed: " + e.OldValue.BitsPerPixel + "bit -> " + e.NewValue.BitsPerPixel + "bit", Log.Type.ScreenEvent);
 }