public void SessionChange(int SessionId, System.ServiceProcess.SessionChangeReason Reason, SessionProperties properties) { if (properties == null) { return; } m_logger.DebugFormat("SessionChange({0}) - ID: {1}", Reason.ToString(), SessionId); //If SessionMode is enabled, send event to it. if ((bool)Settings.Store.SessionMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.SESSION); mode.Log(SessionId, Reason, properties); } //If EventMode is enabled, send event to it. if ((bool)Settings.Store.EventMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.EVENT); mode.Log(SessionId, Reason, properties); } //Close the connection if it's still open LoggerModeFactory.closeConnection(); }
private void createTableBtn_Click(object sender, EventArgs e) { if (!Save()) { return; } try { string sessionModeMsg = null; string eventModeMsg = null; if ((bool)Settings.Store.SessionMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.SESSION); sessionModeMsg = mode.CreateTable(); } if ((bool)Settings.Store.EventMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.EVENT); eventModeMsg = mode.CreateTable(); } //Show one or both messages if (sessionModeMsg != null && eventModeMsg != null) { MessageBox.Show(String.Format("Event Mode Table: {0}\nSession Mode Table: {1}", eventModeMsg, sessionModeMsg)); } else { MessageBox.Show(sessionModeMsg ?? eventModeMsg); } } catch (Exception ex) { MessageBox.Show("The following error occurred: {0}", ex.Message); } //Since the server info may change, close the current connection LoggerModeFactory.closeConnection(); }
public void SessionChange(System.ServiceProcess.SessionChangeDescription changeDescription, pGina.Shared.Types.SessionProperties properties) { m_logger.DebugFormat("SessionChange({0}) - ID: {1}", changeDescription.Reason.ToString(), changeDescription.SessionId); //If SessionMode is enabled, send event to it. if ((bool)Settings.Store.SessionMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.SESSION); mode.Log(changeDescription, properties); } //If EventMode is enabled, send event to it. if ((bool)Settings.Store.EventMode) { ILoggerMode mode = LoggerModeFactory.getLoggerMode(LoggerMode.EVENT); mode.Log(changeDescription, properties); } //Close the connection if it's still open LoggerModeFactory.closeConnection(); }