public static extern ReturnCode DsmWinNew( [In, Out] TWIdentity origin, [In, Out] TWIdentity destination, DataGroups dg, DataArgumentType dat, Message msg, [In, Out] TWCustomDSData data);
public static ReturnCode DsmEntry( TWIdentity origin, TWIdentity destination, Message msg, TWCustomDSData data) { if (PlatformInfo.Current.IsWindows) { if (PlatformInfo.Current.UseNewWinDSM) { return(NativeMethods.DsmWinNew(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data)); } else { return(NativeMethods.DsmWinOld(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data)); } } else if (PlatformInfo.Current.IsLinux) { return(NativeMethods.DsmLinux(origin, destination, DataGroups.Control, DataArgumentType.CustomDSData, msg, data)); } throw new PlatformNotSupportedException(); }
/// <summary> /// This operation is used by the application to set the current settings for a data source to a /// previous state as defined by the data contained in the customData data structure. The actual /// format of the data is data source dependent and not defined by TWAIN. /// </summary> /// <param name="customData">The custom data.</param> /// <returns></returns> public ReturnCode Set(TWCustomDSData customData) { Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Set); return(Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Set, customData)); }