Exemplo n.º 1
0
 private void Scan(object parameter)
 {
     Task.Run(() => {
         this.IsBusy = true;
         try
         {
             this.SetProgress(0);
             this.SetProgressVisible(true);
             var result = _scannerService.Scan();
             //Task.Delay(3000).Wait();
             //var result = new ScannerData[] {
             //    new ScannerData { X = 1, Y = 1, N = 1 },
             //    new ScannerData { X = 2, Y = 2, N = 2 },
             //    new ScannerData { X = 3, Y = 3, N = 3 },
             //    new ScannerData { X = 4, Y = 4, N = 4 },
             //    new ScannerData { X = 5, Y = 5, N = 5 },
             //    new ScannerData { X = 6, Y = 6, N = 6 },
             //    new ScannerData { X = 7, Y = 7, N = 7 },
             //    new ScannerData { X = 8, Y = 8, N = 8 },
             //    new ScannerData { X = 9, Y = 9, N = 9 }
             //};
             _currentData = result;
             this.State   = StartPageStates.Store;
         }
         catch (Exception exception)
         {
             ShowToastMessage.Send(exception.Message);
         }
         finally
         {
             this.SetProgressVisible(false);
             this.IsBusy = false;
         }
     });
 }
Exemplo n.º 2
0
        private void ClickedSearchButton(object sender, EventArgs a)
        {
            var result = _scannerService.Scan(PathEntry.Text);

            //if (LogSwch.State)
            //{
            new LogWindow(result).Show();
            // }
            //
        }
Exemplo n.º 3
0
        public void Scan()
        {
            if (SelectedScanner == null)
            {
                return;
            }

            try
            {
                var image = scannerService.Scan(SelectedScanner.Device, ColorDepth, Resolution);

                Image = new EnhanceImage {
                    Bitmap = new Bitmap(image)
                };
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }