Project Description

F# Interactive Pad and Program Editor inside Reflector.
     

Interactive Pad

1. The following screen shot shows testing code snippet inside interactive pad and configuring options. Seirpinski Triangle code inside the pic is written by Brian in here.

 

InteractiveDemo

 

2. Adding assembly reference (#r fsi command) and opening namespace can be done via context menu of Assembly List Panel of Reflector. See the following screen shot.

InteractiveAsmNs

3. There are some shell level custom commands. For example, you can change background color by typing the following command inside interactive pad.

#bgc “black” ;;

    The following describes custom commands and their definitions.

#bgc “color name|hex string” – changes background color

#fgc “color name|hex string” – changes foreground color

#fz “float|integer number” – changes font size

#hl “on|off” – turns on or off syntax highlightening

#cls  – cleans the screen

#q or #reset - restarts fsi session

Program Editor

In Program Editor, we can write, build and run F# program. The following brief tutorial will discuss using Program Editor.

1. Write the following simple WPF program inside Program Editor.

		
	open System
	open System.Windows

	[<STAthread>]
	do 
	  let window = new Window(Title = "Hello")
   	  window.ShowDialog() |> ignore

2. To run the program you can press F5 or click on Run run button. You will get the error in the output window ‘cause the necessary assembly references  are not fed to F# compiler. See the following screen shot.

programeditorwitherror

3. Adding Assembly References can be done in two ways – one is via Context Menu and the other is via Assembly Reference dialog. See the following screen shot.

programeditorAddRef

4. After adding  assembly references (PresentationCore.dll and PresentationFramework.dll in our case), they will be shown inside Assembly Reference dialog as follow. Now you can run the program successfully.

AsmRefDialog

     5. If you chose to build the program by pressing (Ctrl+Shift+B) or clicking on Build Buildbutton, the program will be compiled and the output assembly will be loaded into Reflector.

 loadtoReflector

Refs:

Powered by VisualSVN!

Last edited Jan 16, 2011 at 5:13 AM by NyiNyiThann, version 17