/// <summary> /// Check that the application is authenticated. /// </summary> /// <param name="service">The service.</param> /// <param name="authenticationCompleted">Completion handler.</param> /// <param name="shellAuthRequired">Handler if shell authorization is required.</param> public static void BeginAuthenticationCheck( HealthVaultService service, EventHandler<HealthVaultResponseEventArgs> authenticationCompleted, EventHandler<HealthVaultResponseEventArgs> shellAuthRequired) { AuthenticationCheckState state = new AuthenticationCheckState(service, authenticationCompleted, shellAuthRequired); BeginAuthenticationCheck(state); }
// Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { TrialModeStorageProvider.Instance.Load(); if (!App.IsTrial) { HealthVaultService = new HealthVaultService(platformUrl, shellUrl, new Guid(masterAppId)); FacebookService = new FacebookService(); } }
/// <summary> /// Authorize other records. /// </summary> /// <param name="service">The HealthVaultService instance.</param> /// <param name="authenticationCompleted">Handler to call when finished.</param> /// <param name="shellAuthRequired">Handler to call for authorization.</param> public static void BeginAuthorizeRecords( HealthVaultService service, EventHandler<HealthVaultResponseEventArgs> authenticationCompleted, EventHandler<HealthVaultResponseEventArgs> shellAuthRequired) { AuthenticationCheckState state = new AuthenticationCheckState(service, authenticationCompleted, shellAuthRequired); state.ShellAuthRequiredHandler(null, null); }
// Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { HealthVaultService = new HealthVaultService(platformUrl, shellUrl, new Guid(masterAppId)); }
// Code to execute when the application is launching (eg, from Start) // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { HealthVaultService = new HealthVaultService(platformUrl, shellUrl, new Guid(masterAppId)); FacebookService = new FacebookService(); }
/// <summary> /// Initializes a new instance of the AuthenticationCheckState class. /// </summary> /// <param name="service">The service.</param> /// <param name="authenticationCompleted">Completion handler.</param> /// <param name="shellAuthRequired">Authorization required handler.</param> public AuthenticationCheckState( HealthVaultService service, EventHandler<HealthVaultResponseEventArgs> authenticationCompleted, EventHandler<HealthVaultResponseEventArgs> shellAuthRequired) { Service = service; AuthenticationCompletedHandler = authenticationCompleted; ShellAuthRequiredHandler = shellAuthRequired; }