Ejemplo n.º 1
0
		public void Deny_Unrestricted ()
		{
			SessionEndingEventArgs seea = new SessionEndingEventArgs (SessionEndReasons.SystemShutdown);
			Assert.AreEqual (SessionEndReasons.SystemShutdown, seea.Reason, "Reason");
			Assert.IsFalse (seea.Cancel, "Cancel-false");
			seea.Cancel = true;
			Assert.IsTrue (seea.Cancel, "Cancel-true");
		}
Ejemplo n.º 2
0
        void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
        {
            this.Shutdown = true;

            this.KillScadaProcess(new string[]
                {
                    "MDS.exe",
                    "AIS.exe",
                    "Scada.*",
                });
        }
Ejemplo n.º 3
0
        void SystemEvents_SessionEnding(object sender, Microsoft.Win32.SessionEndingEventArgs e)
        {
            switch (e.Reason)
            {
            case SessionEndReasons.Logoff:
                Logger.LogMessage("Log-off", -1);
                break;

            case SessionEndReasons.SystemShutdown:
                Logger.LogMessage("Shutdown", -1);
                break;
            }
            Stop();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 시스템 종료시 프로세스 종료
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SystemEvents_SessionEnding(object sender, Microsoft.Win32.SessionEndingEventArgs e)
 {
     try
     {
         if (connection.IsConnected)
         {
             ProcessLogOut();
         }
         Process.GetCurrentProcess().Kill();
     }
     catch (Exception ex)
     {
         Logger.error(ex.ToString());
     }
 }
Ejemplo n.º 5
0
        public void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
        {
            // This event occurs when the user is trying to log off or shut down
            // the system.

            // If you are using SessionEnding in a Windows form to detect
            // a system logoff or reboot, there is no deterministic way to decide
            // whether the Closing event will fire before this event.
            // If you want to perform some special tasks before Closing is fired,
            // you need to ensure that SessionEnding fires before Closing. To do this,
            // you need to trap the WM_QUERYENDSESSION in the form by overriding the
            // WndProc function (see the example in Help)

            // Because this is a static event, you must detach your event handlers
            // when your application is disposed, or memory leaks will result.

            // NOTE: Ovaj event je bio potreban u NET 1.1 (da bi se proverilo da li
            // u otvorenim formama ima neceg sto bi trebalo snimiti), ali se u NET 2.0
            // moze koristiti event FormClosing (slucaj kada je e.CloseReason ==
            //  CloseReason.WindowsShutDown)
        }
 private void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     Disable();
 }
Ejemplo n.º 7
0
        /// <summary>Prevents the system from shutting down until the installation is safely stopped.</summary>
        /// <param name="sender">The object that called the event.</param>
        /// <param name="e">The <see cref="Microsoft.Win32.SessionEndingEventArgs" /> instance containing the event data.</param>
        static void PreventClose(object sender, SessionEndingEventArgs e)
        {
            if (notifyIcon != null)
            {
                notifyIcon.Visible = false;
                notifyIcon.Dispose();
                notifyIcon = null;
            }

            using (
                FileStream fs =
                    File.Create(Path.Combine(Environment.ExpandEnvironmentVariables("%WINDIR%"), "Temp", "abort.lock")))
            {
                fs.WriteByte(0);
            }

            e.Cancel = true;
        }
Ejemplo n.º 8
0
 private void OnSessionEnding(object sender, SessionEndingEventArgs e)
 {
     StopWatch();
 }
