예제 #1
0
        public static IAsyncOperation<IList<ItemTypeDefinition>> GetItemTypeDefinitions(HealthVaultApp app, ThingTypeGetParams getParams)
        {
            return AsyncInfo.Run<IList<ItemTypeDefinition>>(
                async cancelToken =>
                {
                    string xml = getParams.ToXml();
                    
                    // Strip off the <ThingTypeGetParams> root node
                    // because all of its properties should be nested under <info> (RequestBody)
                    var doc = new XmlDocument();
                    doc.LoadXml(xml);
                    var innerXml = new StringBuilder();
                    if (doc.ChildNodes != null && doc.ChildNodes.Length == 1)
                    {
                        var innerNodes = doc.ChildNodes[0].ChildNodes;
                        foreach (IXmlNode node in innerNodes)
                        {
                            innerXml.Append(node.GetXml());
                        }
                    }

                    ThingTypeGetResults result =
                        await app.Client.ServiceMethods.GetThingType<ThingTypeGetResults>(innerXml.ToString(), cancelToken);
                    return result.ItemTypeDefinitions;
                });
        }
예제 #2
0
 internal Vocabs(HealthVaultApp app)
 {
     m_app = app;
 }
 internal LocalVocabularyStore(HealthVaultApp app, IObjectStore parentStore)
 {
     m_app = app;
     m_root = new LocalStore(parentStore, "Vocab");
 }