示例#1
0
 public ScanController(ITracer tracer, IScanManager scanManager, IEnvironment webAppRuntimeEnvironment)
 {
     _tracer      = tracer;
     _scanManager = scanManager;
     _webAppRuntimeEnvironment = webAppRuntimeEnvironment;
     mainScanDirPath           = Path.Combine(_webAppRuntimeEnvironment.LogFilesPath, "kudu", "scan");
 }
 /// <summary>
 ///     Initialises a new instance of the <see cref="TvShowsController" /> class.
 /// </summary>
 /// <param name="storageProvider">The storage provider.</param>
 /// <param name="tvShowRepository">The TV show repository.</param>
 /// <param name="scanManager">The scan manager.</param>
 public TvShowsController(
     IStorageProvider storageProvider,
     ITvShowRepository tvShowRepository,
     IScanManager scanManager)
 {
     this.storageProvider  = storageProvider;
     this.tvShowRepository = tvShowRepository;
     this.scanManager      = scanManager;
 }
示例#3
0
 /// <summary>
 ///     Initialises a new instance of the <see cref="FileManager" /> class. Initialises a new instance of the
 ///     <see cref="FileManager" /> class.
 /// </summary>
 /// <param name="storageProvider">
 ///     The storage provider.
 /// </param>
 /// <param name="dataProvider">
 ///     The data provider.
 /// </param>
 /// <param name="scanManager">
 ///     The scan manager.
 /// </param>
 /// <param name="fileResultManager">
 ///     The file result manager.
 /// </param>
 public FileManager(
     IStorageProvider storageProvider,
     IDataProvider dataProvider,
     IScanManager scanManager,
     IFileResultManager fileResultManager)
 {
     this.storageProvider   = storageProvider;
     settings               = storageProvider.Settings;
     this.scanManager       = scanManager;
     this.fileResultManager = fileResultManager;
 }
示例#4
0
 /// <summary>
 ///     Initialises a new instance of the <see cref="FileSearch" /> class.
 /// </summary>
 /// <param name="storageProvider">
 ///     The storage provider.
 /// </param>
 /// <param name="dataProvider">
 ///     The data provider.
 /// </param>
 /// <param name="scanManager">
 ///     The scan manager.
 /// </param>
 /// <param name="fileManager">
 ///     The file manager.
 /// </param>
 public FileSearch(
     IStorageProvider storageProvider,
     IDataProvider dataProvider,
     IScanManager scanManager,
     IFileManager fileManager)
 {
     Results = new List <FileResult>();
     this.storageProvider = storageProvider;
     this.dataProvider    = dataProvider;
     this.scanManager     = scanManager;
     this.fileManager     = fileManager;
 }
        // USE CASE: Scanning with ABBYY FlexiCapture Engine
        public static void Scanning_with_FlexiCapture_Engine(IEngine engine)
        {
            // Create an instance of ScanManager
            trace("Create an instance of ScanManager...");
            IScanManager scanManager = engine.CreateScanManager();

            // Enumerate scan sources
            traceBegin("Enumerate scan sources: ");
            IStringsCollection sources     = scanManager.ScanSources;
            string             sourcesList = "";

            if (sources.Count > 0)
            {
                for (int i = 0; i < sources.Count; i++)
                {
                    if (sourcesList.Length > 0)
                    {
                        sourcesList += ", ";
                    }
                    sourcesList += '\'' + sources[i] + '\'';
                }
            }
            else
            {
                sourcesList = "Not Found";
            }
            traceEnd(sourcesList);

            // If at least one scan source found
            if (sources.Count > 0)
            {
                // In this sample we will be using the first found scan source
                string scanSource = sources[0];

                // You can optionally change the scan source settings or leave defaults
                // trace( "Configure scan source " + '\'' + scanSource + '\'' );
                // IScanSourceSettings sourceSettings = scanManager.get_ScanSourceSettings( scanSource );
                // sourceSettings.PictureMode = ScanPictureModeEnum.SPM_Grayscale;
                // scanManager.set_ScanSourceSettings( scanSource, sourceSettings );

                // Prepare a directory to store scanned images
                string scanFolder = SamplesFolder + "\\FCEScanning";
                System.IO.Directory.CreateDirectory(scanFolder);

                if (IsInteractive)
                {
                    // If the scenario is being run in interactive mode you can try scanning by uncommenting the lines below
                    trace("Scanning is disabled.");
                    // traceBegin( "Scanning... " );
                    // Get a single image from the scan source
                    // IStringsCollection imageFiles = scanManager.Scan( scanSource, scanFolder, false );
                    // assert( imageFiles.Count == 1 );
                    // assert( System.IO.File.Exists( imageFiles[0] ) );
                    // System.IO.File.Delete( imageFiles[0] );
                    // traceEnd( "OK" );
                }
                else
                {
                    trace("Running in non-interactive mode. Scanning skipped.");
                }
            }
        }