Click here to Skip to main content
15,908,111 members
Home / Discussions / C#
   

C#

 
JokeRe: Importing environment variables Pin
W. Kleinschmit24-Feb-09 13:18
W. Kleinschmit24-Feb-09 13:18 
GeneralRe: Importing environment variables Pin
W. Kleinschmit24-Feb-09 13:27
W. Kleinschmit24-Feb-09 13:27 
GeneralRe: Importing environment variables Pin
PIEBALDconsult24-Feb-09 15:03
mvePIEBALDconsult24-Feb-09 15:03 
QuestionDisassembly cannot be displayed. The expression has not yet been translated to native machine code. Pin
bemahesh24-Feb-09 11:32
bemahesh24-Feb-09 11:32 
AnswerRe: Disassembly cannot be displayed. The expression has not yet been translated to native machine code. Pin
Mark Churchill24-Feb-09 14:07
Mark Churchill24-Feb-09 14:07 
QuestionProblem with multiple insert via TransactionScope class. Pin
hdv21224-Feb-09 10:58
hdv21224-Feb-09 10:58 
AnswerRe: Problem with multiple insert via TransactionScope class. Pin
Jon Rista24-Feb-09 12:35
Jon Rista24-Feb-09 12:35 
QuestionC# alias Pin
Bill Stumps24-Feb-09 10:05
Bill Stumps24-Feb-09 10: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 10:10
mvePete O'Hanlon24-Feb-09 10:10 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 10:31
mvePIEBALDconsult24-Feb-09 10:31 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 10:49
mvePete O'Hanlon24-Feb-09 10:49 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 10:56
mvePIEBALDconsult24-Feb-09 10:56 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 11:07
mvePete O'Hanlon24-Feb-09 11:07 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 12:55
mvePIEBALDconsult24-Feb-09 12:55 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 16:00
professional_Maxxx_24-Feb-09 16:00 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 16:42
mvePIEBALDconsult24-Feb-09 16:42 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 21:23
professional_Maxxx_24-Feb-09 21:23 
GeneralRe: C# alias Pin
Pete O'Hanlon24-Feb-09 21:46
mvePete O'Hanlon24-Feb-09 21:46 
GeneralRe: C# alias Pin
_Maxxx_24-Feb-09 22:54
professional_Maxxx_24-Feb-09 22:54 
GeneralRe: C# alias Pin
Jon Rista24-Feb-09 12:41
Jon Rista24-Feb-09 12:41 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 12:53
mvePIEBALDconsult24-Feb-09 12:53 
GeneralRe: C# alias Pin
Jon Rista24-Feb-09 17:06
Jon Rista24-Feb-09 17:06 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 17:13
mvePIEBALDconsult24-Feb-09 17:13 
GeneralRe: C# alias Pin
PIEBALDconsult24-Feb-09 18:35
mvePIEBALDconsult24-Feb-09 18:35 
GeneralRe: C# alias Pin
Bill Stumps25-Feb-09 20:42
Bill Stumps25-Feb-09 20: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.