示例#1
0
        /// <summary>
        /// Connect to API, load planes and add to cache
        /// </summary>
        /// <returns>Task</returns>
        private async Task GetPlanesListFromApiAsync()
        {
            RunOnUiThread(() => {
                debugTextView.SetText("loading planes", TextView.BufferType.Normal);
            });
            string URL = context.Resources.GetString(Resource.String.apiPlanesUrl);
            ApiXmlReaderInitial initial    = new ApiXmlReaderInitial();
            XmlReader           xReader    = initial.ApiXmlReader(URL);
            XmlSerializer       serializer = new XmlSerializer(typeof(ArrayOfPlanes));

            arrayOfPlanes = (ArrayOfPlanes)serializer.Deserialize(xReader);

            await BlobCache.UserAccount.InsertObject("cachedArrayOfPlanes", arrayOfPlanes, TimeSpan.FromDays(7));
        }
示例#2
0
 /// <summary>
 /// Load cached List of planes
 /// </summary>
 private async Task FillListFromCacheAsync()
 {
     arrayOfPlanes = await BlobCache.UserAccount.GetObject <ArrayOfPlanes>("cachedArrayOfPlanes");
 }