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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top