Exemplo n.º 1
0
        /*  Pre:
         *  Expects a fingerprint for person recognition
         */
        public void Visit(FingerprintScanner scanner)
        {
            if (scanner == null)
            {
                return;
            }

            int            id = scanner.ScanFinger();
            PersonIdentity recognisedPerson = new PersonIdentity {
                identity = 0, name = ""
            };

            for (int i = 0; i < PersonIdentities.Length; i++)
            {
                if (PersonIdentities[i].identity == id)
                {
                    recognisedPerson = PersonIdentities[i];
                    break;
                }
            }

            if (recognisedPerson.identity == 0)
            {
                MessageBox.Show("Mobile app: The fingerprint is not recognised");
            }
            else
            {
                MessageBox.Show("Mobile app: Welcome home, " + recognisedPerson.name);
            }
        }
Exemplo n.º 2
0
        /* Pre:
         * Shows the scanner's result
         */
        public void Visit(FingerprintScanner scanner)
        {
            if (scanner == null)
            {
                return;
            }

            int id = scanner.ScanFinger();

            MessageBox.Show("Diagnostics: received identity from scanner: " + id);
        }