GetClient() публичный статический Метод

public static GetClient ( ) : Microsoft.Health.HealthClientApplication
Результат Microsoft.Health.HealthClientApplication
Пример #1
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();
            ServiceInfo             s         = clientApp.ApplicationConnection.GetServiceDefinition();

            WriteObject(s);
        }
Пример #2
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            List <PersonInfo> authorizedPeople = new List <PersonInfo>(clientApp.ApplicationConnection.GetAuthorizedPeople());

            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor access = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            // Search the health record for basic demographic
            //   information.
            //   Most user records contain an item of this type.
            HealthRecordSearcher search = access.CreateSearcher();
            HealthRecordFilter   filter = new HealthRecordFilter(
                HvShellUtilities.NameToTypeId(Type));

            search.Filters.Add(filter);

            foreach (Object o in search.GetMatchingItems()[0])
            {
                WriteObject(o);
            }
        }
Пример #3
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            if (clientApp.GetApplicationInfo() != null)
            {
                List <PersonInfo> authorizedPeople =
                    new List <PersonInfo>(clientApp.ApplicationConnection.GetAuthorizedPeople());
                WriteObject(authorizedPeople);
            }
        }
Пример #4
0
 protected override void ProcessRecord()
 {
     if (string.IsNullOrEmpty(ThingType))
     {
         HealthClientApplication clientApp = HvShellUtilities.GetClient();
         WriteObject(clientApp.ApplicationConnection.GetVocabulary("thing-types"));
     }
     else
     {
         WriteObject(
             ItemTypeManager.GetHealthRecordItemTypeDefinition(
                 new Guid(ThingType), HvShellUtilities.GetClient().ApplicationConnection)
             );
     }
 }
Пример #5
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp        = HvShellUtilities.GetClient();
            List <PersonInfo>       authorizedPeople = new List <PersonInfo>
                                                           (clientApp.ApplicationConnection.GetAuthorizedPeople());
            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor access = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            Weight weight = new Weight();

            weight.Value = new WeightValue(Value / 2.2,
                                           new DisplayValue(Value, "pounds"));

            access.NewItem(weight);
        }
Пример #6
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp        = HvShellUtilities.GetClient();
            List <PersonInfo>       authorizedPeople = new List <PersonInfo>
                                                           (clientApp.ApplicationConnection.GetAuthorizedPeople());

            // Create an authorized connection for each person on the
            //   list.
            HealthClientAuthorizedConnection authConnection = clientApp.CreateAuthorizedConnection(
                authorizedPeople[0].PersonId);

            // Use the authorized connection to read the user's default
            //   health record.
            HealthRecordAccessor accessor = new HealthRecordAccessor(
                authConnection, authConnection.GetPersonInfo().GetSelfRecord().Id);

            HealthServiceRequest request =
                new HealthServiceRequest(accessor.Connection, "PutThings", 2, accessor);

            // Read the input file
            request.Parameters = System.IO.File.ReadAllText(Path.GetFullPath(FileName));
            request.Execute();
        }
Пример #7
0
        protected override void ProcessRecord()
        {
            HealthClientApplication clientApp = HvShellUtilities.GetClient();

            WriteObject(clientApp.ApplicationConnection.GetVocabularyKeys());
        }