What is the purpose of the [DebuggerHidden] section of certain classes?

Started by Project 06, October 16, 2016, 06:47:50 PM

Previous topic - Next topic

Project 06

I've dont really know what these parts of class files do. They seem to be locked in ILSpy so i cant directly look at them, but they are referenced in class files. I'm just curious what they do and if they are really important. Ill show an example because why not.

[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
Building_Door.<GetGizmos>c__Iterator115 <GetGizmos>c__Iterator = new Building_Door.<GetGizmos>c__Iterator115();
<GetGizmos>c__Iterator.<>f__this = this;
Building_Door.<GetGizmos>c__Iterator115 expr_0E = <GetGizmos>c__Iterator;
expr_0E.$PC = -2;
return expr_0E;
}

RawCode

it's about syntax sugar and "compiler generated code" (all code is compiler generated, it's about methods not present in "source" and created by compiler to solve infrastructure limitations)

you should refer to ILSPY documentation for more info.

Project 06


RawCode


Jamestec

Use Zhentar's version of ILSpy: https://github.com/Zhentar/ILSpy/releases/
It's easier to read.

I use GetGizmos() in JTCopyBills, it's for the buttons that appear when you select the building, like Build Copy.