Ejemplo n.º 1
0
 public static void Show(MarketplaceContent content, MarketplaceOperation operation, string context)
 {
     if (!ChooserHelper.NavigationInProgressGuard(delegate
     {
         MarketplaceLauncher.Show(content, operation, context);
     }
                                                  ))
     {
         return;
     }
     if (operation == MarketplaceOperation.Open)
     {
         if (!string.IsNullOrEmpty(context))
         {
             throw new ArgumentException("context");
         }
         MarketplaceLauncher.DispatchBrowse(content);
         return;
     }
     else
     {
         if (operation == MarketplaceOperation.Search)
         {
             if (context == null)
             {
                 throw new ArgumentNullException("context");
             }
             if (context.Length == 0)
             {
                 throw new ArgumentException("context");
             }
             MarketplaceLauncher.DispatchSearch(content, context);
             return;
         }
         else
         {
             if (operation != MarketplaceOperation.ReviewItem && operation != MarketplaceOperation.ViewDetails)
             {
                 throw new ArgumentOutOfRangeException("operation");
             }
             if (content != MarketplaceContent.Applications)
             {
                 throw new ArgumentException("content");
             }
             string relative;
             if (operation == MarketplaceOperation.ReviewItem)
             {
                 if (context != null)
                 {
                     throw new ArgumentException("context");
                 }
                 context  = new HostInfo().ProductId;
                 relative = "AppReviews";
             }
             else
             {
                 if (context == null)
                 {
                     context = new HostInfo().ProductId;
                 }
                 else
                 {
                     context = new Guid(context).ToString();
                 }
                 relative = "AppDetails";
             }
             ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();
             parameterPropertyBag.CreateProperty("id").StringValue = context;
             ChooserHelper.Navigate(MeuxHelper.MakeUri(relative), parameterPropertyBag);
             return;
         }
     }
 }
Ejemplo n.º 2
0
 public static void Show(MarketplaceContent content, MarketplaceOperation operation)
 {
     MarketplaceLauncher.Show(content, operation, null);
 }