Input/Output arguments

The Input and output arguments (sometimes referred as parameters) are used to specify the inputs and outputs for a module.

Outputs are generally used when dealing with response modules.

There is a strongly typed API to open modules and provide arguments.

In order to Add, Edit or Remove the the arguments for a module, you will find a button in the Menu of TimeLine Developer:

There you can Add, Edit or Remove the arguments. You must specify a name and type for your argument. Each type has a set of options (e.g. Default value, Nullable, Comment etc.) that you can set depending on your needs. These arguments can use standard .NET primitive types (int, string, double etc), DataTables, typed DataSets, typed DataSet rows, typed Enums or generic objects.

This arguments editor changes the TLAppContent.xml file and generates the strongly typed TimeLine.AppContent assembly.

<WHO ID="whoItem" DLL="CustomProject.dll" Class="CustomProject.wndItemCustom" Descr="">
  <InputParameters>
    <Parameter Name="MyCustomArg" Type="System.Double" Default="3.3" IsNullable="True" />
  </InputParameters>
  <OutputParameters>
    <Parameter Name="MyOutputArg" Type="System.Int32" Default="333" />
  </OutputParameters>
</WHO>

Example of setting the input arguments:

var input = new TimeLine.AppContent.WHO.ProdVorKalk2.Input
{
    BabTyp = Enums.BabTyp.Vorkalkulation,
    BabNr = row.id.ToInt(0),
    Kalk2Typ = Enums.Kalk2KopfTyp.Vorkalkulation
};

TimeLine.AppContent.Module.ProdVorKalk2.Open(input);

To use these input arguments use the WHO PostOpen method and check the this.RetrievalArguments property:

public override void PostOpen()
{
    if (RetrievalArguments != null && RetrievalArguments.BelNr != 0)
    {
        var typ = RetrievalArguments.BelTyp;
    }

    base.PostOpen();
}

Example of using the output parameters:

 var outputArgs = TimeLine.AppContent.Module.Item.OpenResponse(input);
 var output = outputArgs.MyOutputArg;

The output will be of type void or new TimeLine.AppContent.WHO.[ModuleName].Output of an tag is present in the TLAppContent.xml file.

Last updated