C# IDE Mobile Online Manual

 

Introduction

C# IDE Mobile, as its name implies, is a C# Integrated Development Environment which executes on Windows Mobile 5 or 6 with .NET Compact Framework 2. It allows you to write programs using the C# language and the .NET 2.0 Compact Framework (.NET2CF). The program is parsed and executed at runtime (there is no compilation or link required).

 

Important note: No .NET SDK IS REQUIRED: At the difference of other tools which do "C# Scripting" by wrapping CSC.EXE, C# IDE Mobile doesn't require you to have the .NET SDK (which includes the compilers). It only requires having the .NET 2.0 (Compact or not) Framework Redistributable (i.e. the runtime .NET). It isn't a wrapper around the Microsoft CSC.EXE compiler.

 

The goal is mainly to develop code while away from your desktop and be able to test it. Then if you want you can compile it on your desktop to obtain a native WM/PPC executable (mainly this allows faster execution).

 

Here are just some examples of what is possible on your Pocket PC thanks to this:

 

 Creating applications with graphical user interfaces

 Creating classes and methods (to better organise your program into components)

 Using all of the.NET Compact Framework classes

 Doing file manipulation (.NET as many nice static functions for this)

 Running processes

 Using .NET2 generics (to create lists, tables, arrays, …)

 Using C# control structures (loops, conditional, …)

 …

 

See the known limitations below in order to see what is known not to be possible.

 

Just to illustrate (more advanced examples are provided in the download section), here is a very simple example of code you can write:

 

namespace TestNS

{

class Test

{

  void Main()

  {

    System.Windows.Forms.Form f=new System.Windows.Forms.Form();

    f.ShowDialog();

  }

}

}

Manual

Getting started

First install C# IDE Mobile as explained in the "installation" section.

 

 Execute a2i2m.exe and C# IDE Mobile's main window shows up. This window contains a text editor which is where you are supposed to type your C# code.

 Copy/Paste the little sample above into this window.

 Go into "Menu/Debug/Run". The application will run and the Form you created will appear. If you know C# you can try adding controls, event handlers, loops, …

 You can save and load your work with the "Menu/File/Save" and "Menu/File/Load" functions.

 "Menu/View/" has an entry "Source code" to view your code (this is the standard display), an entry "Tokens" to view the result of the tokenisation (this isn't really useful), an entry to view the "Output" (this isn't really useful) and an entry "Toolbar" to hide/show the toolbar

 "Menu/Help/MS.NET2CF Index" is detailed below.

 "Menu/Help/About" displays an about box with the version number.

 "Menu/Help/C# IDE Mobile Manual" displays this manual in internet explorer (iexplore.exe must be in the path for this to work).

The MS.NET2CF Index window

By clicking on "Menu/Help/MS.NET2CF Index" a new window appears. This is the MS.NET2CF Index and allows viewing the .NET assemblies and the types they contain, with their methods, constructors and properties.

 

This is useful when developing without any documentation as it is in fact a lightweight documentation of the .NET2CF. You can see all the available classes, with their methods and parameters, ... As the naming is quite explicit you can often go quite a long way with this (if you know the platform a little).

 

