Support
Joined: 18 Jul 2005 Posts: 731
|
Posted: Wed Aug 20, 2008 11:54 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 function of the CNSEFolder derived class representing the root folder or interior folder of the namespace extension.
BOOL CFolderItem::GetChildren(CGetChildrenEventArgs& e)
{
if(some condition satisfied)
throw new CException(); // Prevent browsing to this folder
}
Note
If the folder uses custom views, the GetChildren function is never called. In this case, simply throw the exception in the GetCustomView overridden function. |
|