Some more xml doc updates.

This commit is contained in:
Eugene Wang
2018-11-13 21:15:52 -05:00
parent 485810d46f
commit ebc2f49d92
5 changed files with 33 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ namespace NetCoreConsole
var config = new TwainConfigBuilder()
.DefineApp(Assembly.GetExecutingAssembly())
.Build();
Console.WriteLine($"App = {(config.Is64Bit ? "64bit" : "32bit")}");
Console.WriteLine($"Platform = {config.Platform}");
Console.WriteLine();
@@ -38,8 +39,6 @@ namespace NetCoreConsole
var selectSrc = session.ShowSourceSelector();
Console.WriteLine($"Selected data source = {selectSrc}");
Console.WriteLine();
//session.DefaultSource = null;
}
}

View File

@@ -2288,6 +2288,12 @@ namespace NTwain.Data
/// </summary>
public partial struct TW_TWAINDIRECT
{
/// <summary>
/// Constructs this struct.
/// </summary>
/// <param name="manager"></param>
/// <param name="send"></param>
/// <param name="sendSize"></param>
public TW_TWAINDIRECT(ushort manager, IntPtr send, uint sendSize)
{
_SizeOf = (uint)Marshal.SizeOf(typeof(TW_TWAINDIRECT));

View File

@@ -1,5 +1,7 @@
using System;
#pragma warning disable 1591
namespace NTwain.Data
{
// these are from the corresponding twain.h sections
@@ -2081,3 +2083,5 @@ namespace NTwain.Data
True = 1
}
}
#pragma warning restore 1591

View File

@@ -9,12 +9,21 @@ using System.Text;
namespace NTwain
{
/// <summary>
/// Contains settings and platform info for a <see cref="TwainSession"/>.
/// </summary>
public class TwainConfig
{
internal TwainConfig() { }
/// <summary>
/// Gets whether the app is running in 64bit.
/// </summary>
public bool Is64Bit { get; internal set; }
/// <summary>
/// Gets the platform the app is running on.
/// </summary>
public PlatformID Platform { get; internal set; }
//public bool PreferLegacyDsm { get; internal set; }
@@ -23,7 +32,9 @@ namespace NTwain
internal TW_IDENTITY SrcWin32 { get; set; }
/// <summary>
/// Gets memory manager associated with a <see cref="TwainSession"/>.
/// </summary>
public IMemoryManager MemoryManager { get; internal set; }
}
}

View File

@@ -75,7 +75,7 @@ namespace NTwain
}
/// <summary>
/// Gets/sets the default data source.
/// Gets/sets the default data source. Setting to null is not supported.
/// </summary>
public DataSource DefaultSource
{
@@ -90,14 +90,17 @@ namespace NTwain
}
set
{
//if (value != null && value.Session != this)
//{
// throw new InvalidOperationException("Source is not from this session.");
//}
DGControl.Identity.Set(value);
if (value != null)
{
if (value.Session != this)
{
throw new InvalidOperationException("Source is not from this session.");
}
var rc = DGControl.Identity.Set(value);
RaisePropertyChanged(nameof(DefaultSource));
}
}
}
/// <summary>
/// Tries to show the built-in source selector dialog and return the selected source.