示例#1
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);
 }
示例#2
0
        /// <summary>
        /// Opens the data source represented by an object of this class
        /// </summary>
        /// <returns>Response of the twain driver</returns>
        internal ReturnCodes Open()
        {
            Close ();

            ReturnCodes openResult = Twain32.OpenDataSource (dataSourceManager.Identity, this.Identity);

            Capability capability = new Capability (dataSourceManager, this, Capabilities.XferCount, -1);
            ReturnCodes xferCountResult = capability.Set ();

            ReturnCodes result = ReturnCodes.Failure;

            if (
                    openResult == ReturnCodes.Success &&
                    xferCountResult == ReturnCodes.Success &&
                    this.Identity.Id != IntPtr.Zero
                )
            {
                result = ReturnCodes.Success;
                isOpen = true;
            }

            return result;
        }