/// <summary> /// Handler for the pairing timeout timer, which sets us to 'not pairing' if we haven't paired yet. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pairingTimeout(Object sender, ElapsedEventArgs e) { // Only reset our pairing state if we haven't paired, and if this timer is the most recent timer created if (_pairingState == PairingState.PairingAttempt && sender == pairingTimeoutTimer) { this.PairingState = PairingState.NotPaired; pairingTimeoutTimer = null; } }
/// <summary> /// Converts a pairing state to a Brush. This is useful so that if we want to change the color scheme for different states, we only need to do it here. /// </summary> /// <param name="state"></param> /// <returns></returns> public static Brush GetBrushFromPairingState(PairingState state) { switch (state) { case (PairingState.NotPaired): return(Brushes.DarkRed); case (PairingState.PairingAttempt): return(Brushes.Orange); case (PairingState.Paired): return(Brushes.Green); default: return(Brushes.White); } }
private void occludedTimeout(Object sender, ElapsedEventArgs e) { if (_pairingState == PairingState.PairedButOccluded && sender == occludedTimeoutTimer) { this.PairingState = PairingState.NotPaired; occludedTimeoutTimer = null; } }
internal PairablePerson CreateTestPerson(int newId, int? holdsId = null, PairingState? pairState = null) { PairablePerson person = new PairablePerson { Identifier = newId.ToString(), HeldDeviceIdentifier = holdsId.ToString() ?? null, Location = null, Orientation = null, PairingState = pairState ?? PairingState.NotPaired }; return person; }
internal PairableDevice CreateTestDevice(int newId, int? heldById = null, PairingState? pairState = null) { PairableDevice device = new PairableDevice { Identifier = newId.ToString(), HeldByPersonIdentifier = heldById.ToString() ?? null, PairingState = pairState ?? PairingState.NotPaired }; return device; }
/// <summary> /// Converts a pairing state to a Brush. This is useful so that if we want to change the color scheme for different states, we only need to do it here. /// </summary> /// <param name="state"></param> /// <returns></returns> public static Brush GetBrushFromPairingState(PairingState state) { switch (state) { case (PairingState.NotPaired): return Brushes.DarkRed; case (PairingState.PairingAttempt): return Brushes.Orange; case (PairingState.Paired): return Brushes.Green; default: return Brushes.White; } }