Esempio n. 1
0
        /// <summary>
        /// Process a TWAIN Direct task...
        /// </summary>
        /// <param name="a_jsonlookup">data for the task</param>
        /// <param name="a_swordtask">the result of the task</param>
        /// <returns>a twain local status</returns>
        private TwainLocalScanner.ApiStatus DeviceScannerSendTask(JsonLookup a_jsonlookup, out SwordTask a_swordtask, ref bool a_blSetAppCapabilities)
        {
            bool   blSuccess;
            string szTask;
            Sword  sword;

            // Init stuff...
            a_swordtask            = new SwordTask();
            m_szScanImageArguments = "";

            // Create our object...
            sword = new Sword();

            // Grab our task...
            szTask = a_jsonlookup.GetJson("task");

            // Run our task...
            blSuccess = sword.BatchMode(m_szScanner, szTask, true, ref a_swordtask, ref a_blSetAppCapabilities, out m_szScanImageArguments);
            if (!blSuccess)
            {
                return(TwainLocalScanner.ApiStatus.invalidCapturingOptions);
            }

            // All done...
            return(TwainLocalScanner.ApiStatus.success);
        }