public TwainCapability(TwainDevice twain, TwIdentity dataSourceId, TwCap capType) { fTwain = twain; fDataSourceId = dataSourceId; fCapType = capType; fValueType = TwType.DontCare16; TwCapability cap = new TwCapability(capType); if(fTwain.GetDataSourceAvailableCapabilityValues(dataSourceId, cap)) { fValueType = cap.GetValueType(); Items = new List<object>(); int numItems = cap.GetNumItems(); for(int i = 0; i < numItems; i++) { Items.Add(cap.GetItem(i)); } MinValue = cap.GetMinValue(); MaxValue = cap.GetMaxValue(); StepSize = cap.GetStepSize(); fCurrentValue = cap.GetCurrentValue(); } }