当前位置: 首页>>代码示例>>C#>>正文


C# IEngine.OpenProject方法代码示例

本文整理汇总了C#中IEngine.OpenProject方法的典型用法代码示例。如果您正苦于以下问题:C# IEngine.OpenProject方法的具体用法?C# IEngine.OpenProject怎么用?C# IEngine.OpenProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEngine的用法示例。


在下文中一共展示了IEngine.OpenProject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Using_a_configured_FlexiCapture_project_to_recognize_image_files

        // USE CASE: Using a configured FlexiCapture project to recognize image files
        public static void Using_a_configured_FlexiCapture_project_to_recognize_image_files( IEngine engine )
        {
            trace( "Open the sample project..." );
            IProject project = engine.OpenProject( SamplesFolder + "\\SampleProject\\Invoices_eng.fcproj" );

            try {
                trace( "Add a new batch..." );
                IBatch batch = project.Batches.AddNew( "TestBatch" );

                trace( "Open the batch..." );
                batch.Open();

                try {
                    trace( "Add image files to the batch..." );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_1.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_2.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_3.tif" );

                    trace( "Recognize all images in the batch..." );
                    batch.Recognize( null, RecognitionModeEnum.RM_ReRecognizeMinimal, null );

                    trace( "Export the results..." );
                    batch.Export( null, null );

                    trace( "Close and delete the batch..." );
                } finally {
                    batch.Close(); // Before the batch could be deleted, it has to be closed
                    project.Batches.DeleteAll();
                }

                trace( "Close the project..." );
            } finally {
                project.Close();
            }
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:36,代码来源:Working+with+an+existing+FlexiCapture+project.cs

示例2: Using_batch_processing_events

        // USE CASE: Using batch processing events
        public static void Using_batch_processing_events( IEngine engine )
        {
            trace( "Open a project..." );
            IProject project = engine.OpenProject( SamplesFolder + "\\SampleProject\\Invoices_eng.fcproj" );

            try {
                trace( "Add a new batch..." );
                IBatch batch = project.Batches.AddNew( "TestBatch" );

                trace( "Open the new batch..." );
                batch.Open();

                // Here we create an events sink which will capture batch processing events and
                // show progress and tracing messages in the status bar. This will also make UI
                // more responsive to user input. See definition of the sink class for details
                trace( "Start listening to batch processing events..." );
                SampleBatchEventsSink eventsSink = new SampleBatchEventsSink( batch );

                try {
                    trace( "Add the image files to the batch..." );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_1.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_2.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_3.tif" );

                    trace( "Recognize the batch..." );
                    batch.Recognize( null, RecognitionModeEnum.RM_ReRecognizeMinimal, null );

                    trace( "Export the results..." );
                    batch.Export( null, null );

                    trace( "Close and delete the batch..." );
                } finally {
                    eventsSink.Dispose();
                    batch.Close();
                    project.Batches.DeleteAll();
                }

                trace( "Close the project..." );
            } finally {
                project.Close();
            }
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:43,代码来源:Working+with+an+existing+FlexiCapture+project.cs

示例3: Verifying_recognized_documents

        // USE CASE: Verifying recognized documents
        public static void Verifying_recognized_documents( IEngine engine )
        {
            trace( "Open the sample project..." );
            IProject project = engine.OpenProject( SamplesFolder + "\\SampleProject\\Invoices_eng.fcproj" );

            try {
                trace( "Prepare a new batch for verification..." );
                IBatch batch = PrepareNewRecognizedBatch( engine, project );
                try {
                    traceBegin( "Run verification..." );

                    trace( "Start verification session (all documents in the batch)..." );
                    IVerificationSession verificationSession = batch.StartVerification( null );
                    try {
                        trace( "Change verification options if required..." );
                        IVerificationOptions verificationOptions = verificationSession.Options;
                        verificationOptions.VerifyExtraSymbols = true;

                        trace( "Open a set of documents (a work set) and collect objects that need to be verified..." );
                        IVerificationWorkSet verificationWorkSet = verificationSession.NextWorkSet();
                        while( verificationWorkSet != null ) {
                            trace( "For each group of objects show the objects to the verification operator for confirmation..." );
                            IVerificationGroup verificationGroup = verificationWorkSet.NextGroup();
                            while( verificationGroup != null ) {
                                trace( "Verification Group: " + verificationGroup.Description + " (confirm all)" );
                                for( int i = 0; i < verificationGroup.Count; i++ ) {
                                    IVerificationObject verificationObject = verificationGroup.Item( i );
                                    if( verificationObject.Type == VerificationObjectTypeEnum.VOT_Group ) {
                                        verificationObject.State = VerificationObjectStateEnum.VOS_Confirmed;
                                    } else {
                                        IContextVerificationObject contextVerificationObject = verificationObject.AsContextVerificationObject();

                                        // If field value is modified during verification you should recheck rules for
                                        // the corresponding field
                                        contextVerificationObject.CheckRules();

                                        contextVerificationObject.Field.Value.SetVerified();
                                    }
                                }

                                verificationGroup = verificationWorkSet.NextGroup();
                            }
                            trace( "Save verification results (all documents in the set)..." );
                            verificationWorkSet.Commit();

                            trace( "Open the next set of documents..." );
                            verificationWorkSet = verificationSession.NextWorkSet();
                        }

                        trace( "Close the session..." );
                    } finally {
                        // Verification consumes considerable system resources (many simultaniously
                        // open and loaded documents and images). So it is VERY important that
                        // these resources should be released in timely manner and not left for
                        // garbage collector to manage.
                        verificationSession.Close();
                    }

                    trace( "Check that the documents do not need verification now..." );
                    IDocuments batchDocuments = batch.Documents;
                    for( int i = 0; i < batchDocuments.Count; i++ ) {
                        IDocument document = batchDocuments.Item( i );
                        document.Open( false );
                        try {
                            recursiveCheckVerified( engine, document.Sections );
                        } finally {
                            document.Close( false );
                        }
                    }

                    traceEnd( "OK" );

                } finally {
                    batch.Close();
                    project.Batches.DeleteAll();
                }

            } finally {
                project.Close();
            }

            traceEnd( "OK" );
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:84,代码来源:Working+with+an+existing+FlexiCapture+project.cs

示例4: Using_collection_events

        // USE CASE: Using collection events
        public static void Using_collection_events( IEngine engine )
        {
            // Collection events are mainly intended for use in creating UI views for FlexiCapture Engine objects.
            // By listening to collection events listeners can duly react to changes in the model.

            trace( "Open the project..." );
            IProject project = engine.OpenProject( SamplesFolder + "\\SampleProject\\Invoices_eng.fcproj" );

            // Start listening to project.Batches events. In a real-life usage scenario the listener
            // would be some kind of a visual control, showing the list of batches and redrawing
            // itself when the collection changes
            SampleCollectionEventsSink batchesEvents = new SampleCollectionEventsSink( project.Batches, "project.Batches" );

            try {
                trace( "Add a new batch..." );
                IBatch batch = project.Batches.AddNew( "TestBatch" );

                trace( "Open the new batch..." );
                batch.Open();

                // Start listening to batch.Documents events. In a real-life usage scenario the listener
                // would be some kind of a visual control, showing the list of documents and redrawing
                // itself when the collection changes
                SampleCollectionEventsSink documentsEvents = new SampleCollectionEventsSink( batch.Documents, "batch.Documents" );

                try {
                    trace( "Add the image files to the batch..." );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_1.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_2.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_3.tif" );

                    trace( "Recognize the batch..." );
                    batch.Recognize( null, RecognitionModeEnum.RM_ReRecognizeMinimal, null );

                    trace( "Export the results..." );
                    batch.Export( null, null );

                    trace( "Close and delete the batch..." );
                } finally {
                    documentsEvents.Dispose();
                    batch.Close();
                    project.Batches.DeleteAll();
                }

                trace( "Close the project..." );
            } finally {
                batchesEvents.Dispose();
                project.Close();
            }
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:51,代码来源:Working+with+an+existing+FlexiCapture+project.cs

示例5: DisposableProject

 // This sample is limited to using .NET Framework 1.1 by design. If you are working
 // with a newer version, you might consider using generics.
 public DisposableProject( IEngine engine, string path )
 {
     project = engine.OpenProject( path );
     trace( "Opened" );
 }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:7,代码来源:Frequently+asked+questions.cs


注:本文中的IEngine.OpenProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。