1. Arcady Abramov
  2. Beta Testing
  3. Wednesday, 22 January 2020 06:10 AM UTC

Hello, Team

What is the best way to migrate scripts with File** functions (FileOpen, FileRead, FileWrite, etc)?

It does not appear that these functions are recognized by SnapDevelop packages, or am I missing a package?

Accepted Answer
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 07:28 AM UTC
  2. Beta Testing
  3. # Permalink

You just use plain C# to do that.  Appeon doesn't provide special functions for that.  https://docs.microsoft.com/en-us/dotnet/api/system.io.file?view=netcore-2.2

Comment
  1. Michael Kramer
  2. Wednesday, 22 January 2020 13:24 PM UTC
You should keep MessageBox out of your nonvisual assemblies - to make them nonvisual. MessageBox in an assembly running in a web API on a server would have nowhere to display and no user to hit [OK] button.

That said, MessageBox is a class in System.Window.Forms.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 22 January 2020 14:48 PM UTC
The C# code converter we provide is to migrate your business logic only into an MVC architecture. It is not going to take care of the UI for you or automatically extract the business logic from your app (if you haven't already encapsulated the logic in NVOs).

And Michael is exactly right that in a REST Web API you should not be doing UI things like Message Box... it is running on the server and is non-visual. In fact, I question if you should be even doing file functions.

If you plan to have the C# on the client side (i.e. not re-architect your app into Web APIs running on the server side), then you will be faced with rewriting your UI by hand. As I mentioned, the solution will only automate migration of business logic.
  1. Helpful
  1. Arcady Abramov
  2. Friday, 24 January 2020 08:05 AM UTC
Actually, many of my non-visual assemblies are part of COMs (now) and consumed by the PB desktop apps. So, they do display message boxes, but have no visual screens.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.