internal void InitialiseStateMachine() { if (_restClient.MobileDevice != null) { StateMachine = new ActivationStateMachine(_restClient, _logger); var hasState = StateMachine.LoadPersistedState(); // if we are not in the initial state if (hasState && (StateMachine.CurrentState is ActivationStateMachine.NotActivated == false)) { var device = _restClient.Device; if (device.Id.IsEmpty() || device.DeviceSecret.IsEmpty()) { _logger.Warning("State machine has loaded state but failed to load Local device. Resetting local device."); LocalDevice.ResetDevice(_restClient.MobileDevice); StateMachine.ClearPersistedState(); StateMachine.ResetStateMachine(); } } if (_restClient.Device != null) { _restClient.Device.ClientIdUpdated = ClientIdUpdated; } } }
public NotActivated(ActivationStateMachine machine) : base(machine) { }
public WaitingForPushDeviceDetails(ActivationStateMachine machine) : base(machine) { }
public AfterRegistrationSyncFailed(ActivationStateMachine machine) : base(machine) { }
public WaitingForRegistrationSync(ActivationStateMachine machine, Event fromEvent) : base(machine) { FromEvent = fromEvent; }
public WaitingForDeregistration(ActivationStateMachine machine, State previousState) : base(machine) { PreviousState = previousState; }
protected State(ActivationStateMachine machine) { Machine = machine; }
public WaitingForDeviceRegistration(ActivationStateMachine machine) : base(machine) { }