Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Wed Aug 20, 2008 10:12 am Post subject: HOWTO: Prevent browsing of the namespace extension |
|
|
Under some conditions or circumstances, it may be desirable to prevent the user from browsing the namespace extension (either the root folder or any interior folder). To achieve this, simply throw an exception from the GetChildren method of the NSEFolder derived class representing the root folder or interior folder of the namespace extension.
[C#]
public override IEnumerable GetChildren(GetChildrenEventArgs e)
{
if(some condition satisfied)
throw new Exception(); // Prevent browsing to this folder
}
[VB.Net]
Public Overrides Function GetChildren(ByVal e As GetChildrenEventArgs) As IEnumerable
If (some condition satisfied) Then
Throw New Exception() 'Prevent browsing to this folder
End If
End Function
Note
If the folder uses custom views, the GetChildren method is never called. In this case, simply throw the exception in the GetCustomView overridden method. |
|