2018-11-14 10:02:29 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace NTwain.Triplets
|
2018-11-14 08:30:58 +08:00
|
|
|
|
{
|
2018-11-14 10:02:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Base class for grouping triplet operations.
|
|
|
|
|
/// </summary>
|
2018-11-14 08:30:58 +08:00
|
|
|
|
public abstract class BaseTriplet
|
|
|
|
|
{
|
2018-11-14 10:02:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the associated <see cref="TwainSession"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly TwainSession Session;
|
2018-11-14 08:30:58 +08:00
|
|
|
|
|
2018-11-14 10:02:29 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of the <see cref="BaseTriplet" /> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="session">The session.</param>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
|
|
|
|
protected BaseTriplet(TwainSession session)
|
2018-11-14 08:30:58 +08:00
|
|
|
|
{
|
2018-11-14 10:02:29 +08:00
|
|
|
|
this.Session = session ?? throw new ArgumentNullException(nameof(session));
|
2018-11-17 23:55:37 +08:00
|
|
|
|
|
|
|
|
|
Is32Bit = session.Config.Is32Bit;
|
|
|
|
|
IsWin = session.Config.Platform == System.PlatformID.Win32NT;
|
|
|
|
|
IsLinux = session.Config.Platform == System.PlatformID.Unix;
|
|
|
|
|
IsMac = session.Config.Platform == System.PlatformID.MacOSX;
|
2018-11-14 08:30:58 +08:00
|
|
|
|
}
|
2018-11-16 09:31:39 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether to use 32bit data structures.
|
|
|
|
|
/// </summary>
|
2018-11-17 23:55:37 +08:00
|
|
|
|
protected readonly bool Is32Bit;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether platform is Windows.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly bool IsWin;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether platform is Linux.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly bool IsLinux;
|
2018-12-01 11:17:16 +08:00
|
|
|
|
/// <summary>
|
2018-11-17 23:55:37 +08:00
|
|
|
|
/// Whether platform is MacOS.
|
2018-12-01 11:17:16 +08:00
|
|
|
|
/// </summary>
|
2018-11-17 23:55:37 +08:00
|
|
|
|
protected readonly bool IsMac;
|
2018-11-14 08:30:58 +08:00
|
|
|
|
}
|
|
|
|
|
}
|