Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Internal enum ?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600724
Message ID:
01600737
Vues:
65
This message has been marked as a message which has helped to the initial question of the thread.
Why not just make it public? Internal is meant to be well internal and if you need to expose outside of the original assembly you probably should use public.

Friend behavior can be useful, but you really have to ask yourself whether it's worth the hassle for a semantic aspect to try to preserve internal visibility - especially for a constant (enum) that has no functionality that can be abused externally.

+++ Rick ---

>Hi everybody,
>
>I introduced internal enum in my class. I have a method that returns value of that enum. I want to be able to test that method in a test project which is part of my solution.
>
>I added the following line to my class code at the very top
>
>
>[assembly: InternalsVisibleTo("TestProject")]
>
>As a result I am able to see the methods of the class, but I am unable to declare a variable of the type my enum.
>
>Other than making that enum public is there another solution?
>
>Thanks in advance.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform