StrataFrame Forum

Restrict access for BusinessLayer Object properties and Methods

http://forum.strataframe.net/Topic15462.aspx

By Ertan Deniz - 4/9/2008

I have an Business Base class that is inhereted from BusinessLayer. I want to restrict some of them and not to see when dealing with my Business Base.

I have overriden some methods then made private. But It does not work. Because I ve got "virtual and abstract methods can not be private."message.

What is the best way ?

By Trent L. Taylor - 4/9/2008

What is the best way ?

You can't change the declaration type of a property, event, or method.  If you want to hide it, then your only option would be to add an attribute like <Browsable(False)> _ to prevent it from showing up in the designer.  There are other attributes as well depending on what you are trying to accoimplish, but you cannot turn a public into a private, etc.  That totally violates object oriented programming and you will have downstream issues.

By Ertan Deniz - 4/9/2008

Thanks.
By Trent L. Taylor - 4/9/2008

No problem Smile
By Ertan Deniz - 4/9/2008

C# : [EditorBrowsable(EditorBrowsableState.Never)] attribute should be used.

There is a link which solves my problem. I 've done the same mistake.

http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms.controls/browse_thread/thread/2f88b987be3948d0?fwc=1