Allow instantiation internal but not external?

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

Is there any way to define a class in such a way that it will allow
instantiation of the class internal to my project but not allow it when
the class is used via the resulting DLL of my project? In ActiveX this
can be done with the noncreatable keyword. How can this be done in .Net?

I tried making the constructor protected protected but that did not seem
to work.
 
C# has an "internal" keyword.
Is there any way to define a class in such a way that it will allow
instantiation of the class internal to my project but not allow it when
the class is used via the resulting DLL of my project? In ActiveX this
can be done with the noncreatable keyword. How can this be done in .Net?

I tried making the constructor protected protected but that did not seem
to work.

/steveA
 
Steve said:
C# has an "internal" keyword.

Thanks,

I tried again and placing all of the constructors under "private public"
does indeed work. VB's Intellisense allows the new keyword to be used
but throws an error once used.


Bruce
 
Back
Top