Exemplo n.º 1
0
        private void ReadCodeButton_Click(object sender, EventArgs e)
        {
            TypeTextBlock.Text        = "";
            DescriptionTextBlock.Text = "";
            ThumbnailImage.Source     = null;

            if (_task != null)
            {
                _task.Completed -= OpticalReaderTask_Completed;
                _task.Dispose();
                _task = null;
            }

            var showDebugInformation = DebugCheckBox.IsChecked != null && (bool)DebugCheckBox.IsChecked;
            var useCustomProcessor   = ProcessorCheckBox.IsChecked != null && (bool)ProcessorCheckBox.IsChecked;
            var focusInterval        = new TimeSpan(0, 0, 0, 0, 2500);
            var objectSize           = _size <= 10 ? new Windows.Foundation.Size(_size * 10, _size * 10) : new Windows.Foundation.Size(0, 0);
            var requireConfirmation  = ConfirmationCheckBox.IsChecked != null && (bool)ConfirmationCheckBox.IsChecked;

            if (useCustomProcessor)
            {
                _processor = new CustomProcessor();

                focusInterval = new TimeSpan(0, 0, 0, 0, 4000);
            }
            else
            {
                _processor = new OpticalReaderLib.ZxingProcessor();
            }

            _task = new OpticalReaderLib.OpticalReaderTask()
            {
                Processor            = _processor,
                ShowDebugInformation = showDebugInformation,
                FocusInterval        = focusInterval,
                ObjectSize           = objectSize,
                RequireConfirmation  = requireConfirmation
            };

            _task.Completed += OpticalReaderTask_Completed;
            _task.Show();
        }
Exemplo n.º 2
0
        private void ReadCodeButton_Click()
        {
            if (_task != null)
            {
                _task.Completed -= OpticalReaderTask_Completed;
                _task.Dispose();
                _task = null;
            }

            var showDebugInformation = false;
            var useCustomProcessor   = false;
            var focusInterval        = new TimeSpan(0, 0, 0, 0, 2500);
            var objectSize           = _size <= 10 ? new Windows.Foundation.Size(_size * 10, _size * 10) : new Windows.Foundation.Size(0, 0);
            var requireConfirmation  = true;

            if (useCustomProcessor)
            {
                _processor = new CustomProcessor();

                focusInterval = new TimeSpan(0, 0, 0, 0, 4000);
            }
            else
            {
                _processor = new OpticalReaderLib.ZxingProcessor();
            }

            _task = new OpticalReaderLib.OpticalReaderTask()
            {
                Processor            = _processor,
                ShowDebugInformation = showDebugInformation,
                FocusInterval        = focusInterval,
                ObjectSize           = objectSize,
                RequireConfirmation  = false,
            };

            _task.Completed += OpticalReaderTask_Completed;
            _task.Show();
        }
Exemplo n.º 3
0
        private void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            if (_task != null)
            {
                _task.Completed -= _task_Completed;
                _task.Dispose();
                _task = null;
            }

            _processor = new Helpers.CustomProcessor();

            _task = new OpticalReaderLib.OpticalReaderTask()
            {
                Processor            = _processor,
                ShowDebugInformation = false,
                FocusInterval        = new TimeSpan(0, 0, 0, 0, 1000),
                ObjectSize           = new Windows.Foundation.Size(90, 90),
                RequireConfirmation  = false
            };

            _task.Completed += _task_Completed;
            _task.Show();
        }
Exemplo n.º 4
0
        private void ReadCodeButton_Click(object sender, EventArgs e)
        {
            TypeTextBlock.Text = "";
            DescriptionTextBlock.Text = "";
            ThumbnailImage.Source = null;

            if (_task != null)
            {
                _task.Completed -= OpticalReaderTask_Completed;
                _task.Dispose();
                _task = null;
            }

            var showDebugInformation = DebugCheckBox.IsChecked != null && (bool)DebugCheckBox.IsChecked;
            var useCustomProcessor = ProcessorCheckBox.IsChecked != null && (bool)ProcessorCheckBox.IsChecked;
            var focusInterval = new TimeSpan(0, 0, 0, 0, 2500);
            var objectSize = _size <= 10 ? new Windows.Foundation.Size(_size * 10, _size * 10) : new Windows.Foundation.Size(0, 0);
            var requireConfirmation = ConfirmationCheckBox.IsChecked != null && (bool)ConfirmationCheckBox.IsChecked;

            if (useCustomProcessor)
            {
                _processor = new CustomProcessor();

                focusInterval = new TimeSpan(0, 0, 0, 0, 4000);
            }
            else
            {
                _processor = new OpticalReaderLib.ZxingProcessor();
            }

            _task = new OpticalReaderLib.OpticalReaderTask()
            {
                Processor = _processor,
                ShowDebugInformation = showDebugInformation,
                FocusInterval = focusInterval,
                ObjectSize = objectSize,
                RequireConfirmation = requireConfirmation
            };

            _task.Completed += OpticalReaderTask_Completed;
            _task.Show();
        }