Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Prevent browsing of the namespace extension

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensions.Net
View previous topic :: View next topic  
Author Message
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.
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensions.Net All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group