Exemplo n.º 1
0
        private void FillDeviceData(Device WiaDev)
        {
            m_ScannerDeviceData = new ScannerDeviceData();
            if (WiaDev != null)
            {
                foreach (WIA.Property prop in WiaDev.Properties)
                {
                    switch (prop.Name)
                    {
                    case WIA_DEVICE_PROPERTIES.WIA_DEVICE_MANUFACTURER:
                        m_ScannerDeviceData.DeviceManufacturer = prop.get_Value().ToString();
                        break;

                    case WIA_DEVICE_PROPERTIES.WIA_DEVICE_DESCRIPTION:
                        m_ScannerDeviceData.DeviceDescription = prop.get_Value().ToString();
                        break;

                    case WIA_DEVICE_PROPERTIES.WIA_DEVICE_NAME:
                        m_ScannerDeviceData.DeviceName = prop.get_Value().ToString();
                        break;

                    case WIA_DEVICE_PROPERTIES.WIA_DEVICE_DRIVER_VERSIONR:
                        m_ScannerDeviceData.DeviceDriverVersion = prop.get_Value().ToString();
                        break;

                    case WIA_DEVICE_PROPERTIES.WIA_DEVICE_WIA_VERSION:
                        m_WiaVersion = prop.get_Value().ToString();
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void FillDeviceData(TwIdentity srcds)
 {
     m_TwainDevice = new ScannerDeviceData();
     if (srcds != null && srcds.Id != IntPtr.Zero)
     {
         m_TwainDevice.DeviceManufacturer  = srcds.Manufacturer;
         m_TwainDevice.DeviceName          = srcds.ProductName;
         m_TwainDevice.DeviceFamily        = srcds.ProductFamily;
         m_TwainDevice.DeviceDriverVersion = srcds.Version.Info;
     }
 }