コード例 #1
0
 private AppsPreview CreateAppsPreview(MarketCat Cat)
 {
     XMLLoader loader = new XMLLoader();
     XMLParser parser = new MarketAppXMLParserFromMP();
     XMLLoader previewLoader = new XMLLoader();
     XMLParser previewParser = new MarketAppXMLParser();
     Uri uri = URIModel.Instance.getBaseAppsUri();
     AppsPreview RandomAppsPreview;
     RandomAppsPreview = new AppsPreview();
     RandomAppsPreview.URI = uri;
     RandomAppsPreview.Category = Cat;
     RandomAppsPreview.PreviewLoader = previewLoader;
     RandomAppsPreview.Loader = loader;
     RandomAppsPreview.PreviewParser = previewParser;
     RandomAppsPreview.Parser = parser;
     RandomAppsPreview.UrlGetter = URIModel.Instance.getRandomWithCat;
     RandomAppsPreview.ErrorEvent += RandomAppsPreview_ErrorEvent;
     return RandomAppsPreview;
 }
コード例 #2
0
 void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     MarketAppXMLParser parser = new MarketAppXMLParser();
     XDocument doc = XDocument.Parse(e.Result);
     parser.parse(doc);
     MarketApp app = parser.ParsedApp;
     StandardTileData NewTileData = new StandardTileData
     {
         Title = app.Title,
         BackgroundImage = new Uri(app.Image, UriKind.Absolute),
         BackBackgroundImage = new Uri(app.Image, UriKind.Absolute),
         BackContent = app.Title
     };
     currentTile.Update(NewTileData);
     //use to communique with main app
     var settings = IsolatedStorageSettings.ApplicationSettings;
     String currentCat=GetCategorie(currentTile.NavigationUri.OriginalString);
     if (settings.Contains(currentCat))
         settings[currentCat] = app.Id;
     settings.Save();
     updatedTiles++;
     if (updatedTiles == tilesToUpdate)
     {
         NotifyComplete();
     }
 }