←Select platform

ActionElements Property

Summary

Gets a collection of ActionElement objects.

Syntax
C#
C++/CLI
Python
public List<ActionElement> ActionElements { get; } 
public:  
   property List<ActionElement^>^ ActionElements 
   { 
      List<ActionElement^>^ get() 
   } 
ActionElements # get  (ActionElementSet) 
Remarks

Fill in the list to add actions to the actions set.

Example

This example shows how to define and run a custom action ActionElementSet.

C#
using Leadtools; 
using Leadtools.Document.Analytics; 
using Leadtools.Document; 
using Leadtools.Document.Unstructured; 
 
 
 
public class RedactAction : ActionElement 
{ 
   public RedactAction() 
   { 
      Id = "REDACT_DOCUMENT"; 
   } 
 
   public override void Run(LEADDocument document, IList<ElementSetResult> results) 
   { 
      //process(document, results.Items); 
      //save(document); 
   }          
} 
 
public void Sample() 
{ 
   var leadDoc = DocumentFactory.LoadFromFile(@"c:\test.docx", new LoadDocumentOptions()); 
   var analyzer = new DocumentAnalyzer(); 
   var elem = new UnstructuredElementSet() { Name = "Test", Element = CreateElement() }; 
   var actions = new ActionElementSet(); 
   actions.ActionElements.Add(new RedactAction()); 
 
   var runOptions = new DocumentAnalyzerRunOptions() 
   {             
      Actions = actions, 
   }; 
   runOptions.Elements.Add(elem); 
   analyzer.Run(leadDoc, runOptions); 
} 
 
private static GroupElement CreateElement() 
{ 
   GroupElement mainGroup = new GroupElement(); 
   mainGroup.Id = "ALL"; 
   mainGroup.Settings.SetValue(SettingsManager.Name, "all"); 
   mainGroup.Settings.SetValue(SettingsManager.ReportInElementResult, "true"); 
   mainGroup.Settings.SetValue(SettingsManager.Description, "Rules"); 
   mainGroup.Settings.SetValue(SettingsManager.Language, "en"); 
                   
   return mainGroup; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Analytics Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.