mirror of
https://github.com/soukoku/ntwain.git
synced 2025-10-24 01:49:00 +08:00
Started adding more wrapped caps.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<Application x:Class="Tester.WPF.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="Dummy.xaml">
|
||||
StartupUri="Launcher.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<!-- Dummy Style, anything you won't use goes -->
|
||||
<!-- Launcher Style, anything you won't use goes -->
|
||||
<Style TargetType="{x:Type Rectangle}" />
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -13,7 +13,7 @@
|
||||
<ResourceDictionary Source="/ModernWPF;component/Themes/ModernStyles.xaml" />
|
||||
|
||||
<ResourceDictionary>
|
||||
<Style x:Key="AppWindow" TargetType="Window" BasedOn="{StaticResource ModernWindow}"/>
|
||||
<Style x:Key="AppWindow" TargetType="Window" BasedOn="{StaticResource ModernWindowV2}"/>
|
||||
<Style x:Key="AppListBoxItem" TargetType="ListBoxItem" BasedOn="{StaticResource ModernListBoxItem}">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Style.Triggers>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Window x:Class="Tester.WPF.Dummy"
|
||||
<Window x:Class="Tester.WPF.Launcher"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Dummy" Height="300" Width="300">
|
||||
Title="Scan Launcher" Height="200" Width="250"
|
||||
ResizeMode="NoResize" Style="{StaticResource AppWindow}">
|
||||
<Grid>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<Button Content="Open scan window" Click="Button_Click" Margin="4 0"></Button>
|
||||
@@ -14,11 +14,11 @@ using System.Windows.Shapes;
|
||||
namespace Tester.WPF
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Dummy.xaml
|
||||
/// Interaction logic for Launcher.xaml
|
||||
/// </summary>
|
||||
public partial class Dummy : Window
|
||||
public partial class Launcher : Window
|
||||
{
|
||||
public Dummy()
|
||||
public Launcher()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:modern="http://modernwpf"
|
||||
Title="TWAIN DS Tester" Height="600" Width="900" ResizeMode="CanResizeWithGrip"
|
||||
Title="TWAIN Data Source Tester" Height="600" Width="900" ResizeMode="CanResizeWithGrip"
|
||||
Style="{StaticResource AppWindow}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
@@ -23,19 +23,20 @@ namespace Tester.WPF
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
Title = Title + " (64bit)";
|
||||
}
|
||||
else
|
||||
{
|
||||
Title = Title + " (32bit)";
|
||||
}
|
||||
|
||||
_twainVM = new TwainVM();
|
||||
this.DataContext = _twainVM;
|
||||
if (!DesignerProperties.GetIsInDesignMode(this))
|
||||
{
|
||||
if (IntPtr.Size == 8)
|
||||
{
|
||||
Title = Title + " (64bit)";
|
||||
}
|
||||
else
|
||||
{
|
||||
Title = Title + " (32bit)";
|
||||
}
|
||||
|
||||
_twainVM = new TwainVM();
|
||||
this.DataContext = _twainVM;
|
||||
|
||||
Messenger.Default.Register<DialogMessage>(this, msg =>
|
||||
{
|
||||
if (Dispatcher.CheckAccess())
|
||||
@@ -73,6 +74,7 @@ namespace Tester.WPF
|
||||
|
||||
// use this for internal msg loop
|
||||
//var rc = _twainVM.Open();
|
||||
|
||||
// use this to hook into current app loop
|
||||
var rc = _twainVM.Open(new WpfMessageLoopHook(new WindowInteropHelper(this).Handle));
|
||||
|
||||
@@ -88,15 +90,6 @@ namespace Tester.WPF
|
||||
|
||||
private void SrcList_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
//var test = new NTwain.Internals.InternalMessageLoopHook();
|
||||
//test.StartTest();
|
||||
//test.BeginInvoke(() =>
|
||||
//{
|
||||
// Debug.WriteLine("doodle");
|
||||
// test.StopTest();
|
||||
//});
|
||||
|
||||
if (_twainVM.State == 4)
|
||||
{
|
||||
_twainVM.CurrentSource.Close();
|
||||
@@ -358,7 +351,7 @@ namespace Tester.WPF
|
||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||
break;
|
||||
case CapabilityId.CapXferCount:
|
||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapXferCount.Get();
|
||||
break;
|
||||
case CapabilityId.CustomBase:
|
||||
CapDetailList.ItemsSource = _twainVM.CurrentSource.CapGet(cap);
|
||||
|
||||
@@ -47,11 +47,13 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\CommonWin32.2.0.5.4\lib\net35-Client\CommonWin32.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight">
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.1\lib\net40\GalaSoft.MvvmLight.dll</HintPath>
|
||||
<Reference Include="GalaSoft.MvvmLight, Version=4.4.32.16316, Culture=neutral, PublicKeyToken=6bdae7d54059775e, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.5\lib\net40\GalaSoft.MvvmLight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras">
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.1\lib\net40\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
<Reference Include="GalaSoft.MvvmLight.Extras, Version=4.4.32.16316, Culture=neutral, PublicKeyToken=e607f4f44c21a743, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.5\lib\net40\GalaSoft.MvvmLight.Extras.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -59,13 +61,13 @@
|
||||
</Reference>
|
||||
<Reference Include="ModernWPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c99d0cfbea7491ef, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\ModernWPF.1.2.1\lib\net40-Client\ModernWPF.dll</HintPath>
|
||||
<HintPath>..\..\packages\ModernWPF.1.2.5\lib\net40-Client\ModernWPF.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.1\lib\net40\System.Windows.Interactivity.dll</HintPath>
|
||||
<HintPath>..\..\packages\MvvmLightLibs.4.4.32.5\lib\net40\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -84,11 +86,11 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Dummy.xaml.cs">
|
||||
<DependentUpon>Dummy.xaml</DependentUpon>
|
||||
<Compile Include="Launcher.xaml.cs">
|
||||
<DependentUpon>Launcher.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\TwainVM.cs" />
|
||||
<Page Include="Dummy.xaml">
|
||||
<Page Include="Launcher.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<packages>
|
||||
<package id="CommonServiceLocator" version="1.3" targetFramework="net40-Client" />
|
||||
<package id="CommonWin32" version="2.0.5.4" targetFramework="net40-Client" />
|
||||
<package id="ModernWPF" version="1.2.1" targetFramework="net40-Client" />
|
||||
<package id="MvvmLightLibs" version="4.4.32.1" targetFramework="net40-Client" />
|
||||
<package id="ModernWPF" version="1.2.5" targetFramework="net40-Client" />
|
||||
<package id="MvvmLightLibs" version="4.4.32.5" targetFramework="net40-Client" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user