Welcome, Guest
Username: Password: Remember me
Hier wird Deutsch gesprochen
  • Page:
  • 1

TOPIC:

ILSpy xsproj 18 Mar 2022 11:02 #21973

  • lagraf
  • lagraf's Avatar
  • Topic Author


  • Posts: 310
  • Im ILSpy kann ich den Sourcecode einer DLL mit "Save Code" speichern, bekomme dann ein *.xsproj File, AppOrdner und Properties Ordner. Kann ich dieses *,xsproj File in X# importieren? Projekte sind in X# mit der Endung *.xiproj, Apps *.viapp.
    Wie bekomme ich das File hinein und als was?

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 18 Mar 2022 15:39 #21978

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3191
  • Hallo Franz,
    ich habe das jetzt bei mir ausprobiert.
    Zumindestens bei mir wurde nur die XSProj-Datei erstellt, aber kein X# Sourcecode.
    Hast Du in den Unterverzeichnissen .prg-Dateien?
    Ob man diese XSProj-Dateien auch in XIDE öffnen kann, da muss Dir der Chris helfen.
    Wolfgang
    P.S. bitte beachten: in X# kannst Du gar nichts importieren, da das Produkt X# keine grafische Oberfläche mitbringt mit Ausnahme des XPorters. Was Du wahrscheinlich meinst, ist XIDE - eine IDE, die mit X# ausgeliefert wird, mit der aber nur eine Minderheit der X#-Benutzer arbeitet, weil die meisten Visual Studio vorziehen.
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 18 Mar 2022 16:45 #21979

    • Chris
    • Chris's Avatar


  • Posts: 3653
  • Hi Franz,

    I think as Wolfgagng said, that you want to use the code in XIDE. Unfortunately the plugin creates a project for VS only, but moving it also to
    XIDE is easy enough. Just create an empty new app in a project in XIDE and then simply add the .prg files that the plugin generated.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 19 Mar 2022 21:25 #21996

    • Chris
    • Chris's Avatar


  • Posts: 3653
  • Hi Wolfgang,

    wriedmann wrote: Was Du wahrscheinlich meinst, ist XIDE - eine IDE, die mit X# ausgeliefert wird, mit der aber nur eine Minderheit der X#-Benutzer arbeitet, weil die meisten Visual Studio vorziehen.


    Actually apparently X# programmers using XIDE are not that much of a minority. I'm surprised also myself, but most of the reports/support requests I'm getting privately, consists usually of XIDE projects! I now have a large collection of (fairly large) XIDE projects with a lot of code X# which are extremely helpful in testing the new compiler versions that Roberts creates and make as sure as possible than no (much at least!) existing code is broken.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 20 Mar 2022 07:15 #21999

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3191
  • Hi Chris,
    yes, I have seen all of your team using XIDE: Robert, Fabrice and Nikos..... so I know you are using it internally.
    For people coming from VO XIDE is the natural choice, and I feel much more productive with it that with Visual Studio (of course, that is a personal choice), even with its missing support for XAML.
    Many people may speak about "X#" and really mean "XIDE"..... because they see XIDE as an integral part of the X# package.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 21 Mar 2022 08:22 #22004

    • lagraf
    • lagraf's Avatar
    • Topic Author


  • Posts: 310
  • Hi Wolfgang and Chris,
    yes you're right: I meant XIDE instead of X#, because for a VO User XIDE is much better to understand than VS and I see XIDE and X# as one product like VO and it's compiler.

    Meanwhile I also imported the ILSpy C# *.prg files in an empty C# lib and after adding some references and changed the syntax of a get statement it compiled without errors. Is it possible to compile every C# project with XIDE or does XIDE only include rudimentary support for C#? The next step should be to create a com module now to use it with VO.

    I also got an AssemblyInfo.cs file from ILSpy. What do I have to do with it, do I need it?

    I also tested to export the C# code of ILSpy as X# code, but there are many errors compiling it so I think that this way of translating C# to X# is not really suitable.

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 21 Mar 2022 09:25 #22007

    • Chris
    • Chris's Avatar


  • Posts: 3653
  • Hi Franz,

    In .Net, compilers and IDEs are completely separated, so code that is possible to write it in c#, you can write and/or compile it also using XIDE, you just need to point Tools/Preferences/Compiler/c# to the appropriate c# compiler version you want to use.

    What is very limited regarding c# in XIDE is intellisense features and integration with tools, for example you cannot design windows in the form designer and have it generate c# code. It's not actually difficult to implement it, it's just not the scope of XIDE.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 21 Mar 2022 10:10 #22010

    • lagraf
    • lagraf's Avatar
    • Topic Author


  • Posts: 310
  • Ok, copy that Chris!

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 06 Apr 2022 10:46 #22097

    • lagraf
    • lagraf's Avatar
    • Topic Author


  • Posts: 310
  • Eine Frage zum ILSpy X# Plugin:
    Ich habe mir einen simplen C# Code übersetzen lassen und finde darin einige Codeteile, die der X# Compiler bemängelt. Ist das Plugin noch in den Kinderschuhen oder erstellt es nur eine rudimentäre Übersetzung, die danach noch eine manuelle Nachbearbeitung erfordert? Ich habe mal die komplette Übersetzung gepostet:
    public class Frames01 inherit Form
    	public constructor()
    		local panel as Panel
    		local qrEncoder as QrEncoder
    		local qrCode as QrCode
    		local renderer as GraphicsRenderer
    		local padding as Point
    		local dSize as DrawingSize
    		local textBox1 as TextBox
    		local label1 as Label
    		//
    		Text := "e""C# - einfaches Form"
    		super:Size := Size{900, 600} 
    		panel := Panel{}
    		super:Controls:Add(panel)
    		qrEncoder := QrEncoder{ErrorCorrectionLevel.H}
    		qrCode := qrEncoder:Encode("e""Hello World!")
    		renderer := GraphicsRenderer{FixedModuleSize{5, QuietZoneModules.Two}, (Brush)(Object)Brushes.Black, (Brush)(Object)Brushes.White}
    		padding := Point{10, 16}
    		dSize := renderer:SizeCalculator:GetSize(qrCode:Matrix:Width)
    		panel:AutoSize := false
    		panel:Size := Size{dSize:CodeWidth, dSize:CodeWidth} + Size{2 * padding:X, 2 * padding:Y}
    		begin using graphics := panel:CreateGraphics()
    			renderer:Draw((Graphics)(Object)graphics, qrCode:Matrix, (Point)padding)
    		end using
    		textBox1 := TextBox{}
    		label1 := Label{};
    			{Location := Point{16, 16},;
    			Text := "e""label1",;
    			Size := Size{104, 16};
    			}
    		textBox1:Location := Point{16, 32}
    		textBox1:Text := "e""TextBox"
    		textBox1:Size := Size{152, 20}
    		panel:Controls:Add(label1)
    		panel:Controls:Add(textBox1)
    
    
    end class
    Text := "e""C# - einfaches Form" -> Text gibt es nicht, sollte wohl self:text sein?
    super:Size := Size{900, 600} -> super sollte wohl self sein?
    renderer:Draw((Graphics)(Object)graphics, qrCode:Matrix, (Point)padding) -> soll (Graphics)(Object) ein Platzhalter sein, als realen Code erscheint mir das nicht?

    Ich hab den Code schon ausgebessert, also bitte keine Zeit dafür verschwenden! Es würde mich nur interessieren, welchen Zweck die vom X# Plugin Übersetzung erfüllen soll, denn ein 1:1 compilieren mit X# geht wohl nicht und das, obwohl es hier ein simples Beispiel ist. Wie wird die Übersetzung dann erst bei komplexen C# Apps aussehen?

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 06 Apr 2022 13:30 #22101

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3191
  • Hallo Franz,
    dieses Plugin ist die Arbeit vom Fabrice und sollte das Lesen von C#-Code erleichtern.
    Ich denke nicht, dass es angedacht ist, den erzeugten Code 1:1 kompilieren zu lassen.
    Mit C#-Code ist das weitgehend möglich - ich denke aber auch nicht zu 100%. So wird wahrscheinlich LinQ-Code nicht als solcher angezeigt, und auch andere Konstrukte nicht, die der Compiler verarbeitet.
    Ich habe keine Ahnung, wie viel Zeit Fabrice hier reinstecken kann und möchte.
    Das mit dem String sollte man vielleicht korrigieren - das macht den Code sehr viel schwerer lesbar.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 06 Apr 2022 16:10 #22103

    • Fabrice
    • Fabrice's Avatar


  • Posts: 299
  • Hi Franz,
    first, I'm happy that you are the X# Plugin for ILSpy.
    This is still a work-in-progress, in the sense that it has some issues; but I'm pleased to correct them as soon as I'm aware of them.
    Don't forget that we are only view the compiler-generated code, and (like with Linq) What you code is NOT always what is generated.

    That said, the "e" should not be within quotes: It specify that the text could contains some escaped chars to keep as-is.
    The Super call is here, because that's whats the Compiler is generating: The Size property is coming from the SuperClass.
    Finally, the (Graphics)(Object) seems to be Cast on a Cast...Why does the Compiler generates these....Mmm... Good Question! :)
    But, this the way ILSpy is analyzing the code that produced it; and I'm just Plugged In ILSpy

    That said, I can/will correct the first one, as I am generating this "escape" indication (and wrongly!)
    For the two, others...Sorry.... but ILSpy is continuously improving; and the current version is 7.xx where I only provide a 6.xx version; maybe it's time for me to move to the newest version.

    HTH,
    Fab

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 07 Apr 2022 07:56 #22104

    • lagraf
    • lagraf's Avatar
    • Topic Author


  • Posts: 310
  • Hi Fabrice,
    thank you for answering my question. I can understand that decompiling is a hard work, I already have some experience with Valkyrie the Clipper decompiler. The first reason why I use the X# Plugin is, because I use a meanwhile unsupported C# DLL with my VO apps that I try to replace somewhere in the future with X#. The second is that I try learning X# by translating C# code from internet sources.

    If you improve the plugin for use with newest IlSpy and correct some outstanding mistakes it would be a great help for me and other X# beginners, so thank you for this work!

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 19 Apr 2022 11:56 #22210

    • lagraf
    • lagraf's Avatar
    • Topic Author


  • Posts: 310
  • Hi Fabrice,
    as I actually try to translate some C# routines to X# using ILSpy X# plugin I found more an more translation errors. Do you need some of the outstanding errors to improve the plugin?

    Please Log in or Create an account to join the conversation.

    ILSpy xsproj 19 Apr 2022 12:19 #22215

    • Fabrice
    • Fabrice's Avatar


  • Posts: 299
  • Hi Franz,

    yes please, if you can send me some wrongly generated pieces of code, I will try to improve my plugin.

    But in order to keep things at the right place, I've just created a new topic for that :
    www.xsharp.eu/forum/public-3rdpart/2977-...ections-enhancements

    Regards,
    Fab

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    Moderators: wriedmann