Added open/close to test form.

This commit is contained in:
Eugene Wang
2023-04-01 19:38:04 -04:00
parent a779ee6b0e
commit 1417dbbb14
3 changed files with 123 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ namespace WinForm32
public Form1()
{
InitializeComponent();
Text += TwainPlatform.Is32bit ? " 32bit" : " 64bit";
TwainPlatform.PreferLegacyDSM = true;
twain = new TwainSession(Assembly.GetExecutingAssembly().Location);
@@ -70,5 +70,26 @@ namespace WinForm32
listSources.Items.Add(ds);
}
}
private void btnSetDef_Click(object sender, EventArgs e)
{
if (listSources.SelectedItem is TW_IDENTITY_LEGACY ds)
{
twain.DGControl.Identity.Set(ds);
}
}
private void btnOpen_Click(object sender, EventArgs e)
{
if (listSources.SelectedItem is TW_IDENTITY_LEGACY ds)
{
twain.DGControl.Identity.OpenDS(ds);
}
}
private void btnClose_Click(object sender, EventArgs e)
{
twain.DGControl.Identity.CloseDS();
}
}
}