예제 #1
0
 /// <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 ();
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <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);
 }
예제 #5
0
        /// <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";
        }
예제 #6
0
 /// <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);
 }
예제 #7
0
 /// <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);
 }
예제 #8
0
 /// <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);
 }
예제 #9
0
 /// <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);
 }
예제 #10
0
 /// <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);
 }
예제 #11
0
 /// <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);
 }