Global handling of session events

The iNow Designer can be used to create an extension script to handle iNOW UI events globally.

Screen recognition in code

This routine is performed before regular screen identification.
If you set args.FlexId to a FlexId, this screen will be used.
If you set args.FlexId to a null and args.CancelDefaultDetection to True,
then the regular screen identification is not performed and the screen runs OnTheFly. .

/// <summary>
/// called when checking for FLEX screens
/// </summary>
/// <param name="args">arguments for FlexId</param>
public override void CheckFlexScreen(CustomFlexIdArguments args)
{
    if (args.Screen.GetText(0, 0, 80).Contains("Work with User Jobs"))
    {
        args.FlexId = "WRKUSRJOB";
    }   
}

IgnoreScreen recognition in code

If you set args.IsIgnoreScreen to True, this screen will be skipped automatically with data sharing.
If you set args.CancelDefaultDetection to True, the regular IgnoreScreen detection will not be performed.

/// <summary>
/// called when checking for ignore screens
/// </summary>
/// <param name="args">arguments for Ignore Screen</param>
public override void CheckIgnoreScreen(CustomFlexIgnoreArguments args)
{
    if (args.Screen.GetText(0, 0, 80).Contains("Sign-on") && args.Screen.GetText(0, 0, 80).Contains("Information")
    {
        args.IsIgnoreScreen = true;
    }
}

Handling HostDataChanged

Global code before BeforeHostDataChange

The following routine is executed before the BeforeHostDataChange event of the screens.
If you set args.CancelDefaultRoutine to True, the original routine of the screen will not be executed.

/// <summary>
/// called before BeforeHostDataChange 
/// </summary>
/// <param name="args">arguments for HostDataChanged</param>
public override void BeforeBeforeHostDataChange(CustomFlexScreenArguments args)
{
   var userControl = args.Control as FlexUserControl;
   if (userControl == null) return;
   MessageBox.Show(userControl.ScreenId + " before BeforeHostDataChange");
}

Global code before HostDataChanged

The following routine is executed before the HostDataChanged event of the screens.
If you set args.CancelDefaultRoutine to True, the original routine of the screen will not be executed.

/// <summary>
/// called before HostDataChanged
/// </summary>
/// <param name="args">arguments for HostDataChanged</param>
public override void BeforeHostDataChanged(CustomFlexScreenArguments args)
{
   var userControl = args.Control as FlexUserControl;
   if (userControl == null) return;
   MessageBox.Show(userControl.ScreenId + " before HostDataChange");
}

Global code after HostDataChanged

The following routine is executed after the HostDataChanged event of the screens.
The parameter args.CancelDefaultRoutine has no function.

/// <summary>
/// called after HostDataChanged
/// </summary>
/// <param name="args">arguments for HostDataChanged</param>
public override void AfterHostDataChanged(CustomFlexScreenArguments args)
{
   var userControl = args.Control as FlexUserControl;
   if (userControl == null) return;
   MessageBox.Show(userControl.ScreenId + " after HostDataChange");
}

Global Code before HostDataChanged of a Design Control

The following routine is executed before the HostDataChanged event of the design control.
If you set args.CancelDefaultRoutine to True, the original routine of the design control will not be executed.

/// <summary>
/// called before HostDataChange of a Design Control
/// </summary>
/// <param name="args">arguments for HostDataChanged</param>
public override void BeforeDCHostDataChanged(CustomFlexScreenArguments args)
{
   var designControl = args.Control as FlexDesignUserControl;
   if (designControl == null) return;
   MessageBox.Show(designControl.Name + " before HostDataChange (DC)");
}

Global Code after HostDataChanged of a Design Control

The following routine is executed after the HostDataChanged event of the design control.
The parameter args.CancelDefaultRoutine has no function.

/// <summary>
/// called after HostDataChanged of a Design Control
/// </summary>
/// <param name="args">arguments for HostDataChanged</param>
public override void AfterDCHostDataChanged(CustomFlexScreenArguments args)
{
   var designControl = args.Control as FlexDesignUserControl;
   if (designControl == null) return;
   MessageBox.Show(designControl.Name + " after HostDataChange (DC)");
}