|
-
Apr 27th, 2005, 04:37 PM
#1
Thread Starter
Frenzied Member
Make abstract class only visible to my classes
I have an abstract class and I only want it visible to my classes only. If somebody references the library, I don't want them to be able to inherit from my abstract class.
Code:
// Class1.cs
abstract class Class1
{
}
Code:
// Class2.cs
public class Class2 : Class1
{
}
The compile error tells me Class1 is less accessible than Class2.
Making Class1 public works but it makes it visible and (inheritable) by any other class but I only want it to be inherited by the classes I specify. Is this possible or necessary?
-
Apr 27th, 2005, 04:45 PM
#2
Addicted Member
Re: Make abstract class only visible to my classes
Use internal instead of public.
It makes your class only accessible for the project in which it is located.
There are no stupid questions, but a whole bunch of dumb sayings !
Save time on database code, try DataLG !
-
Apr 27th, 2005, 04:48 PM
#3
Addicted Member
Re: Make abstract class only visible to my classes
excuse my previous post, it doesn't address your problem effectively.
There are no stupid questions, but a whole bunch of dumb sayings !
Save time on database code, try DataLG !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|