Tuesday 8 May 2012

Video on Creating stand-alone WinForms and H2 script

Michael asked me today how to create stand-alone WinForms via O2 scripts and what is an H2 file?

So, here is a video that provides the answers:

Basically to create an WinForms in an O2 Script all that is needed is to call the System.String 'popupWindow' extension method. For example:

The string is the form title, and the (optional parameters) are the Width and Height.

An H2 file is just an XML file with the serialization of an script (like the one above) which is registered to O2 so that when you double click on it, windows will invoke the O2 Platform with that file as a parameter.

When you do that, O2 will detect that there is an parameter and only execute that script, instead of loading up the main GUI (this is also how you can easily invoke O2 scripts from the command line)