This class is derived from System.Web.UI.Page, and exposes additional page events that help code-behind for an ASPX manage the flow of the simulation. Each ASPX page in an isee.NET Framework ASP.NET Application should inherit from this class
For a list of all members of this type, see PageController Members.
System.Object
System.Web.UI.Control
System.Web.UI.TemplateControl
System.Web.UI.Page
iseesystems.iseeNET.Controllers.ASPNET.PageController
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The class exposes events that are helpful in managing the flow of the simulation. The order of these events are:
C# Example
protected Knob initElkKnob;
...
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
//Wire the event handlers
this.InitSimulationObjects += new InitSimulationObjectsDelegate(Setup_InitSimulationObjects);
this.UpdateControls += new UpdateControlsDelegate(Setup_UpdateControls);
this.UpdateInputValues += new UpdateInputValuesDelegate(Setup_UpdateInputValues);
}
...
private void Setup_InitSimulationObjects()
{
this.initElkKnob = this.Simulation.GetKnob("initial_number_of_elk");
}
private void Setup_UpdateInputValues()
{
this.initElkKnob.CurrentValue = Convert.ToDouble(this.ddlInitalElk.SelectedValue);
}
private void Setup_UpdateControls()
{
//Let's bind the drop down list to the values of the input object.
//The input object in this case is a Knob, so let's get it:
ListItem listItem ;
//Let's populate the drop down list values for the list by looping from Min to Max and stepping by Increment
for(double i=this.initElkKnob.Min; i<=initElkKnob.Max; i+=initElkKnob.Increment)
{
listItem = new ListItem(i.ToString());
//Check if the value we are adding is the current value of the model entity
//and if it is, make it the selected item in the list
if(i == initElkKnob.CurrentValue)
{
listItem.Selected = true;
}
//Add the value to the list
this.ddlInitalElk.Items.Add(listItem);
}
//If we are past start time, then disable as this is an initial value
if(this.Simulation.CurrentTime > this.Simulation.TimeSpecs.StartTime)
{
this.ddlInitalElk.Enabled = false;
}
}
VB.NET Example (Note in VB.NET you can use drop down lists in the top of the VS.NET IDE to auto-create the event handlers) Protected initElkKnob As iseeNET.Knob
...
Private Sub Page_InitSimulationObjects() Handles MyBase.InitSimulationObjects
Me.initElkKnob = Me.Simulation.GetKnob("initial_number_of_elk")
End Sub
Private Sub Page_UpdateInputValues() Handles MyBase.UpdateInputValues
'Get the selected value from the elk drop down
Me.initElkKnob.CurrentValue = Convert.ToDouble(Me.ddlInitalElk.SelectedValue)
End Sub
Private Sub Page_UpdateControls() Handles MyBase.UpdateControls
'Let's bind the drop down list to the values of the input object in the NetSim XML.
'The input object in this case is a Knob, so let's get it:
Dim listItem As ListItem
'Let's populate the drop down list values for the list by looping from Min to Max and stepping by Increment
For i As Integer = initElkKnob.Min To initElkKnob.Max Step initElkKnob.Increment
listItem = New ListItem(CStr(i))
'Check if the value we are adding is the current value of the model entity
'and if it is, make it the selected item in the list
If i = initElkKnob.CurrentValue Then
listItem.Selected = True
End If
'Add the value to the list
Me.ddlInitalElk.Items.Add(listItem)
Next
'If we are past start time, then disable as this is an initial value
If Me.Simulation.CurrentTime > Me.Simulation.TimeSpecs.StartTime Then
Me.ddlInitalElk.Enabled = False
End If
End Sub
Namespace: iseesystems.iseeNET.Controllers.ASPNET
Assembly: iseesystems.iseeNET.Controllers.ASPNET (in iseesystems.iseeNET.Controllers.ASPNET.dll)
PageController Members | iseesystems.iseeNET.Controllers.ASPNET Namespace