Example #1
2
        private List<Scaner> GetScanersList()
        {
            List<Scaner> ls = new List<Scaner>();
            Scaner s;
            try
            {
                Twain _twain = new Twain(_wh);
                if (_twain.SourceNames.Count != 0)
                {
                    _twain.SelectSource();
                    s = new Scaner(_twain.DefaultSourceName, EnumScanerType.Twain, _wh);
                    ls.Add(s);
                }
            }
            catch (TwainException) { }
            List<string> devices = WIAScanner.GetDevices();
            foreach (string device in devices)
            {
                s = new Scaner(device, EnumScanerType.WIA, _wh);
                ls.Add(s);

            }
            s = new Scaner("Изображение из файла", EnumScanerType.File, _wh);
            ls.Add(s);
            return ls;
        }
Example #2
0
        private List <Scaner> GetScanersList()
        {
            List <Scaner> ls = new List <Scaner>();
            Scaner        s;

            try
            {
                Twain _twain = new Twain(_wh);
                if (_twain.SourceNames.Count != 0)
                {
                    _twain.SelectSource();
                    s = new Scaner(_twain.DefaultSourceName, EnumScanerType.Twain, _wh);
                    ls.Add(s);
                }
            }
            catch (TwainException) { }
            List <string> devices = WIAScanner.GetDevices();

            foreach (string device in devices)
            {
                s = new Scaner(device, EnumScanerType.WIA, _wh);
                ls.Add(s);
            }
            s = new Scaner("Изображение из файла", EnumScanerType.File, _wh);
            ls.Add(s);
            return(ls);
        }
Example #3
0
 private void lst_devices_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (lst_devices.SelectedItems.Count != 0)
     {
         Scaner s = new Scaner(lst_devices.SelectedItems[0].Text, Scaner.StringToScanerType(lst_devices.SelectedItems[0].SubItems[1].Text), new WinFormsWindowMessageHook(this));
         _selectedscaner = s;
     }
 }
Example #4
0
 private void lst_devices_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (lst_devices.SelectedItems.Count != 0)
     {
         Scaner s = new Scaner(lst_devices.SelectedItems[0].Text, Scaner.StringToScanerType(lst_devices.SelectedItems[0].SubItems[1].Text), new WinFormsWindowMessageHook(this));
         _selectedscaner = s;
     }
 }
Example #5
0
 void btn_done_Click(object sender, EventArgs e)
 {
     _currentscaner = fs.SelectedScaner;
     if (_currentscaner != null)
     {
         fs.Close();
         SaveScaner();
     }
 }
Example #6
0
 void btn_done_Click(object sender, EventArgs e)
 {
     _currentscaner = fs.SelectedScaner;
     if (_currentscaner != null)
     {
         fs.Close();
         SaveScaner();
     }
 }
Example #7
0
        public void GetDevicefromBase()
        {
            int scancount = _ge.scaners.Count(sc => sc.ids == 1);

            if (scancount == 0)
            {
                SelectDevice();
            }
            else
            {
                scaner s = _ge.scaners.First(sc => sc.ids == 1);
                _currentscaner = new Scaner(s.currentscanername, Scaner.StringToScanerType(s.driver), _wh);
            }
        }
Example #8
0
        public void GetDevicefromBase()
        {
            int scancount = _ge.scaners.Count(sc => sc.ids == 1);
            if (scancount == 0)
            {
                SelectDevice();
            }
            else
            {
                scaner s = _ge.scaners.First(sc => sc.ids == 1);
                _currentscaner = new Scaner(s.currentscanername, Scaner.StringToScanerType(s.driver), _wh);

            }
        }