OWASP O2 Platform Blog

Creating a custom version of ‘O2 Quick Development Gui’ environment (stand-alone and in aspx)

Here is the script needed to create a customized version of the ‘O2 Quick Development Gui’ environment (in this case with a extra parameter provided and the initial code set)

var compiledScript = "ascx_Quick_Development_GUI.cs.o2".local().compile();
compiledScript.type("ascx_Panel_With_Inspector")
              .invokeStatic("runControl_withParameter", "aGuid",new Guid())
              .field("inspector")
              .prop("Code", "return aGuid.str();");

Here is how to achive the same result from an Aspx page:

<%@ Page Title="" Language="C#" MasterPageFile="/_O2_AspNet/empty.master"  %>
<% @Import Namespace="O2.Kernel" %>
<% @Import Namespace="O2.Kernel.ExtensionMethods" %>
<% @Import Namespace="O2.DotNetWrappers.ExtensionMethods" %>
<% @Import Namespace="O2.Views.ASCX.Ascx.MainGUI" %>
<% @Import Namespace="O2.Views.ASCX.classes.MainGUI" %>
<% @Import Namespace="O2.External.SharpDevelop.ExtensionMethods" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="head" runat="server"/>

<asp:Content ID="BodyContent" ContentPlaceHolderID="body" runat="server">

This page will open a new window with an O2 'Quick Development Gui' script containing a reference to the current HttpContext

<%
//show.info(System.Web.HttpContext.Current);
var compiledScript = "ascx_Quick_Development_GUI.cs.o2".local().compile();
compiledScript.type("ascx_Panel_With_Inspector").invokeStatic("runControl_withParameter", "a","b");
compiledScript.type("ascx_Panel_With_Inspector")
              .invokeStatic( "runControl_withParameter",
                            "context",
                            System.Web.HttpContext.Current)
               .field("inspector")
               .prop("Code", "return context;");
%>

</asp:Content>

June 30, 2011 - Posted by | .NET

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: