Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Calling _Pick location_

The re-call header

A re-call header is a comment snippet with XML for WxeGen.exe
to read and process. The re-call header annotates the class constituting
the re-call function. The re-call header for Pick location looks like
this:

Code Block

  // <WxeFunction>
  //   <ReturnValue type="Location" />
  //   <Variable name="items" type="Location[]" />
  // </WxeFunction>
  public partial class PickLocation : BasePage
  {
    protected void Page_Load (object sender, EventArgs e)
    {
      Title = ResourceManagerUtility.GetResourceManager (this).GetString ("Pick~Location");
      if (IsPostBack)
      {
        FilteredLocationsList.LoadUnboundValue (items, true);
      }
    }

   ... more code, more methods ...

As you might guess, this re-call header specifies

  • the return value of the page function is Location – a Location
    object is passed back to the caller, after all
  • a local variable named items of type Location[] – this array
    of locations is required for storing the pick-list ("3" in the illustration
    above) between post-backs

You can use arbitrary types, an arbitrary number of local variables and
parameters – even out parameters. A complete catalog of how to write
re-call headers can be found here: writing re-call headers.

As soon as you rebuild your project, the program generator WxeGen.exe
discovers that the file is newer than the project file and re-generate
the boiler plate for handling the desired return value, parameters and
page-local variables gracefully. The next section explains how this
works.Pick location's re-call header

Enter WxeGen.exe