Example #1
0
        /// <summary>
        /// Initialize the nexaIris instance if it has not already been
        /// initialized.
        /// </summary>
        private void Initialize()
        {
            if (!initialized)
            {
                algorithms.Add(NexaIris.Algorithm.I500);

                foreach (NexaIris.Algorithm algorithm in
                         Enum.GetValues(typeof(NexaIris.Algorithm)))
                {
                    nexaIris.EnableAlgorithm(algorithm);
                    if (IntPtr.Size == 4)
                    {
                        cacheConfig.AddAlgorithm(algorithm, NexaIris.CacheType.DISK);
                    }
                    else
                    {
                        cacheConfig.AddAlgorithm(algorithm, NexaIris.CacheType.RAM);
                    }
                }
                foreach (NexaIris.IrisType iris in
                         Enum.GetValues(typeof(NexaIris.IrisType)))
                {
                    cacheConfig.EnableIris(iris);
                }
                nexaIris.AddCache(cacheConfig);
                nexaIris.SetCompareResultCallback(OnCompareResult);
                nexaIris.Initialize();
            }
            initialized = true;
        }