Click here to Skip to main content
16,006,348 members
Home / Discussions / C#
   

C#

 
GeneralRe: Magnificent Pin
George_George1-May-08 21:35
George_George1-May-08 21:35 
GeneralRe: Finalization and Performance Pin
George_George1-May-08 21:18
George_George1-May-08 21:18 
QuestionC# compiler expand our code? Pin
George_George1-May-08 3:05
George_George1-May-08 3:05 
AnswerRe: C# compiler expand our code? Pin
Christian Graus1-May-08 3:16
protectorChristian Graus1-May-08 3:16 
GeneralRe: C# compiler expand our code? Pin
George_George1-May-08 3:45
George_George1-May-08 3:45 
GeneralRe: C# compiler expand our code? Pin
Christian Graus1-May-08 3:55
protectorChristian Graus1-May-08 3:55 
GeneralRe: C# compiler expand our code? Pin
George_George1-May-08 4:08
George_George1-May-08 4:08 
GeneralRe: C# compiler expand our code? Pin
Simon P Stevens1-May-08 4:49
Simon P Stevens1-May-08 4:49 
I would assume you don't see the full expansion because reflector is clever enough to recognise the IL pattern and display the c# that would have formed this. If you switch reflector to IL mode, you will see the raw IL that the C# compiles to. IIRC the C# compiler generates fields and things in IL with < and > signs in their names, which aren't allowed in c#, so there is no risk of a clash.

For example, try using the automatic properties feature of c# 3.0. If you look at it in reflector, you'll see in the IL it's generated a field called something like <myproperty>k_BackingField. Using the '<' signs mean that there's not a risk of the auto generated backing field clashing with any of your fields. But if you switch reflect to C# mode, it'll give you the original automatic property definition. This is reflector recognising the pattern and reversing it back to the original c',

The way to do it is write the C# for a foreach, and also the c# for a for loop, and then compare the IL generated by each.

Simon

GeneralRe: C# compiler expand our code? Pin
George_George1-May-08 20:34
George_George1-May-08 20:34 
GeneralRe: C# compiler expand our code? Pin
Simon P Stevens2-May-08 9:37
Simon P Stevens2-May-08 9:37 
GeneralRe: C# compiler expand our code? Pin
George_George2-May-08 21:26
George_George2-May-08 21:26 
QuestionHelp on Writing Image Information(Location/Descriptions) to a txtfile Pin
Thomas Toh1-May-08 2:12
Thomas Toh1-May-08 2:12 
AnswerRe: Help on Writing Image Information(Location/Descriptions) to a txtfile Pin
Christian Graus1-May-08 3:18
protectorChristian Graus1-May-08 3:18 
GeneralRe: Help on Writing Image Information(Location/Descriptions) to a txtfile [modified] Pin
Thomas Toh1-May-08 3:42
Thomas Toh1-May-08 3:42 
GeneralRe: Help on Writing Image Information(Location/Descriptions) to a txtfile Pin
Christian Graus1-May-08 3:45
protectorChristian Graus1-May-08 3:45 
AnswerRe: Help on Writing Image Information(Location/Descriptions) to a txtfile Pin
Thomas Toh1-May-08 4:25
Thomas Toh1-May-08 4:25 
QuestionReturn Value Pin
MumbleB1-May-08 1:16
MumbleB1-May-08 1:16 
AnswerRe: Return Value Pin
Anthony Mushrow1-May-08 1:24
professionalAnthony Mushrow1-May-08 1:24 
GeneralRe: Return Value Pin
MumbleB1-May-08 1:41
MumbleB1-May-08 1:41 
GeneralRe: Return Value Pin
Anthony Mushrow1-May-08 1:48
professionalAnthony Mushrow1-May-08 1:48 
GeneralRe: Return Value Pin
Spacix One1-May-08 9:00
Spacix One1-May-08 9:00 
RantRe: Return Value Pin
Spacix One1-May-08 9:39
Spacix One1-May-08 9:39 
Questionconvert date formats [modified] Pin
stephan_0071-May-08 0:14
stephan_0071-May-08 0:14 
AnswerRe: convert date formats Pin
stephan_0071-May-08 0:28
stephan_0071-May-08 0:28 
AnswerRe: convert date formats Pin
PIEBALDconsult1-May-08 9:34
mvePIEBALDconsult1-May-08 9:34 

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.