public HealthVaultClient(AppInfo appInfo, ServiceInfo serviceInfo, bool useWebAuthBroker) : this( appInfo, serviceInfo, new HttpTransport(serviceInfo.ServiceUrl), new HttpStreamer(), new Cryptographer(), useWebAuthBroker ? (IWebAuthorizer)new WebAuthorizer() : new BrowserWebAuthorizer()) { }
// We can't pass in a HealthVaultClient directly because it's not a WinRT class. :( public ServiceMethodProvider(HealthVaultAppSettings appSettings) { ServiceInfo serviceInfo = (ServiceInfo)ServiceFactory.CreateServiceInfo( "https://platform.healthvault-ppe.com/platform/wildcat.ashx", "https://account.healthvault-ppe.com"); AppInfo appInfo = new AppInfo(); appInfo.MasterAppId = Guid.Parse(appSettings.MasterAppId); appInfo.IsMultiInstanceAware = true; HealthVaultClient client = new HealthVaultClient( appInfo, serviceInfo, appSettings.IsFirstParty, appSettings.WebAuthorizer != null ? (IWebAuthorizer)appSettings.WebAuthorizer : null); m_serviceMethods = client.ServiceMethods; }
public HealthVaultClient( AppInfo appInfo, ServiceInfo serviceInfo, IHttpTransport transport, IHttpStreamer streamer, ICryptographer cryptographer, IWebAuthorizer authorizer) { appInfo.ValidateRequired("appInfo"); serviceInfo.ValidateRequired("serviceInfo"); if (transport == null) { throw new ArgumentNullException("transport"); } if (streamer == null) { throw new ArgumentNullException("streamer"); } if (cryptographer == null) { throw new ArgumentNullException("cryptographer"); } if (authorizer == null) { throw new ArgumentNullException("authorizer"); } m_appInfo = appInfo; m_serviceInfo = serviceInfo; m_transport = transport; m_streamer = streamer; m_cryptographer = cryptographer; m_authorizer = authorizer; m_serviceMethods = new ServiceMethods(this); m_recordMethods = new RecordMethods(this); m_shell = new Shell(this); m_secretStore = new SecretStore(MakeStoreName(m_appInfo.MasterAppId)); m_state = new ClientState(); LoadState(); }
public async Task <AppProvisioningInfo> CreateApplicationAsync(OnlineIdServiceTicket ticket, AppInfo appInfo, CancellationToken cancelToken) { if (ticket == null) { throw new ArgumentNullException("ticket"); } if (appInfo == null) { throw new ArgumentNullException("appInfo"); } var method = new CreateApplicationWithTicket(m_client, ticket.Value, appInfo.InstanceName); Response response = await method.ExecuteAsync(cancelToken); return((AppProvisioningInfo)response.GetResult()); }