Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataTable.GetChanges() Crashes...
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01189575
Message ID:
01192296
Vues:
15
Hi Ben,

> I am trying to figure out if there is a way to ensure that this object cannot be instantiated without the needed parameters...but right now I don't see a way of doing that.

You could make the constructor internal and specify the assembly with the call to your constructor as a friend assembly:
using System.Runtime.CompilerServices;
[assembly:InternalsVisibleTo("name, PublicKey=.....")]

class Whatever
{
  internal Whatever() {}
}
This gives the assembly "name" access to all public and internal types in the DLL. Please note that you have to specify the public key, not the abbreviated public key token. The constructor would still be visible to other classes in your assembly, though.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform