コード例 #1
0
 /// <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;
     }
 }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
ファイル: PairablePerson.cs プロジェクト: ase-lab/MSEAPI
 /// <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;
     }
 }
コード例 #4
0
ファイル: PairablePerson.cs プロジェクト: ase-lab/MSEAPI
 private void occludedTimeout(Object sender, ElapsedEventArgs e)
 {
     if (_pairingState == PairingState.PairedButOccluded && sender == occludedTimeoutTimer)
     {
         this.PairingState = PairingState.NotPaired;
         occludedTimeoutTimer = null;
     }
 }
コード例 #5
0
        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;
        }
コード例 #6
0
        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;
        }
コード例 #7
0
ファイル: DrawingResources.cs プロジェクト: ase-lab/MSEAPI
 /// <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;
     }
 }