Ejemplo n.º 9
0
 private void OnSessionEnding(object sender, SessionEndingEventArgs e)
 {
     if(m_evHandler != null) m_evHandler(sender, e);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Evento de cierre de sesión
 /// </summary>
 /// <param name="sender">Objeto que lanza el evento</param>
 /// <param name="e">Argumentos del evento</param>
 private void SessionEnding(object sender, SessionEndingEventArgs e)
 {
     if (e.Reason == SessionEndReasons.SystemShutdown)
     {
         this.StopAll("System shutdown");
     }
 }
Ejemplo n.º 11
0
Archivo: GUI.cs Proyecto: ADTC/VietOCR
 // Event handlers
 void OnSessionEnding(object obj, SessionEndingEventArgs seea)
 {
     seea.Cancel = !OkToTrash();
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Event handler for the SessionEnding event
 /// Attempt to save the settings
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSessionEnding(object sender, SessionEndingEventArgs e)
 {
     smf.Exit();
     saveSettings();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Handles the SessionEnding events, allowing the client to terminate if the system
 /// is shutting down but not be affected if the user is simply logging off.
 /// </summary>
 /// <param name="sender">The object related to the event.</param>
 /// <param name="e">The arguments related to the event.</param>
 private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     try
     {
         if(e.Reason == SessionEndReasons.SystemShutdown)
         {
             Client client = Client.Instance();
             client.mustTerminate = true;
             e.Cancel = false;
         }
     }
     catch
     {}
 }
Ejemplo n.º 14
0
		private void SessionEndingCallback (object o, SessionEndingEventArgs args)
		{
		}
Ejemplo n.º 15
0
        //=========================================================================
        ///	<summary>
        ///		OSのセッション終了時のハンドラ
        /// </summary>
        /// <remarks>
        ///		放送時間直前や放送中ならシャットダウンを拒否する。
        /// </remarks>
        /// <history>2008/03/26 新規作成</history>
        //=========================================================================
        private static void OnSessionClosing( object sender, SessionEndingEventArgs args )
        {
            Logger.Output( "Windowsセッション終了" );

            //// <TEST> 2009/03/25 ->
            //            if (true)
            //            {
            //                MessageBox.Show("シャットダウンをキャンセルしました。");
            //                Logger.Output("...放送中または直前のため終了をキャンセルします");
            //                args.Cancel = true;
            //                return;
            //            }
            //// <TEST> 2009/03/25 <-

            Cleanup();	// メッセージループを出てからでは間に合わない場合がある

            Application.Exit();
        }
Ejemplo n.º 16
0
 void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     kill();
 }
Ejemplo n.º 17
0
 static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     SystemProcess.SetCritical(false); //Anti-BSOD
 }
 private int OnSessionEnding(IntPtr lParam)
 {
     SessionEndReasons systemShutdown = SessionEndReasons.SystemShutdown;
     if ((((long) lParam) & -2147483648L) != 0L)
     {
         systemShutdown = SessionEndReasons.Logoff;
     }
     SessionEndingEventArgs args = new SessionEndingEventArgs(systemShutdown);
     RaiseEvent(OnSessionEndingEvent, new object[] { this, args });
     return (args.Cancel ? 0 : 1);
 }
Ejemplo n.º 19
0
 void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     RedshiftProcess.Exited -= RedshiftProcess_Crashed;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Handles the SessionEnding event of the SystemEvents control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SessionEndingEventArgs"/> instance containing the event data.</param>
 static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     if (e.Reason == SessionEndReasons.SystemShutdown || !_isRunningAsService)
     {
         Shutdown();
     }
 }
Ejemplo n.º 21
0
		private void OnSessionEnding(object sender, SessionEndingEventArgs e)
		{
			if(m_evHandler != null)
				m_evHandler(sender, new SessionLockEventArgs(SessionLockReason.Ending));
		}
Ejemplo n.º 22
0
 static void SystemEventsSession(object sender, SessionEndingEventArgs sessionEndingEventArgs)
 {
     Application.Exit();
 }
Ejemplo n.º 23
0
		/// <summary>
		/// Handles the SessionEnding event of the SystemEvents control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="SessionEndingEventArgs"/> instance containing the event data.</param>
		static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
		{
			if (e.Reason == SessionEndReasons.SystemShutdown)
			{
				Shutdown();
			}
		}
Ejemplo n.º 24
0
 public void OnSessionEnding(object sender, SessionEndingEventArgs e)
 {
     Controller.CECActions.SuppressUpdates = true;
       Controller.Close();
 }
Ejemplo n.º 25
0
 public static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     Logger.Instance().Log( "Ended Hardware VoIP Monitor application" );
     Environment.Exit(1);
 }
Ejemplo n.º 26
0
    private static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
    {
      switch (e.Reason)
      {
        case SessionEndReasons.Logoff:
          MapEvent(MappingEvent.PC_Logoff, false);
          break;

        case SessionEndReasons.SystemShutdown:
          MapEvent(MappingEvent.PC_Shutdown, false);
          break;
      }
    }
Ejemplo n.º 27
0
 /// <summary>
 /// Handles the SessionEnding event of the SystemEvents control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SessionEndingEventArgs" /> instance containing the event data.</param>
 void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     // Try to shut down gracefully
     Shutdown();
 }
Ejemplo n.º 28
0
 private void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     if (Environment.HasShutdownStarted)
     {
         //Tackle Shutdown
     }
     else
     {
         //Tackle log off
     }
     this.ApplicationExit();
 }
Ejemplo n.º 29
0
 private void OnSessionEnding(object sender, SessionEndingEventArgs e)
 {
     Quit();
 }
Ejemplo n.º 30
0
 void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     System.Windows.Forms.Application.Exit();
 }
Ejemplo n.º 31
0
 static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
 {
     Helper.SystemRestarter.Abort();
 }
Ejemplo n.º 32
0
 private void m00006d(object p0, SessionEndingEventArgs p1)
 {
     this.m000001();
     base.Exit();
 }