The type filter field allows you to filter the types found in an assembly (because other wise it is often difficult to find the class you're looking for because there are so many).

 

For example, if in the type filter you enter "Forms.Form" and then you select the "System.Windows.Forms" assembly, you can easily find  "System.Windows.Forms.Form" to look at all the methods and properties and use them.

C# Language and MS.NET2CF platform

Despite the shortcomings exposed in the "known limitations" sections, the idea is to use C# IDE Mobile like any other C# compiler in the .NET2CF, so you can refer to these documentations for other details. I don't plan to integrate a C# or .NET tutorial here. You can look at the example code and extend on it with your own C#/.NET2CF experience.

 

I'm still improving C# IDE Mobile and I hope to finish with something as close as possible to standard C#/.NET2CF.

Adding User Plugins into C# IDE Mobile

In the installation directory is a folder named "UserPlugins". Any C# IDE Mobile program put into that folder will appear in the "Menu/Tools/User plugins" menu and will be launched when the corresponding menu item is clicked.

 

Copy/Paste can be used to copy results from the plugin into the C# IDE Mobile source editor.

Known limitations

Currently, the main limitations are (there are maybe other elements I haven't thought of in this list):

 

 There are some limitations on inheritance (this is been worked on)

 Operators priorities aren't supported (you must use parenthesis for this, which isn't that bad in fact)

 All methods and fields are "public" (the "private" and "protected" keywords are ignored)

 Execution can sometimes be slower than expected, this is due to the "interpreter" nature of C# IDE Mobile. Also, for the same reasons, errors (even syntax errors) are only spotted when the execution reaches them

Downloads

Click the following links to download the C# scripter and some script examples which you can test and use to start your own.

 

 Click here to go the download page for C# IDE Mobile

 Click here to go to Harvey ROWSON's main page

Installation

The installation procedure only requires copying the files to your Pocket PC.

 

To install, do as follows:

 

 Download the zip

 Copy it to your PPC (Pocket PC) to wherever you want to install it

 Unzip the zip (you could also have unzipped on the PC and copied the unzipped folder, it would work as well)

 Go down the folder(s) and click on a2i2m.exe to execute C# IDE Mobile

 

To uninstall: C# IDE Mobile will not create any registry entries or create any files (neither in "windows" neither anywhere else). To uninstall, simply delete the folder where you unzipped.

 

For information, and thanks to Microsoft's .NET device independent strategy, the software also runs on a desktop PC and in fact probably on anything which has a .NET 2.0 Compact Framework compatible environment installed.

Prerequisite

First, in order to use this software you must ensure that your Windows Mobile 5 or 6 has the Microsoft .NET Compact Framework 2.0 Redistributable installed.

 

You can get this from Microsoft's web page:

 

http://www.microsoft.com/downloads/details.aspx?FamilyID=9655156b-356b-4a2c-857c-e62f50ae9a55&DisplayLang=en

 

Or you can do a search with your favourite search engine with "download .net 2.0 compact framework".

 

Important note: You do not need the .NET SDK, the runtime (redistributable) is all you need.

Release notes

Version 1.0

 Initial version of the application

 Multiple functions allowed ("Main" as entry point and your other functions)

 Loops "while" are supported

 Control structures "if" are supported (but not else)

 Types "int", "float" and "string" are handled by the operators (Arithmetic, Relational and Logical)

 Operators "+" and "<" and "new" are supported

 Index "[]" operator supported for generics

 Calls to the .NET2CF are supported (methods, properties, object instantiation, static, …)

 C# Inspector module: Online .NET2CF help on types (via reflection)

 Can't create new types (classes in particular)

 … others …

Version 2.0

 Dynamic and static support for variable screen sizes

 Comments are now supported (both "//" and "/* */" style)

 Improved support of operators (Arithmetic, Relational and Logical all supported)

 … others …

Version 3.0

 Support of "for" loops (example: "for(int i=0;i<10;i=i+1){}")

 Corrected bug with "==" operator

 Improved error reporting (location and suppressed recursive messages)

 Handling of Decrement ("—") and Increment ("++") operators (both post and pre, ie "i++" and "++i")

 Added support for new assignment operators ("+=", "-=", "*=", "/=", "&=", "|=", "^=")

 "else" is now possible

 "if", "else", "for" and "while" now admit either a block ("{ … }") either an expression ("…;")

 Added support for "null" in Relational operators and Assignement

 Improved C# Inspector to list more details

 Added highlight of error location in editor

 Handling of array types (like "int[] tab=new int[10]") and associated indexers

 Outer namespace and class are now named (instead of the unnamed and unseen previous versions)

 … others …

Version 4.0

 Renamed the software from "C# Scripter" to "C# IDE Mobile" to better reflect its nature

 Handling of "try/catch" error control with "throw" exception rising

 Added management of "using" directive

 Function exit with "return" is now possible

 Implementation of loop control flow keywords "break" and "continue"

 Reorganised the menus to be closer to developers' habits

Version 5.0

 Miscellaneous minor bug fixes and performance improvements

Version 6.0

 Added support for undo/cut/copy/paste in the editor windows

 Types and functions can now be copied from the "MS.NET2CF Index" window to the editor

 The "MS.NET2CF Index" window is now persistent between calls (avoids reselecting the Type each time)

 On errors it is now possible to choose to select the error or not (leave the cursor where it was, avoids getting lost) 

Version 7.0

 Added "light" support for user plugins (allowing users to create plugins to facilitate/automate development in conjunction of copy/paste)

 Resolved major (but rare) issue with scope management

 Floats are now parsed culture independent

 Reworked undo/cut/copy/paste to use WM clipboard (Paste no longer moves the scroll/caret and copy/paste works with other apps)

 Fixed negative number declarations (like "int i=-1;", "if(i<-5)", …)

 Fixed support for escape characters ('\n', '\r', '\r\r', '\t')

 Fixed support for char types and array initialisation

Version 8.0

 The main limitation of previous versions is now history: It is now possible to create new classes and instantiate them (these can inherit from .NET types, for example Forms created from VS designer now execute with no changes)

 Added "Insert code" menu to easily insert recurring blocks of code (functions, classes, loops, …)

 Small bug fix on escape character support

 Improved expression end detection (this caused some problems in "complicated" expressions, which could need cutting down in some cases)

 Improved error location indication (in some cases the outer function was indicated instead of the line in the function)

 

Version 9.0

 Fixed issue with declaring size of initialised array (like in "new int[2]{4,6};")

 It is no longer necessary to fully qualify locally declared class names (before you needed to write like "TestNS.MyClass" even if you were already in "TestNS")

 Fixed bug with logical operators on enum types (for example on button.Anchor = AnchorStyles.Bottom | AnchorStyles.Right);

 Manual casting is now supported. Usually, C# IDE Mobile auto casts when possible, but for example, in "int test = (int)AnchorStyles.Bottom" manual cast is necessary. Also, this avoids removing casts required in VS.

 Fixed bug with multiple "if"/"else if"/"else" structures

 "static" keyword now works for arrays and generics, also fixed a problem with indexed assignments

 Added support for nested classes (like System.Windows.Forms.ListView+SelectedIndexCollection)

 Added support for double type

 Improved comment and string parsing (to avoid "//" making a mess in strings)