xsharp.eu • ILspy suggestion: base instead SUPER in decompiled code
Page 1 of 2

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 16, 2020 8:58 am
by George
Using ILSpy 5.02 with ILSpy.XSharpLanguage.Plugin to decompile one small App, I saw the 'base' instead of 'SUPER' in decompiled code.

In constructor you can see: base(view)
In method Calculate corrrectly exists: SUPER:Calculate(hitTestResult, physicalPoint)

using DevExpress.Portable.Input
using DevExpress.XtraRichEdit
using DevExpress.XtraRichEdit.Layout
using DevExpress.XtraRichEdit.Mouse
using DevExpress.XtraRichEdit.Utils
using System.Drawing

public class MyMouseCursorCalculator inherit MouseCursorCalculator
public constructor(view as RichEditView );
base(view)


public override method Calculate(hitTestResult as RichEditHitTestResultCore , physicalPoint as Point ) as IPortableCursor
if ((super:View:Control astype MyRichEditControl):FormatCalculatorEnabled)
return RichEditCursors.Hand
endif
return super:Calculate(hitTestResult, physicalPoint)


end class


Another small suggestion is to convert the X# reserved keywords in UpperCase.

regards
George

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 16, 2020 10:10 pm
by Fabrice
Hi George,
in fact this is more than a suggestion, but I think this is an issue (bug?)

About UpperCase, I will see if I can add a setting to allow user to choose between Upper/Lower/Title case

Fab

ILspy suggestion: base instead SUPER in decompiled code

Posted: Thu Dec 17, 2020 12:55 am
by George
Fabrice,

this is great !

George

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 23, 2020 8:37 am
by George
Hi Fabrice,

please check the attached sample in ILSpy with X# plug-in.

It contains, among other features, implicit operator etc. and it produces errors in translated X# code.
I think it's a good sample for the plug-in.

Please check also the right-click / Save Code as it generates a .xsproj with C# code inside as well as only .cs source output.

regards
George

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 23, 2020 8:41 am
by Fabrice
Hi George,
Thanks for your sample.
I had corrected the previous ones and was ready to publish, but it seems I have more Homework :)

Btw, about Casing, it is already existing : Go to view/options and check the box.

Regards
Fab

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 23, 2020 8:51 am
by George
I See. Thank you.

George

ILspy suggestion: base instead SUPER in decompiled code

Posted: Wed Dec 23, 2020 9:42 pm
by Fabrice
George,
after your latest sample, it seems that I have some corrections to add, but at least you can find a new version of the plugin at the GitHub page : https://github.com/X-Sharp/ILSpy-Plugin
On the right, click on Releases, you should find the 23/12/2020 version.

Cheers,
Fab
PS : BTW, I'm also working on the ILSpy 6 version

ILspy suggestion: base instead SUPER in decompiled code

Posted: Thu Dec 24, 2020 8:12 am
by George
Thank you Fabrice !

ILspy suggestion: base instead SUPER in decompiled code

Posted: Thu Dec 24, 2020 10:39 am
by George
Fabrice,

I downloaded the code from github.com/X-Sharp/ILSpy-Plugin.
There was missing references, so using NuGet Manager I got:
- Mono.Cecil.0.10.1.0
- ICSharpCode.AvalonEdit.5.0.3.0 (manually as it doesn't exist in NuGet Browser)

and I updated all other outdated pachages like System.ComponentModel.Composition.

At the end, the only missing reference is: ILSpy
I cannot find ILSpy.4.0.1.4530
as shown in the attached file:
MissingReference.PNG
MissingReference.PNG (146.21 KiB) Viewed 1878 times
regards
George

ILspy suggestion: base instead SUPER in decompiled code

Posted: Thu Dec 24, 2020 12:01 pm
by Fabrice
George,
I respectfully think you are making it the hard way.
At the github page, click on the Releases link on the right; then from the 3 assets, get ILSpy502.XSharpLanguage.20201223.zip, this is the compiled DLL. Then get the ILSpy 5.02, and put in the DLL in the same folder as the ILSpy.exe.

If you want to get the source and rebuild, please take care of the Branch you are viewing/downloading :
Master or ILSpy 4 are the same, and are focusing ILSpy 4: This branch has not been updated since I've moved to ILSpy5
ILSpy5: the latest I've updated
ILSpy6: Not ready now, still a work-in-progress.

HTH,
Fabrice