mirror of
https://github.com/soukoku/ntwain.git
synced 2025-04-05 20:59:23 +08:00
Added parameterless ctor for TwainAppSession.
This commit is contained in:
parent
f25587cab2
commit
474b066bd0
@ -11,7 +11,7 @@ namespace WinConsole32
|
||||
var libVer = FileVersionInfo.GetVersionInfo(typeof(TwainAppSession).Assembly.Location).ProductVersion;
|
||||
Console.WriteLine($"Console sample {(TWPlatform.Is32bit ? " 32bit" : " 64bit")} on NTwain {libVer}");
|
||||
|
||||
TwainAppSession session = new TwainAppSession(new TW_IDENTITY_LEGACY(Environment.ProcessPath!));
|
||||
TwainAppSession session = new TwainAppSession();
|
||||
|
||||
session.StateChanged += Session_StateChanged;
|
||||
session.SourceDisabled += Session_SourceDisabled1;
|
||||
|
@ -37,7 +37,7 @@ namespace WinFormSample
|
||||
|
||||
TWPlatform.PreferLegacyDSM = false;
|
||||
|
||||
twain = new TwainAppSession(new TW_IDENTITY_LEGACY(Assembly.GetExecutingAssembly().Location));
|
||||
twain = new TwainAppSession();
|
||||
twain.StateChanged += Twain_StateChanged;
|
||||
twain.DefaultSourceChanged += Twain_DefaultSourceChanged;
|
||||
twain.CurrentSourceChanged += Twain_CurrentSourceChanged;
|
||||
|
@ -1,6 +1,7 @@
|
||||
using NTwain.Data;
|
||||
using NTwain.Triplets;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@ -12,6 +13,12 @@ namespace NTwain
|
||||
|
||||
public partial class TwainAppSession : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates TWAIN session with current app info.
|
||||
/// </summary>
|
||||
public TwainAppSession()
|
||||
: this(new TW_IDENTITY_LEGACY(Environment.GetCommandLineArgs()[0])) { }
|
||||
|
||||
/// <summary>
|
||||
/// Creates TWAIN session with explicit app info.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user