Restrict access for BusinessLayer Object properties and Methods
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Restrict access for BusinessLayer Object...Expand / Collapse
Author
Message
Posted 04/09/2008 6:20:03 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 10:55:30 PM
Posts: 128, Visits: 386
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 ?

Post #15462
Posted 04/09/2008 9:21:05 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:36:54 PM
Posts: 4,200, Visits: 4,251
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.

Post #15463
Posted 04/09/2008 9:25:30 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 10:55:30 PM
Posts: 128, Visits: 386
Thanks.
Post #15464
Posted 04/09/2008 9:27:16 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 9:36:54 PM
Posts: 4,200, Visits: 4,251
No problem
Post #15467
Posted 04/10/2008 1:42:06 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 10:55:30 PM
Posts: 128, Visits: 386
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

Post #15493
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 12:29am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.