Removes the first appearance of the specified category object from
ChildCategories and deletes it from the local disk.
Syntax
Parameters
- category
-
The category object to be deleted.
Example
//
Visual Basic | Copy Code |
---|
Public Sub AutoFormsDeleteCategory(ByVal repository As DiskMasterFormsRepository, ByVal name As String)
DeleteCategory(repository.RootCategory, name)
End Sub
Private Sub DeleteCategory(ByVal category As IMasterFormsCategory, ByVal name As String)
If category.Name = name AndAlso Not category.Parent Is Nothing Then
category.Parent.DeleteChildCategory(category)
End If
For Each childCategory As IMasterFormsCategory In category.ChildCategories
DeleteCategory(childCategory, name)
Next childCategory
End Sub |
C# | Copy Code |
---|
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); } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also