Esempio n. 1
0
 private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
 {
     ViewModel.OnLoadingListStateChanged += new EventHandler(ViewModel_OnLoadingListStateChanged);
     //IDictionary<String, String> qs = this.NavigationContext.QueryString;
     if (Request != null)
     {
         var qs    = new Dictionary <string, string>();
         var lines = Request.Split('&');
         foreach (var line in lines)
         {
             if (line.IndexOf("=") != -1)
             {
                 qs.Add(line.Substring(0, line.IndexOf("=")), line.Substring(line.IndexOf("=") + 1));
             }
         }
         var list = new List <XapReaderViewModelEx>();
         int i    = 1;
         while (true)
         {
             string keyName = "file" + i.ToString();
             if (qs.ContainsKey(keyName))
             {
                 var xap   = new XapReaderViewModelEx(qs[keyName]);
                 var addon = new XapAdditionData();
                 if (qs.ContainsKey("license" + i.ToString()))
                 {
                     addon.LicenseFile = qs["license" + i.ToString()];
                 }
                 if (qs.ContainsKey("instance" + i.ToString()))
                 {
                     addon.InstanceID = qs["instance" + i.ToString()];
                 }
                 if (qs.ContainsKey("offer" + i.ToString()))
                 {
                     addon.OfferID = qs["offer" + i.ToString()];
                 }
                 xap.UserData = addon;
                 xap.State    = LocalizedResources.txtStateInstallationPending;
                 list.Add(xap);
                 i++;
             }
             else
             {
                 break;
             }
         }
         ViewModel.Preload(list);
     }
 }
 private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
 {
     ViewModel.OnLoadingListStateChanged += new EventHandler(ViewModel_OnLoadingListStateChanged);
     //IDictionary<String, String> qs = this.NavigationContext.QueryString;
     if (Request != null)
     {
         var qs = new Dictionary<string, string>();
         var lines = Request.Split('&');
         foreach (var line in lines)
         {
             if (line.IndexOf("=") != -1)
             {
                 qs.Add(line.Substring(0, line.IndexOf("=")), line.Substring(line.IndexOf("=") + 1));
             }
         }
         var list = new List<XapReaderViewModelEx>();
         int i = 1;
         while (true)
         {
             string keyName = "file" + i.ToString();
             if (qs.ContainsKey(keyName))
             {
                 var xap = new XapReaderViewModelEx(qs[keyName]);
                 var addon = new XapAdditionData();
                 if (qs.ContainsKey("license" + i.ToString()))
                     addon.LicenseFile = qs["license" + i.ToString()];
                 if (qs.ContainsKey("instance" + i.ToString()))
                     addon.InstanceID = qs["instance" + i.ToString()];
                 if (qs.ContainsKey("offer" + i.ToString()))
                     addon.OfferID = qs["offer" + i.ToString()];
                 xap.UserData = addon;
                 xap.State = LocalizedResources.txtStateInstallationPending;
                 list.Add(xap);
                 i++;
             }
             else
             {
                 break;
             }
         }
         ViewModel.Preload(list);
     }
 }