mirror of
https://github.com/soukoku/ntwain.git
synced 2026-01-02 04:17:08 +08:00
Changed extension method to take IEnumerable
This commit is contained in:
@@ -10,11 +10,11 @@ namespace NTwain.Values
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ValueConverter
|
public static class ValueConverter
|
||||||
{
|
{
|
||||||
public static IList<T> CastToEnum<T>(this IList<object> list) where T : struct,IConvertible
|
public static IList<T> CastToEnum<T>(this IEnumerable<object> list) where T : struct,IConvertible
|
||||||
{
|
{
|
||||||
return list.CastToEnum<T>(true);
|
return list.CastToEnum<T>(true);
|
||||||
}
|
}
|
||||||
public static IList<T> CastToEnum<T>(this IList<object> list, bool tryUpperWord) where T : struct,IConvertible
|
public static IList<T> CastToEnum<T>(this IEnumerable<object> list, bool tryUpperWord) where T : struct,IConvertible
|
||||||
{
|
{
|
||||||
return list.Select(o => o.ConvertToEnum<T>(tryUpperWord)).ToList();
|
return list.Select(o => o.ConvertToEnum<T>(tryUpperWord)).ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,9 +198,9 @@ namespace Tester.WPF
|
|||||||
case CapabilityId.CapEnableDSUIOnly:
|
case CapabilityId.CapEnableDSUIOnly:
|
||||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
||||||
break;
|
break;
|
||||||
//case CapabilityId.CapEndorser:
|
case CapabilityId.CapEndorser:
|
||||||
// CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
||||||
// break;
|
break;
|
||||||
case CapabilityId.CapExtendedCaps:
|
case CapabilityId.CapExtendedCaps:
|
||||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ModernWPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c99d0cfbea7491ef, processorArchitecture=MSIL">
|
<Reference Include="ModernWPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c99d0cfbea7491ef, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\packages\ModernWPF.1.1.41.1\lib\net40-Client\ModernWPF.dll</HintPath>
|
<HintPath>..\..\packages\ModernWPF.1.1.41.2\lib\net40-Client\ModernWPF.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="CommonWin32" version="2.0.4" targetFramework="net40-Client" />
|
<package id="CommonWin32" version="2.0.4" targetFramework="net40-Client" />
|
||||||
<package id="ModernWPF" version="1.1.41.1" targetFramework="net40-Client" />
|
<package id="ModernWPF" version="1.1.41.2" targetFramework="net40-Client" />
|
||||||
</packages>
|
</packages>
|
||||||
Reference in New Issue
Block a user