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
        private void Visitors_Load(object sender, EventArgs e)
        {
            var identities = new PersonIdentity[]
            {
                new PersonIdentity {
                    identity = 10000, name = "Jip Musketier"
                },
                new PersonIdentity {
                    identity = 10005, name = "Marco shrek"
                },
                new PersonIdentity {
                    identity = 10010, name = "Wouter Whatsitsname"
                },
                new PersonIdentity {
                    identity = 10015, name = "Andre Hazig"
                },
                new PersonIdentity {
                    identity = 10020, name = "Maarten Glutenboii"
                },
                new PersonIdentity {
                    identity = 10025, name = "Evert Cozmo"
                },
                new PersonIdentity {
                    identity = 10030, name = "Freddy Wrong"
                },
                new PersonIdentity {
                    identity = 10035, name = "Hong Konghon"
                },
            };

            lbVisitors.Items.Add(new PhoneDiagnosticsVisitor());
            lbVisitors.Items.Add(new PhoneAppVisitor(identities));

            lbElements.Items.Add(new Camera());
            lbElements.Items.Add(new Speaker());
            lbElements.Items.Add(new Touchscreen());
            lbElements.Items.Add(new FingerprintScanner());
        }