public SessionInfo(string nickNameLeft, string nickNameRight, int GID, SessionStatus status) { this.nickNameLeft = nickNameLeft; this.nickNameRight = nickNameRight; this.GID = GID; this.status = status; }
/// <summary> /// Compares the server sessionStatus to the client one, and updates if needed. /// </summary> private void UpdateSessionStatus(SessionStatus myStateStatus) { if (LocalPlayer.Session.Status != myStateStatus) { LocalPlayer.SwitchState(myStateStatus); } }
#pragma warning restore CS0414 internal WearableUSBProvider() { _statusMessageSeparators = new char[] { '\n' }; _sessionStatus = SessionStatus.Closed; _statusMessage = new StringBuilder(8192); _uidBuilder = new StringBuilder(256); _nameBuilder = new StringBuilder(256); _sensorStatus = new Dictionary <SensorId, bool>(); _sensorUpdateInterval = WearableConstants.DefaultUpdateInterval; _rotationSource = WearableConstants.DefaultRotationSource; _sensorStatus.Add(SensorId.Accelerometer, false); _sensorStatus.Add(SensorId.Gyroscope, false); _sensorStatus.Add(SensorId.Rotation, false); _gestureStatus = new Dictionary <GestureId, bool>(); for (var i = 0; i < WearableConstants.GestureIds.Length; i++) { if (WearableConstants.GestureIds[i] == GestureId.None) { continue; } _gestureStatus.Add(WearableConstants.GestureIds[i], false); } }
public static SessionCompletionStatus ToSessionCompletionStatus(this SessionStatus status) { switch (status) { case SessionStatus.Completed: return(SessionCompletionStatus.Completed); case SessionStatus.TerminatedOnError: return(SessionCompletionStatus.TerminatedOnError); case SessionStatus.NotStarted: return(SessionCompletionStatus.NotStarted); case SessionStatus.InProgress: return(SessionCompletionStatus.InProgress); case SessionStatus.Suspended: return(SessionCompletionStatus.Suspended); case SessionStatus.EmergencyStopped: return(SessionCompletionStatus.EmergencyStopped); default: return(SessionCompletionStatus.NotStarted); } }
public static AccelerometerEvent GetDrivingData(int index, SessionStatus status) { var acecelEven = (status == SessionStatus.GoodDriver) ? GoodDriverData[index] : BadDriverData[index]; acecelEven.DeviceId = DeviceId; acecelEven.DriverId = DriverId; return acecelEven; }
/// <summary> /// Monitors the current device SessionStatus until a non-Open session status is returned. Once this has occured, /// the device has become disconnected and should render all state as such. /// </summary> private void MonitorDeviceSession() { #if UNITY_IOS && !UNITY_EDITOR string errorMessage = string.Empty; SessionStatus sessionStatus = (SessionStatus)WearableGetSessionStatus(ref errorMessage); if (sessionStatus != SessionStatus.Open) { if (string.IsNullOrEmpty(errorMessage)) { Debug.Log(WearableConstants.DeviceConnectionMonitorWarning); } else { Debug.LogFormat(WearableConstants.DeviceConnectionMonitorWarningWithMessage, errorMessage); } if (_connectedDevice != null) { OnDeviceDisconnected(_connectedDevice.Value); } _sensorStatus[SensorId.Accelerometer] = false; _sensorStatus[SensorId.Gyroscope] = false; _sensorStatus[SensorId.Rotation] = false; _sensorStatus[SensorId.GameRotation] = false; StopDeviceMonitor(); _connectedDevice = null; } #endif }
public Sessions(Player Left, Player Right, int GID) { this.Left = Left; this.Right = Right; this.GID = GID; status = SessionStatus.Free; }
public void SignIn(Session.SignInDelegate handler) { if (status == SessionStatus.NONE) { Result result = new Result(Result.NETMARBLES_DOMAIN, Result.SERVICE, "Not initialized"); if (handler != null) { handler(result); } } else if (status == SessionStatus.INITIALIZING) { waitForSignin = true; signInHandler = handler; } else if (status == SessionStatus.SIGNING) { Result result = new Result(Result.NETMARBLES_DOMAIN, Result.IN_PROGRESS, "It is currently in progress."); if (handler != null) { handler(result); } } else { status = SessionStatus.SIGNING; SignIn(OnSignIn, handler); } }
private void PulishEvent(string channel, SessionStatus ev) { // _context.Clients.Group(SessionStatus.TaskChannel).GetNotify(channel, ev); _context.Clients.All.GetNotify(channel, ev); // throw new NotImplementedException(); }
/// <summary> /// Destroys any existing session and unsubscribes from all events. /// </summary> public void DestroySession() { // Warn if already destroyed if (session == null) { Debug.LogWarning($"{nameof(DestroySession)} called but no session exists."); return; } // Make sure the session is stopped if (isSessionStarted) { StopSession(); } // Unsubscribe from session events session.OnLogDebug -= OnLogDebug; session.SessionUpdated -= OnSessionUpdated; session.AnchorLocated -= OnAnchorLocated; session.LocateAnchorsCompleted -= OnLocateAnchorsCompleted; session.Error -= OnError; // Dispose the session session.Dispose(); // Update session variable and raise notification through property setter Session = null; // Use property to raise event // Reset session status as well sessionStatus = null; }
public Guid StartSession(ComputationGraph graph) { Guid sessionId = Guid.NewGuid(); lock (_lockGuard) { _sessionGraphs.Add(sessionId, graph); _logger.LogInformation($"Create session with id: {sessionId}"); var session = new SessionStatus { OperationStatus = graph.Operations .Select(op => new OperationStatus { Id = op.Id, State = OperationState.Awaits }) .ToList(), MnemonicsTable = graph.MnemonicsTable }; _sessions.Add(sessionId, session); LogSessionStatus(sessionId); List <int> availableOperations = session.GetAvailableOperationsIds(_sessionGraphs[sessionId].Dependencies); EnqueueOperationsExecution(sessionId, availableOperations); return(sessionId); } }
public void AddNewSessions(int howMany, int pageSize, DateTime startDate, SessionStatus status = SessionStatus.Open) { var count = Sessions.Count; for (int i = count + 1; i <= count + howMany; i++) { var sss = new Session() { Id = i, TimeAndDate = startDate.AddDays(i - pageSize) }; switch (status) { case SessionStatus.Closed: sss.Close(); break; case SessionStatus.Cancelled: sss.Cancel(); break; default: break; } Sessions.Add(sss); } }
public void StopSession(Guid id) { ComputationGraph session = sessionDictionary[id]; SessionStatus status = sessionStatus[id]; if (SessionUtilities.SessionCompleted(status.operationStatus)) { Console.WriteLine("Session COMPLITED"); return; //сессия закончена - всё ОК } else if (SessionUtilities.SessionFaild(status.operationStatus)) { foreach (OperationStatus operation in status.operationStatus.Where(op => op.status == StatusEnum.Awaits)) { operation.status = StatusEnum.Aborted; } Console.WriteLine("Session FAILD"); //одна операция сломалась значит другие отменяем //в целом сессия Faild } else { foreach (OperationStatus operation in status.operationStatus.Where(op => op.status == StatusEnum.Awaits)) { operation.status = StatusEnum.Aborted; } Console.WriteLine("Session Aborted"); //сессия была отменена пользователем //в целом сессия Aborted } }
public void SessionManager_RemoveSession_HasTickets(SessionStatus status) { //Arrange var sessionToDelete = Sessions.Where(s => s.Status == status).FirstOrDefault(); var expectedSessions = Sessions.Where(s => s.Id != sessionToDelete.Id).ToArray(); var dataContextMock = new Mock <IDataContext>(); dataContextMock.Setup(m => m.Find <Session>(It.IsAny <int>())) .Returns <int>((sessionId) => { return(Sessions.Where(s => s.Id == sessionId).FirstOrDefault()); }); dataContextMock.Setup(m => m.Tickets).Returns(new Ticket[] { new Ticket() { Seat = new Seat() { Session = sessionToDelete } } }); var target = new SessionManager(dataContextMock.Object); //Act Action action = () => { target.RemoveSession(sessionToDelete.Id); }; //Assert action.ShouldThrow <CinematicException>().WithMessage(string.Format(Messages.SessionCannotBeRemovedBecauseItHasSoldTickets, sessionToDelete.TimeAndDate.ToString("dd/MM/yyyy HH:mm"))); }
private Session() { _startTime = DateTime.UtcNow; _sessionKey = Guid.NewGuid(); _sessionStatus = SessionStatus.Active; _lockKey = string.Empty; }
/// <summary> /// Starts the session. If no session exists, one will be created. /// </summary> /// In order for the property <see cref="IsSessionStarted"/> and events /// like <see cref="SessionStarted"/> and <see cref="SessionStopped"/> /// to be tracked correctly, use the <see cref="StartSessionAsync"/> and /// <see cref="StopSession"/> methods rather than calling methods /// directly on the <see cref="Session"/> instance. /// </remarks> public async Task StartSessionAsync() { // Warn if already started if (isSessionStarted) { Debug.LogWarning($"{nameof(StartSessionAsync)} called but session is already started."); return; } // If no session created, create one if (session == null) { Debug.Log($"{nameof(StartSessionAsync)} called with but no session. Creating one."); await CreateSessionAsync(); } // Start the session session.Start(); // It's started isSessionStarted = true; // Wait for first session update sessionStatus = await session.GetSessionStatusAsync(); // Notify OnSessionStarted(); }
public ISession WithStatus(SessionStatus status) { var clone = (Session)MemberwiseClone(); clone.Status = status; return(clone); }
private void ShowAccountExpireDialog(SessionStatus sessionStatus) { SessionStatus acc = sessionStatus; if (acc == null) { return; } if (__SubscriptionExpireWindowCrl != null) { __SubscriptionExpireWindowCrl.Close(); } __SubscriptionExpireWindowCrl = new SubscriptionWillExpireWindowController(acc, __LogInViewModel.UserName); NSWindow mainWindow = AppDelegate.GetMainWindowController()?.Window; if (mainWindow != null) { // Set window position centered to the main window CGRect mainWindowRect = mainWindow.Frame; CGRect infoWindowRect = __SubscriptionExpireWindowCrl.Window.Frame; CGPoint wndNewPos = new CGPoint(mainWindowRect.X + mainWindowRect.Width / 2 - infoWindowRect.Width / 2, mainWindowRect.Y + mainWindowRect.Height / 2 - infoWindowRect.Height / 2); __SubscriptionExpireWindowCrl.Window.SetFrameOrigin(wndNewPos); } __SubscriptionExpireWindowCrl.ShowWindow(this); }
public bool CreateSession(string cbGameObject) { if (!ConfigurationManager.CheckConfiguration()) { Log.Debug("[NMGPlayMode.SessionManager] CreateSession Fail "); return(false); } testData = TestData.Instance; if (status == SessionStatus.NONE) { status = SessionStatus.INITIALIZING; playerId = NMGPlayerPrefs.GetPlayerId(); if (string.IsNullOrEmpty(playerId)) { playerId = Guid.NewGuid().ToString().Replace("-", "").ToUpper(); NMGPlayerPrefs.SetPlayerId(playerId); Log.Debug("[NMGPlayMode.SessionManager] Save new PlayerID : " + playerId); } GMC2ServiceManager.Instance.Initialize(OnCreateSession); CheckTermsOfServiceKit(); return(true); } else { Log.Debug("[NMGPlayMode.SessionManager] CreateSession Fail"); return(false); } }
/// <summary> /// Changes the state of the session. /// </summary> public void SwitchState(SessionStatus newStatus) { var args = new StatusEventArgs(Session.Status, newStatus); Session.Status = newStatus; StatusChanged?.Invoke(this, args); }
public Session(Session session) { this.CommandSessionHandler = session.CommandSessionHandler; this.SessionChatId = session.SessionChatId; this.SessionCurrentCommand = session.SessionCurrentCommand; this.Status = session.Status; }
private void TrackMidCells() { int criticalValue = 1; for (int i = -1; i <= criticalValue; i++) { for (int j = -1; j <= criticalValue; j++) { PathPossibleAt(i, j); } } if (Input.GetMouseButtonUp(0)) { if (pathStack.Peek().CurrentIndex > 2) { pathStack.Peek().Dettach(); GetSessionStatus = SessionStatus.Suspended; } else { OneStepBack(); pathStack.Pop().DestroyPath(); GetSessionStatus = SessionStatus.Idle; } } }
public IHttpActionResult StatusPassanners(string p = "") { Guid id = Guid.NewGuid(); string channel = SessionStatus.TaskChannel;// "lockedChanges"; var ev = new SessionStatus(); ev.Users = new List <UserHandle>(); Guid tarckId = Guid.NewGuid(); var user = new UserHandle { UserId = Guid.Parse("D897C355-DA9E-E111-8DD2-015056B70063").ToString(), Name = "xxx" }; Guid.TryParse(p, out id); user.PassangersLocked = new List <PassangerLocked>(); ev.State = (int)StateSignalREnum.Pub; user.PassangersLocked = new List <PassangerLocked>(); user.PassangersLocked.Add(new PassangerLocked { IsLocked = true, PassangerId = Guid.Parse("28270C47-DA8B-46E9-AF9A-000094D1A000").ToString() }); user.PassangersLocked.Add(new PassangerLocked { IsLocked = true, PassangerId = id.ToString() }); ev.Users.Add(user); //_context.Clients.Group(SessionStatus.TaskChannel).GetNotify(channel, ev); PulishEvent(channel, ev); return(Ok(tarckId.ToString())); }
public static ICommand GetInstance(string command, SessionStatus session) { if (command == null) { throw new ArgumentNullException("command"); } if (session == SessionStatus.PreLogin) { return(new Commands.HandleUsername(command)); } if (session == SessionStatus.GivenUsername) { return(new Commands.HandlePassword(command)); } if (session == SessionStatus.LoggedIn) { // Other rules. return(new Commands.InvalidCommand()); } return(null); }
public SessionController() { clSessionStatus = SessionStatus.NoSession; clUserManager = new UserManager(); // clJavaScriptSerializer = new JavaScriptSerializer(); if (ApplicationFrame.GetInstance().ActiveSubscription.ActiveMode == SubscriptionManager.Mode.FrontEnd) { clSmartCookieManager = new SmartCookieManager(ctCKSFrontEndSessionCookiesBlock); } else { clSmartCookieManager = new SmartCookieManager(ctCKSBackEndSessionCookiesBlock); } if (ApplicationFrame.GetInstance().ActiveSubscription.IsDemoMode()) { LogIn(ctDEMOAccountID, ctDEMOAccountPassword); } clSmartSectionID = clSmartCookieManager.GetCookieData(ctCCLSmartSessionKey); try { if (VerifySessionKey() && VerifySessionInfo()) { clSessionStatus = SessionStatus.Active; } } catch (Exception paException) { Console.WriteLine(paException.Message); } }
/// <summary> /// Stops any existing session but does not destroy it. No error will be /// thrown if a session doesn't exist or hasn't been started. /// </summary> /// In order for the property <see cref="IsSessionStarted"/> and events /// like <see cref="SessionStarted"/> and <see cref="SessionStopped"/> /// to be tracked correctly, use the <see cref="StartSessionAsync"/> and /// <see cref="StopSession"/> methods rather than calling methods /// directly on the <see cref="Session"/> instance. /// </remarks> public void StopSession() { // Warn if already started if (!isSessionStarted) { Debug.LogWarning($"{nameof(StopSession)} called but no session has been started."); return; } // If no session created, create one if (session == null) { Debug.LogWarning($"{nameof(StopSession)} called but no session has been created."); return; } // Stop the session session.Stop(); // Status is no longer valid sessionStatus = null; // It's no longer started isSessionStarted = false; // Notify OnSessionStopped(); }
public static StoredSessionStatusV1 ToStored(this SessionStatus status) { switch (status) { case SessionStatus.NotStarted: return(StoredSessionStatusV1.NotStarted); case SessionStatus.Completed: return(StoredSessionStatusV1.Completed); case SessionStatus.TerminatedOnError: return(StoredSessionStatusV1.TerminatedOnError); case SessionStatus.InProgress: return(StoredSessionStatusV1.InProgress); case SessionStatus.Suspended: return(StoredSessionStatusV1.Suspended); case SessionStatus.EmergencyStopped: return(StoredSessionStatusV1.EmergencyStopped); default: throw new ArgumentOutOfRangeException(nameof(status), status, null); } }
/// <summary> /// Update the scene data and place the corresponding sources /// </summary> private void UpdateApplicationLifecycle() { // Make sure screen doesn't timeout. Screen.sleepTimeout = SleepTimeout.NeverSleep; if (isQuitting) { return; } // Arleady triggered exit if (arCoreSessionStatus != Session.Status) { // Quit if ARCore was unable to connect and give Unity some time for the toast to appear. if (Session.Status == SessionStatus.ErrorPermissionNotGranted) { Messages.ShowMessage("Camera permission is needed to run this application."); isQuitting = true; Invoke("DoQuit", 1.0f); } else if (Session.Status.IsError()) { Messages.ShowMessage("ARCore encountered a problem connecting. Please start the app again."); isQuitting = true; Invoke("DoQuit", 1.0f); } } // Store the last returned Session.Status so we know if the status when the status changes arCoreSessionStatus = Session.Status; }
public static O2GSessionStatusCode GetSessionStatus(SessionStatus value) { switch (value) { case SessionStatus.Connected: return(O2GSessionStatusCode.Connected); case SessionStatus.Connecting: return(O2GSessionStatusCode.Connecting); case SessionStatus.Disconnected: return(O2GSessionStatusCode.Disconnected); case SessionStatus.Disconnecting: return(O2GSessionStatusCode.Disconnecting); case SessionStatus.PriceSessionReconnecting: return(O2GSessionStatusCode.PriceSessionReconnecting); case SessionStatus.Reconnecting: return(O2GSessionStatusCode.Reconnecting); case SessionStatus.SessionLost: return(O2GSessionStatusCode.SessionLost); case SessionStatus.TradingSessionRequested: return(O2GSessionStatusCode.TradingSessionRequested); case SessionStatus.Unknown: return(O2GSessionStatusCode.Unknown); } throw new ArgumentOutOfRangeException("value"); }
public PacketHandler(MethodInfo info, SessionStatus status, PacketProcessing processingplace, Type type) { methodCaller = (Action <WorldSession, ClientPacket>)GetType().GetMethod("CreateDelegate", BindingFlags.Static | BindingFlags.NonPublic).MakeGenericMethod(type).Invoke(null, new object[] { info }); sessionStatus = status; ProcessingPlace = processingplace; packetType = type; }
/// <summary> /// Monitors the current device SessionStatus until a non-Open session status is returned. Once this has occured, /// the device has become disconnected and should render all state as such. /// </summary> private void MonitorDeviceSession() { if (Application.isEditor) { return; } string errorMessage = string.Empty; SessionStatus sessionStatus = (SessionStatus)GetSessionStatus(ref errorMessage); if (sessionStatus != SessionStatus.Open) { if (string.IsNullOrEmpty(errorMessage)) { Debug.Log(WearableConstants.DEVICE_CONNECTION_MONITOR_WARNING); } else { Debug.LogFormat(WearableConstants.DEVICE_CONNECTION_MONITOR_WARNING_WITH_MESSAGE, errorMessage); } if (_connectedDevice != null) { OnConnectionStatusChanged(Wearable.ConnectionStatus.Disconnected, _connectedDevice); } _config.DisableAllSensors(); _config.DisableAllGestures(); StopDeviceMonitor(); _connectedDevice = null; } }
public static void Ping(SessionStatus status = SessionStatus.Active, Action<bool> callback = null) { var parameters = new Dictionary<string, string>(); parameters.Add("status", status.ToString().ToLower()); Core.Request.Get(Constants.API_SESSIONS_PING, null, (Core.Response response) => { if (callback != null) { callback(response.success); } }, true, Core.ResponseFormat.Json); }
public static SessionStatus[] GetAllowedStatusTransitions(SessionStatus currentStatus) { switch (currentStatus) { case SessionStatus.Approved: return new[] {SessionStatus.Rejected}; case SessionStatus.Deleted: return new[] {SessionStatus.Rejected, SessionStatus.Approved}; case SessionStatus.PendingApproval: return new[] {SessionStatus.Approved, SessionStatus.Rejected}; case SessionStatus.Rejected: return new[] {SessionStatus.Deleted, SessionStatus.Approved}; default: throw new InvalidOperationException("Unexpected session status: " + currentStatus); } }
/// <summary> /// Check the session status and renew it. /// </summary> /// <param name="checkSessionID">Indicate whether need to ignore session check</param> /// <param name="sessionID">The session ID unuiquely identify the session.</param> /// <param name="timeoutMinutes">The minutes of session timeout.</param> /// <param name="renewSession">True, renew session; false, not renew.</param> /// <param name="isActiveUser">Return true, ueser is active user; false, inactive.</param> /// <param name="sessionStatus">Return the current <see cref="SessionStatus"/> with session ID</param> public void AuthenticationCheck(bool checkSessionID, string sessionID, int timeoutMinutes, bool renewSession, out bool isActiveUser, out SessionStatus sessionStatus) { DbCommand command = _helper.BuildDbCommand("P_IC_AUTHENTICATION_CHECK"); //Init isActiveUser = false; sessionStatus = SessionStatus.Active; int checkSession = checkSessionID ? 1 : 0; int renewifActive = renewSession ? 1 : 0; int renewIfTimeout = (renewSession && AppContext.Current.AuthenticationMode == AuthenticationMode.Integration) ? 1 : 0; _helper.AssignParameterValues(command, checkSession,sessionID, DateTime.Now, timeoutMinutes, AppContext.Current.UserName, renewIfTimeout, renewifActive); _helper.ExecuteNonQuery(command); var userStatus = _helper.GetParameterValue(command, "@p_user_status"); if (userStatus != null && userStatus != DBNull.Value) { isActiveUser = userStatus.ToString().Equals(UserStatus.Active,StringComparison.InvariantCultureIgnoreCase); } if (!checkSessionID) { return; } switch ((int)_helper.GetParameterValue(command, "p_status")) { case 4: sessionStatus = SessionStatus.NotMatchUserName; break; case 3: sessionStatus = SessionStatus.InvalidOrScavenged; break; case 2: sessionStatus = SessionStatus.Killed; break; case 1: sessionStatus = SessionStatus.Timeout; break; default: sessionStatus = SessionStatus.Active; break; } }
private bool StartImpl() { bool result = false; lock(startLock) { if(items == null || items.Count == 0) { return false; } startEvent.Reset(); status = SessionStatus.BeginStart; // initialize the context if(Initialize() == false) { // add error _afterWipeErrors.Add(new WipeError(DateTime.Now, ErrorSeverity.High, "Initialization error.")); status = SessionStatus.Stopped; return false; } if(status != SessionStatus.BeginStart) { return false; } // send the wipe objects result = SendWipeObjects(_bridgeItems); result &= SendWipeObjects(items); if(result == true && status != SessionStatus.Stopped) { // start! result = context.SetContextStatus(ContextStatus.Wipe); if(result == true) { status = SessionStatus.Wipe; statistics.StartTime = DateTime.Now; } else { Debug.ReportWarning("Failed to start context"); } } else if(result == false) { Debug.ReportWarning("Failed to send wipe objects"); } startEvent.Set(); } return result; }
private void StartAsync(object sender, EventArgs e) { try { asyncStartResult = StartImpl(); } catch(Exception ex) { // add error _afterWipeErrors.Add(new WipeError(DateTime.Now, ErrorSeverity.High, "Unknown error.")); Debug.ReportError("Error while wiping in asynchronous mode. Exception: {0}", ex.Message); status = SessionStatus.Stopped; } finally { asyncStartResult = false; } }
ActionResult ChangeSessionStatus(string eventSlug, string sessionSlug, SessionStatus newStatus) { var sessionId = Domain.Model.Session.IdFrom(eventSlug, sessionSlug); return Execute(new ChangeSessionStatus(sessionId, newStatus)) .Always(x => RedirectToAction("Index")); }
public ActionResult Index(string eventSlug = null, int page = 1, SessionStatus? status = null) { if(string.IsNullOrEmpty(eventSlug) && State.NoEventScheduled()) { return View("NoEventScheduled"); } var eventId = string.IsNullOrEmpty(eventSlug) ? State.CurrentEvent.Id : Event.IdFrom(eventSlug); var data = Bus.Query(new SessionSummaryPage(eventId, page, status)); return View( new IndexOutput( data, string.IsNullOrEmpty(eventSlug) ? Event.SlugFromId(State.CurrentEvent.Id) : eventSlug, status ) ); }
public void setStatus(SessionStatus status) { this.status = status; foreach (StatusListener listener in statusListeners) { listener.notify(status); } }
/// <summary> /// Get the value used for the "sc" session control parameter for a given session status. /// </summary> /// <param name="sessionStatus">Session status to obtain value for.</param> /// <returns>Value for the "sc" session control parameter for the session state.</returns> private static string GetSessionControlValue(SessionStatus sessionStatus) { switch (sessionStatus) { case SessionStatus.Starting: return "start"; case SessionStatus.Ending: return "end"; default: return null; } }
/// <summary> /// Initialises a new instance of the <see cref="SetSessionStatusMessage"/> class and /// specifies the <see cref="AK.F1.Timing.Messages.Session.SessionStatus"/>. /// </summary> /// <param name="sessionStatus">The current /// <see cref="AK.F1.Timing.Messages.Session.SessionStatus"/>.</param> public SetSessionStatusMessage(SessionStatus sessionStatus) { SessionStatus = sessionStatus; }
public SessionRenewException(string message, SessionStatus status, Exception inner) : base(message, inner) { SessionStatus = status; }
public void Deserialize(byte[] bytes) { SessionStatus = (SessionStatus)bytes.ToInt32(0); }
internal SessionStatusChangedEventArgs(SessionStatus oldStatus, SessionStatus newStatus) { OldStatus = oldStatus; NewStatus = newStatus; }
/// <summary> /// <para>Changes the session to the one passed. Active by default. Won't update until next ping (at worst 60 seconds delay).</para> /// </summary> /// <param name="status">SessionStatus enum to indicate the status.</param> public static void changeStatus(SessionStatus status) { Session.status = status; }
/// <summary> /// Check the session status and renew it. /// </summary> /// <param name="checkSessionID">Indicate whether need to ignore session check</param> /// <param name="sessionID">The session ID unuiquely identify the session.</param> /// <param name="timeoutMinutes">The minutes of session timeout.</param> /// <param name="renewSession">True, renew session; false, not renew.</param> /// <param name="isActiveUser">Return true, ueser is active user; false, inactive.</param> /// <param name="sessionStatus">Return the current <see cref="SessionStatus"/> with session ID</param> public void AuthenticationCheck(bool checkSessionID, string sessionID, int timeoutMinutes, bool renewSession, out bool isActiveUser, out SessionStatus sessionStatus) { //it will call same SP of RefreshSession in _da.AuthenticationCheck's SP _da.AuthenticationCheck(checkSessionID, sessionID, timeoutMinutes, renewSession, out isActiveUser, out sessionStatus); }
public SessionRenewException(string message, SessionStatus status) : base(message) { SessionStatus = status; }
/// <summary> /// Stop the wiping process /// </summary> public bool Stop() { bool result = false; if(status == SessionStatus.BeginStart) { if(context.IsOpen) { context.SetContextStatus(ContextStatus.Stopped); } if(activeObject != null) { activeObject.Stop(); } status = SessionStatus.Stopped; result = true; } else if(status != SessionStatus.Stopped) { result = context.SetContextStatus(ContextStatus.Stopped); if(result == true) { status = SessionStatus.Stopped; GenerateStatistics(); } } // remove bridge items if(_bridgeItems != null) { _bridgeItems.Clear(); } return result; }
private static SessionRenewException CreateSessionRenewExceptionByStatus(SessionStatus status) { switch (status) { case SessionStatus.Timeout: { return new SessionRenewException(Messages.Framework.FWE004.Format(), SessionStatus.Timeout); } case SessionStatus.Killed: { return new SessionRenewException(Messages.Framework.FWE003.Format(), SessionStatus.Killed); } case SessionStatus.NotMatchUserName: { return new SessionRenewException(Messages.Framework.FWE006.Format(), SessionStatus.NotMatchUserName); } case SessionStatus.InvalidOrScavenged: { return new SessionRenewException(Messages.Framework.FWE007.Format(), SessionStatus.InvalidOrScavenged); } default: { return null; } } }
public WipeSession() { guid = DefaultSessionGuid; items = new List<IWipeObject>(); context = new WipeContext(); options = new WipeOptions(); searcher = new FileSearcher(); startLock = new object(); startEvent = new AutoResetEvent(false); statistics = new WipeStatistics(); _beforeWipeErrors = new List<WipeError>(); _afterWipeErrors = new List<WipeError>(); _bridgeItems = new List<IWipeObject>(); endStartCalled = true; status = SessionStatus.Stopped; }
public bool RegisterSession(string sessionId, string ipAddress) { if (this.availableSlot == 0) { return true; } var utcNow = DateTime.UtcNow; // Reset last time access SessionStatus originalSessionStatus; if (this.sessionIds.TryGetValue(sessionId, out originalSessionStatus)) { originalSessionStatus.LastTimeAccess = utcNow; return true; } if (this.sessionIds.Count > this.availableSlot) { return false; } var newSessionStatus = new SessionStatus(utcNow, sessionId, ipAddress); if (this.sessionIds.TryAdd(sessionId, newSessionStatus)) { if (this.sessionIds.Count > this.availableSlot) { SessionStatus removeSessionStatus; this.sessionIds.TryRemove(sessionId, out removeSessionStatus); return false; } } return true; }
public IndexOutput(Page<SessionSummaryPage.Summary> page, string eventSlug, SessionStatus? currentStatusFilter) { Page = page; EventSlug = eventSlug; CurrentStatusFilter = currentStatusFilter; }
private void SwitchState(SessionStatus newStatus) { status = newStatus; if (status == SessionStatus.InLobby && RequestedStateSwitch != null) { RequestedStateSwitch(this, new TypeEventArgs(typeof (Lobby))); Detach(); } }
public void can_parse_a_session_status(string s, SessionStatus expected) { Assert.Equal(expected, LiveData.ToSessionStatus(s)); }
public SessionRenewException(string message, Exception inner) : base(message, inner) { SessionStatus = SessionStatus.UnKnown; }