Flynet Studio Code Generation Properties

SharedNavCode - Custom Code

SharedNavCode - Custom Code

Previous topic Next topic  

SharedNavCode - Custom Code

Previous topic Next topic  

The Static SharedNav User class that implements custom logic for shared navigation methods.  Shared navigation methods include the HostLogon, HostLogoff, NavToHomeScreen and any other navigation methods that are shared between the Task module (standard and auto-logon sessions) and the PooledSession module, which handles logging-on, homescreen management and logging off for Pooled sessions.

 

The Custom Code properties are special code-oriented string properties with a dedicated editor and the capability for import/export functionality between the Tester GUI generations and the full application generation.

 

Since Logging-on, Home screen navigation and Logging off are common across all testing modules as well as the full web service solution, it is important that those methods can be shared once perfected.

 

Frequently, especially for complex requirements, the HostLogon method will benefit from customization.  When this is recognized, if one developer works hard to perfect the HostLogon method, the perfected code can be placed in this property (as part of the complete SharedNav class) and thus propagated across all unit testing GUI generations as well as the full web service.

 

Empty, un-customized SharedNav property--any one or all methods can be customized in place of calling the "CG" versions:

 

 /// <summary>

 /// A small class designed to contain common host logon and logoff routines so

 /// that they can be shared by Pooled sessions as well as standard sessions

 /// </summary>

 public class SharedNav : SharedNavCG

 {

         /// <summary>

         /// The static HostLogon method puts HostLogon logic in one place for both standard

         /// and Pooled sessions

         /// </summary>

         /// <param name="ioBag">IOBag containing active context values</param>

         /// <param name="ts">Object implementing the ISessionServices Interface</param>

         /// <param name="task">Object implementing the ITaskServices interface</param>

         /// <returns></returns>

         public static LogonState HostLogon(IOBag ioBag, ISessionServices ts, ITaskServices task)

         {

                 return HostLogonCG(ioBag, ts, task);

         }

         

         /// <summary>

         /// HomeScreenReady returns true when the PolicySelect

         /// screen is displayed.  It is provided as virtual to enable overrides

         /// and adding "clones" to be treated in the same way as the home screen,

         /// where the same field to enter commands and/or function keys work identically

         /// to the home screen.

         /// </summary>

         /// <param name="ts">Object implementing the ISessionServices Interface</param>

         /// <returns>true when the homescreen or functionally identical screen is displayed</returns>                

         public static bool HomeScreenReady(ISessionServices ts)

         {

                 return HomeScreenReadyCG(ts);

         }

         

         /// <summary>

         /// NavToHomeScreen will navigate from the active screen to the PolicySelect

         /// screen, using the navTowardsHomeKey whenever a screen is displayed

         /// which has no known recorded navigation towards the home screen

         /// </summary>

         /// <param name="ioBag">IOBag containing active context values</param>

         /// <param name="ts">Object implementing the ISessionServices Interface</param>

         /// <param name="task">Object implementing the ITaskServices interface</param>

         /// <returns>TaskState, usually TaskState.SwitchView unless the homescreen is 

         /// already displayed, then TaskState.OK will be returned</returns>

         public static TaskState NavToHomeScreen(IOBag ioBag, ISessionServices ts, ITaskServices task)

         {

                 return NavToHomeScreenCG(ioBag,ts,task);

         }

         

         /// <summary>

         /// The static HostLogoff method puts HostLogoff logic in one place for both standard

         /// and Pooled sessions--if a custom HostLogoff method is saved in a TaskProject, the contents

         /// will be generated here, while the code-generated HostLogoff will continuously be updated

         /// </summary>

         /// <param name="ioBag">IOBag containing active context values</param>

         /// <param name="ts">Object implementing the ISessionServices Interface</param>

         /// <param name="task">Object implementing the ITaskServices interface</param>

         /// <returns></returns>

         public static LogonState HostLogoff(IOBag ioBag, ISessionServices ts, ITaskServices task)

         {

                 return HostLogoffCG(ioBag, ts, task);

         }

         

         public SharedNav()

         {

         }

 }