Click here to Skip to main content
15,797,822 members
Home / Discussions / C#
   

C#

 
JokeRe: Importing environment variables Pin
W. Kleinschmit24-Feb-09 14:18
W. Kleinschmit24-Feb-09 14:18 
GeneralRe: Importing environment variables Pin
W. Kleinschmit24-Feb-09 14:27
W. Kleinschmit24-Feb-09 14:27 
GeneralRe: Importing environment variables Pin
PIEBALDconsult24-Feb-09 16:03
professionalPIEBALDconsult24-Feb-09 16:03 
QuestionDisassembly cannot be displayed. The expression has not yet been translated to native machine code. Pin
bemahesh24-Feb-09 12:32
bemahesh24-Feb-09 12:32 
AnswerRe: Disassembly cannot be displayed. The expression has not yet been translated to native machine code. Pin
Mark Churchill24-Feb-09 15:07
Mark Churchill24-Feb-09 15:07 
QuestionProblem with multiple insert via TransactionScope class. Pin
hdv21224-Feb-09 11:58
hdv21224-Feb-09 11:58 
AnswerRe: Problem with multiple insert via TransactionScope class. Pin
Jon Rista24-Feb-09 13:35
Jon Rista24-Feb-09 13:35 
QuestionC# alias Pin
Bill Stumps24-Feb-09 11:05
Bill Stumps24-Feb-09 11:05 
Hi there

I'm just beginning to get my head around C#, having moved from a background in C/C++, Java, and (a long time ago) Pascal.

I'm writing a program in which I have declared a series of classes that model the data layer and which, as in this layer I'm working with .xml, the class names reflect the schema of that layer, with names like ...Node and ...ChildNode and the like. As I now move up to the business model layer, I'd like to recast these type names to others more suitable to that model. For example, instead of XMLProjectNode I'd like to just use Project.

I'm experimenting with aliases and using things like:
using Project = My.Namespace.XMLProjectNode;

but what I'd like to be able to do is declare these aliases somewhere in a once-for-all location so that they can be imported into any module for immediate use without the need for redefinition.

In C++ I would put some #defines in a header file and #include it wherever I needed them. However, I can't seem to find an analogous way to do that in C#.

Am I missing something, or is this not possible?

Many thanks

BS
AnswerRe: C# alias Pin
Pete O'Hanlon24-Feb-09 11:10
subeditorPete O'Hanlon24-Feb-09 11:10 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 11:31
professionalPIEBALDconsult24-Feb-09 11:31 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 11:49
subeditorPete O'Hanlon24-Feb-09 11:49 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 11:56
professionalPIEBALDconsult24-Feb-09 11:56 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 12:07
subeditorPete O'Hanlon24-Feb-09 12:07 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 13:55
professionalPIEBALDconsult24-Feb-09 13:55 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 17:00
professional_Maxxx_24-Feb-09 17:00 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 17:42
professionalPIEBALDconsult24-Feb-09 17:42 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 22:23
professional_Maxxx_24-Feb-09 22:23 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 22:46
subeditorPete O'Hanlon24-Feb-09 22:46 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 23:54
professional_Maxxx_24-Feb-09 23:54 
GeneralRe: C# alias Pin
Jon Rista24-Feb-09 13:41
Jon Rista24-Feb-09 13:41 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 13:53
professionalPIEBALDconsult24-Feb-09 13:53 
GeneralRe: C# alias Pin
Jon Rista24-Feb-09 18:06
Jon Rista24-Feb-09 18:06 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 18:13
professionalPIEBALDconsult24-Feb-09 18:13 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 19:35
professionalPIEBALDconsult24-Feb-09 19:35 
GeneralRe: C# alias Pin
Bill Stumps25-Feb-09 21:42
Bill Stumps25-Feb-09 21:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.