Esempio n. 1
0
        public List <object> GetValue()
        {
            var twainCapability = TwainCapability.From(_capability);

            var result = Twain32Native.DsCapability(
                _applicationId,
                _sourceId,
                DataGroup.Control,
                DataArgumentType.Capability,
                Message.Get,
                twainCapability);

            if (result != TwainResult.Success)
            {
                var conditionCode = GetStatus();

                log.Debug(string.Format("Failed to get capability:{0} reason: {1}",
                                        _capability, conditionCode));

                return(null);

                /*return new BasicCapabilityResult()
                 * {
                 *      ConditionCode = conditionCode,
                 *      ErrorCode = result
                 * };*/
            }


            var ojbts = new List <object>();

            CapabilityReader.ReadValue(twainCapability).PopulateFromCapValues(ojbts);

            return(ojbts);
        }
 /// <summary>
 /// Initialises a new instance of the <see cref="ListCapabilitiesHandler"/> class.
 /// </summary>
 public ListCapabilitiesHandler(CapabilityReader capabilityReader, IMapper mapper)
 {
     _capabilityReader = capabilityReader;
     _mapper           = mapper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ListCapabilitiesHandler"/> class.
 /// </summary>
 /// <param name="capabilityReader">The <see cref="CapabilityReader"/> instance.</param>
 /// <param name="mapper">The <see cref="IMapper"/> instance.</param>
 public ListCapabilitiesHandler(CapabilityReader capabilityReader, IMapper mapper)
 {
     this.capabilityReader = capabilityReader;
     this.mapper           = mapper;
 }