Exemplo n.º 1
0
        public static AppUsageStartReason ToStartReason(this SystemStateChange ssc)
        {
            switch (ssc)
            {
            case SystemStateChange.MonitorOn:
                return(AppUsageStartReason.MonitorOn);

            case SystemStateChange.Resume:
                return(AppUsageStartReason.Resume);

            default:
                throw new Exception();
            }
        }
Exemplo n.º 2
0
        public static AppUsageEndReason ToEndReason(this SystemStateChange ssc)
        {
            switch (ssc)
            {
            case SystemStateChange.MonitorOff:
                return(AppUsageEndReason.MonitorOff);

            case SystemStateChange.Suspend:
                return(AppUsageEndReason.Suspend);

            case SystemStateChange.Logoff:
                return(AppUsageEndReason.Logoff);

            case SystemStateChange.Shutdown:
                return(AppUsageEndReason.Shutdown);

            default:
                throw new Exception();
            }
        }
Exemplo n.º 3
0
 private void RaiseSystemMainStateChanged(SystemStateChange stateChange)
 {
     SystemMainStateChanged(this, new SystemStateChangedArgs(stateChange));
 }
Exemplo n.º 4
0
 public SystemStateChangedArgs(SystemStateChange newState)
 {
     ChangedToState = newState;
 }
Exemplo n.º 5
0
 public static bool IsStartRecordingEvent(this SystemStateChange ssc)
 {
     return(StartRecordingEvents.Contains(ssc));
 }