Stack Exchange
Decompiling .Net code: lambda expressions
Disassembling a class library in Xamarin Assembly Browser I've got invalid syntax in the source
InventoryTab.<DrawResources>c__AnonStoreyF <DrawResources>c__AnonStoreyF = 
    new InventoryTab.<DrawResources>c__AnonStoreyF ();

What code corresponds to such output?
Edit 1
The whole relevant part of the lambda (thanks, D Stanley) disassembly is
InventoryTab.<DrawResources>c__AnonStoreyF <DrawResources>c__AnonStoreyF = 
    new InventoryTab.<DrawResources>c__AnonStoreyF ();

<DrawResources>c__AnonStoreyF.tooltipText = "some string";

if (current.availableCount > -1) {

    InventoryTab.<DrawResources>c__AnonStoreyF arg_432_0 = 
        <DrawResources>c__AnonStoreyF;

    string tooltipText = <DrawResources>c__AnonStoreyF.tooltipText;

    arg_432_0.tooltipText = string.Concat (new string[] {
        tooltipText,
        // and some more strings...
        "\n\n"
    });
}
TipSignal tipSignal = new TipSignal (() => 
    <DrawResources>c__AnonStoreyF.tooltipText, 
    <DrawResources>c__AnonStoreyF.tooltipText.GetHashCode ()
);
TooltipHandler.TipRegion (rect, tipSignal);

Now I am trying to figure out how the lambda should could look like.
Edit 2
TipSignal is defined as
public TipSignal (string text, int uniqueId);

Edit 3
Would the following code work as lambda replacement?
string tooltipText = "some string";
if (current.availableCount > -1) {
    tooltipText = string.Concat (new string[] {
        tooltipText,
        // and some more strings...
        "\n\n"
    });
}
TipSignal tipSignal = new TipSignal (tooltipText, tooltipText.GetHashCode ());
TooltipHandler.TipRegion (rect, tipSignal);


anonymous methods (lambdas), and auto-implemented properties.

There's no way that it "should" look, because you're decompiling, so any code that gives the same result is equally correct. It's not like its possible to know what the original looked like when you decompile, as any decompilation has to guess between several possible inputs, won't include removed dead code, and so on.
Just change the deliberately invalid names (used in the original compilation to guarantee not clashing with names the developer actually used) to something valid like DrawResourcesc__AnonStoreyF and unless the decompilation go something wrong (in which case it won't work anyway, though if anything it's more likely to get the parts it did a fuller job of wrong than here) then you'll have working code. Then tidy it when you tidy the rest, giving nicer names and/or turning it into an anonymous class if you wish.

So I can skip lambda here and just use some simple code? I don't see why lambda was used there so it feels like it is more complicated than I think...

Should the lambda in new TipSignal (...) contain the logic given before it?

The code with the lambda or anonymous type (I'm guessing the latter but perhaps both) was likely simpler to write. The decompilation failed to sweeten its results with the same syntactic sugar and gave you syntactic strychnine instead. Turning it into something compilable will give you working results, but not as readable as the original (remember, you're never going to get any better than an approximation of the original), though it can be a starting point to refactor to something nicer. Does edit 3 compile and work as expected?

Alright, just wanted to make sure I don't remove anything important. That part seems compiling, but I have few more errors to resolve before the whole thing can be compiled.
