/// <summary> /// Constructor taking a valid data source manager instance /// </summary> /// <param name="dataSourceManager"></param> internal DataSource(DataSourceManager dataSourceManager) { this.dataSourceManager = dataSourceManager; this.Identity = new Identity (); this.Identity.Id = IntPtr.Zero; GetDefault (); }
/// <summary> /// Closes the datasourcemanager /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="parentWindowHandle">Handle of the parentwindow</param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes CloseDataSourceManager( Identity applicationIdentity, ref IntPtr parentWindowHandle) { return Twain32.DataSourceManagerParent ( applicationIdentity, IntPtr.Zero, DataGroups.Control, DataAttributeTypes.Parent, Messages.CloseDataSourceManager, ref parentWindowHandle); }
/// <summary> /// Closes a datasource /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes CloseDataSource( Identity applicationIdentity, Identity dataSourceIdentity) { return DataSourceManagerIdentity ( applicationIdentity, IntPtr.Zero, DataGroups.Control, DataAttributeTypes.Identity, Messages.CloseDataSource, dataSourceIdentity); }
/// <summary> /// Stops the scanning process of a datasource /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="userInterface"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes DisableDataSource( Identity applicationIdentity, Identity dataSourceIdentity, UserInterface userInterface) { return DataSourceUserInterface ( applicationIdentity, dataSourceIdentity, DataGroups.Control, DataAttributeTypes.UserInterface, Messages.DisableDataSource, userInterface); }
/// <summary> /// Constructor /// </summary> internal DataSourceManager() { this.Identity = new Identity (); Identity = new Identity (); Identity.Id = IntPtr.Zero; Identity.Version.MajorNum = 1; Identity.Version.MinorNum = 1; Identity.Version.Language = languageUsa; Identity.Version.Country = countryUsa; Identity.Version.Info = "everyday Solutions"; Identity.ProtocolMajor = Protocols.Major; Identity.ProtocolMinor = Protocols.Minor; Identity.SupportedGroups = (int) (DataGroups.Image | DataGroups.Control); Identity.Manufacturer = "everyday Solutions"; Identity.ProductFamily = "everyday Solutions"; Identity.ProductName = "everyday Solutions"; }
/// <summary> /// Set a capability of a datasource /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="capability"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes SetCapability( Identity applicationIdentity, Identity dataSourceIdentity, Capability capability) { return DataSourceCapability ( applicationIdentity, dataSourceIdentity, DataGroups.Control, DataAttributeTypes.Capability, Messages.Set, capability); }
/// <summary> /// Resets all pending transfers /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="pendingXfer"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes ResetPendingXfer( Identity applicationIdentity, Identity dataSourceIdentity, PendingXfersInterop pendingXfer) { return DataSourcePendingXfer ( applicationIdentity, dataSourceIdentity, DataGroups.Control, DataAttributeTypes.PendingXfers, Messages.Reset, pendingXfer); }
/// <summary> /// Routes a windowsmessage to the twaindriver which translate into a twainmessage /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="eventMessage"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes ProcessMessage( Identity applicationIdentity, Identity dataSourceIdentity, ref EventInterop eventMessage) { return DataSourceEvent ( applicationIdentity, dataSourceIdentity, DataGroups.Control, DataAttributeTypes.Event, Messages.ProcessEvent, ref eventMessage); }
/// <summary> /// Transfers the bitmap bits from the twaindriver to the application /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="bitmapHandle"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes GetImageNativeXfer( Identity applicationIdentity, Identity dataSourceIdentity, ref IntPtr bitmapHandle) { return DataSourceImageNativeXfer ( applicationIdentity, dataSourceIdentity, DataGroups.Image, DataAttributeTypes.ImageNativeXfer, Messages.Get, ref bitmapHandle); }
/// <summary> /// Receives infos about images ready for transferation /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <param name="imageInfo"></param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes GetImageInfo( Identity applicationIdentity, Identity dataSourceIdentity, ref ImageInfoInterop imageInfo) { return DataSourceImageInfo ( applicationIdentity, dataSourceIdentity, DataGroups.Image, DataAttributeTypes.ImageInfo, Messages.Get, imageInfo); }
/// <summary> /// Receives the default twain datasource /// </summary> /// <param name="applicationIdentity">Identity of the application</param> /// <param name="dataSourceIdentity">Identity of the datasource</param> /// <returns>Reply of the twaindriver</returns> internal static ReturnCodes GetDefaultDataSource( Identity applicationIdentity, Identity dataSourceIdentity) { return Twain32.DataSourceManagerIdentity ( applicationIdentity, IntPtr.Zero, DataGroups.Control, DataAttributeTypes.Identity, Messages.GetDefault, dataSourceIdentity); }