Re: Creating a "public only" constructor

Shawn Wildermuth <[email protected]> Sun, 5 Apr 2009 23:55:17 -0400
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
I don't think you can.  Can you explain why you want to protect it from
internal classes?

Thanks,

Shawn Wildermuth
http://wildermuth.com
https://agilitrain.com
Microsoft MVP (C#), MCSD.NET, Author and Speaker

The Silverlight Tour is coming to a city near you! 


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[email protected]] On Behalf Of Dean Cleaver
Sent: Sunday, April 05, 2009 11:42 PM
To: [email protected]
Subject: [ADVANCED-DOTNET] Creating a "public only" constructor

Hey, anyone know if you can do this with attributes or something? I want to
have 2 public constructors:

public ClassName()
{
}

public ClassName(some param)
{
}

I want both publically accessible, but I want the default one *inaccessible*
internally. Can that be done?

Dino

===================================
View archives and manage your subscription(s) at
http://peach.ease.lsoft.com/archives

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives