Beispiel #1
0
        /// <summary>
        /// Handler for the session status switch event.
        /// </summary>
        /// <param name="sender">Sending object.</param>
        /// <param name="e">The event.</param>
        void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
        {
            switch (e.Reason)
            {
            case SessionSwitchReason.SessionLock:
            {
                if (Properties.Settings.Default.ActivateOnLock)
                {
                    log.DebugFormat("ActivateOnLock: Changing status to {0}", Properties.Settings.Default.LockAction);
                    Skype.ChangeStatus(Properties.Settings.Default.LockAction);
                }

                break;
            }

            case SessionSwitchReason.SessionUnlock:
            {
                if (Properties.Settings.Default.ActivateOnUnlock)
                {
                    log.DebugFormat("ActivateOnUnlock: Changing status to {0}", Properties.Settings.Default.UnlockAction);
                    Skype.ChangeStatus(Properties.Settings.Default.UnlockAction);
                }

                break;
            }

            case SessionSwitchReason.RemoteConnect:
            {
                if (Properties.Settings.Default.ActivateOnRdConnect)
                {
                    log.DebugFormat("ActivateOnRdConnect: Changing status to {0}", Properties.Settings.Default.RdConnectAction);
                    Skype.ChangeStatus(Properties.Settings.Default.RdConnectAction);
                }

                break;
            }

            case SessionSwitchReason.RemoteDisconnect:
            {
                if (Properties.Settings.Default.ActivateOnRdDisconnect)
                {
                    log.DebugFormat("ActivateOnRdDisconnect: Changing status to {0}", Properties.Settings.Default.RdDisconnectAction);
                    Skype.ChangeStatus(Properties.Settings.Default.RdDisconnectAction);
                }

                break;
            }
            }
        }
Beispiel #2
0
        public void StatusCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Status newStatus = (Status)Enum.Parse(typeof(Status), e.Parameter.ToString());

            Skype.ChangeStatus(newStatus);
        }