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


C# IEngine.CreateVerificationSession方法代码示例

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


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

示例1: Verifying_recognized_documents

        // USE CASE: Verifying recognized documents
        public static void Verifying_recognized_documents( IEngine engine )
        {
            trace( "Prepare documents and add them to a collection..." );
            IDocumentsCollection documentsToVerify = engine.CreateDocumentsCollection();
            documentsToVerify.Add( PrepareNewRecognizedDocument( engine ) );
            documentsToVerify.Add( PrepareNewRecognizedDocument( engine ) );

            traceBegin( "Run verification..." );

            IVerificationSession verificationSession = engine.CreateVerificationSession( documentsToVerify );
            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..." );
            for( int i = 0; i < documentsToVerify.Count; i++ ) {
                IDocument document = documentsToVerify.Item( i );
                recursiveCheckVerified( engine, document.Sections );
            }

            traceEnd( "OK" );

            traceEnd( "OK" );
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:68,代码来源:Using+FlexiCapture+technology+API.cs


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