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>
No comments yet.

