←Select platform

DeleteChildCategory Method

Summary
Removes the first appearance of the specified category object from ChildCategories and deletes it from the local disk.

Syntax
C#
C++/CLI
Java
Python
public void DeleteChildCategory( 
   IMasterFormsCategory category 
) 
public void deleteChildCategory( 
   IMasterFormsCategory 
); 
public: 
void DeleteChildCategory(  
   IMasterFormsCategory^ category 
)  
def DeleteChildCategory(self,category): 

Parameters

category
The category object to be deleted.

Remarks

The source code for this interface implementation class is available at <INSTALLDIR>\Examples\Forms\DotNet\AutoMasterFormsRepository.

The  category directory will be deleted and cannot be restored. If the user wants to do different action he can inherit this class and override this method or do a custom implementation of IMasterFormsCategory. Be advised to have a back up copy of all Master Forms if this used this class, in case you have deleted the wrong Category.

There is no need to call DiskMasterFormsRepository.Refresh since the repository that this category belongs will be updated with this deletion.

Example

//

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Auto; 
using Leadtools.Document; 
using Leadtools.Ocr; 
using Leadtools.Forms.Recognition; 
using Leadtools.Forms.Processing; 
using Leadtools.Barcode; 
 
 
public void AutoFormsDeleteCategory(DiskMasterFormsRepository repository, string name) 
{ 
   DeleteCategory(repository.RootCategory, name); 
} 
 
public void DeleteCategory(IMasterFormsCategory category, string name) 
{ 
   if (category.Name == name && category.Parent != null) 
      category.Parent.DeleteChildCategory(category); 
   foreach (IMasterFormsCategory childCategory in category.ChildCategories) 
   { 
      DeleteCategory(childCategory, name); 
   } 
} 
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.Forms.Auto Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.