コード例 #1
0
ファイル: PersonalInfo.cs プロジェクト: muhaym/aadhaarapi.net
        /// <summary>
        /// Serializes the object into XML according to Aadhaar API specification.
        /// </summary>
        /// <param name="elementName">The name of the element.</param>
        /// <returns>An instance of <see cref="XElement"/>.</returns>
        public XElement ToXml(string elementName)
        {
            if (Uses.AuthUsed == AuthTypes.None)
            {
                throw new ArgumentException(RequiredSomeData);
            }
            if (Biometrics.Any(b => b.Type == BiometricType.Fingerprint) && Biometrics.Any(b => b.Type == BiometricType.Minutiae))
            {
                throw new ArgumentException(XorFirFmr, nameof(Biometrics));
            }

            var personalInfo = new XElement(elementName,
                                            new XAttribute("ts", Timestamp.ToString(AadhaarHelper.TimestampFormat, CultureInfo.InvariantCulture)),
                                            new XAttribute("ver", PidVersion));

            if (Demographic != null)
            {
                personalInfo.Add(Demographic.ToXml("Demo"));
            }
            if (Biometrics.Count > 0)
            {
                var biometrics = new XElement("Bios");
                foreach (var biometric in Biometrics)
                {
                    biometrics.Add(biometric.ToXml("Bio"));
                }
                personalInfo.Add(biometrics);
            }
            if (PinValue != null)
            {
                personalInfo.Add(PinValue.ToXml("Pv"));
            }

            return(personalInfo);
        }
コード例 #2
0
        public BiometricTestWindow()
        {
            InitializeComponent();

            _biometrics = new Biometrics();

            _biometrics.IdentifyFailed  += _biometrics_IdentifyFailed;
            _biometrics.IdentifySuccess += _biometrics_IdentifySuccess;

            _session = _biometrics.OpenSession();
        }
コード例 #3
0
        public BiometricTestWindow()
        {
            InitializeComponent();

            _biometrics = new Biometrics();

            _biometrics.IdentifyFailed += _biometrics_IdentifyFailed;
            _biometrics.IdentifySuccess += _biometrics_IdentifySuccess;

            _session = _biometrics.OpenSession();
        }
コード例 #4
0
        public override void SetOpened(bool opened)
        {
            if (_biometrics == null)
            {
                _biometrics = (Biometrics)PosCommon;
                _biometrics.DataEvent += new DataEventHandler(_biometrics_DataEvent);
                _biometrics.StatusUpdateEvent += new StatusUpdateEventHandler(_biometrics_StatusUpdateEvent);
            }

            if (opened)
                UpdateUI();
        }
コード例 #5
0
 internal bool UserDataCheck(Biometrics userBio)
 {
     Int32.TryParse(Data_Biometrics.BirthDate[0], out int year);
     if (Data_Biometrics.metric.Weight == 0 && Data_Biometrics.customary.Weight == 0)
     {
         if (year >= 1900)
         {
             ALTERED_userBiometrics = false;
             return(false);
         }
     }
     return(true);
 }
コード例 #6
0
        public override void SetOpened(bool opened)
        {
            if (_biometrics == null)
            {
                _biometrics                    = (Biometrics)PosCommon;
                _biometrics.DataEvent         += new DataEventHandler(_biometrics_DataEvent);
                _biometrics.StatusUpdateEvent += new StatusUpdateEventHandler(_biometrics_StatusUpdateEvent);
            }

            if (opened)
            {
                UpdateUI();
            }
        }