Пример #1
0
        /// <summary>Shows the Messaging application.</summary>
        public void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();
            string to = this.To;

            if (!string.IsNullOrEmpty(to))
            {
                ParameterProperty parameterProperty = parameterPropertyBag.CreateProperty("To");
                parameterProperty.StringValue = to;
            }
            string body = this.Body;

            if (!string.IsNullOrEmpty(body))
            {
                ParameterProperty parameterProperty2 = parameterPropertyBag.CreateProperty("Body");
                parameterProperty2.StringValue = body;
            }
            ParameterProperty parameterProperty3 = parameterPropertyBag.CreateProperty("Account");

            parameterProperty3.StringValue = "{FD39DA85-C18F-4c0c-AEAC-75867CEA7876}";
            Uri appUri = new Uri("app://5B04B775-356B-4AA0-AAF8-6491FFEA5614/ShareContent", UriKind.Absolute);

            ChooserHelper.Navigate(appUri, parameterPropertyBag);
        }
Пример #2
0
        private static void DispatchSearch(MarketplaceContent content, string context)
        {
            string stringValue;

            switch (content)
            {
            case MarketplaceContent.Applications:
            {
                stringValue = "application";
                break;
            }

            case MarketplaceContent.Music:
            {
                stringValue = "music";
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException("content");
            }
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();

            parameterPropertyBag.CreateProperty("SearchHint").StringValue = stringValue;
            parameterPropertyBag.CreateProperty("SearchTerm").StringValue = context;
            ChooserHelper.Navigate(MeuxHelper.MakeUri("MarketplaceSearch"), parameterPropertyBag);
        }
Пример #3
0
        public override void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();

            ChooserHelper.FillCommonPhotoProperties(parameterPropertyBag, "PhotoChooser-");
            int pixelWidth  = this.PixelWidth;
            int pixelHeight = this.PixelHeight;

            parameterPropertyBag.CreateProperty("CropWidthPixels").Int32Value  = pixelWidth;
            parameterPropertyBag.CreateProperty("CropHeightPixels").Int32Value = pixelHeight;
            parameterPropertyBag.CreateProperty("ShowCamera").BoolValue        = this.ShowCamera;
            byte[] buffer = ChooserHelper.Serialize(parameterPropertyBag);
            Uri    appUri = new Uri("app://5B04B775-356B-4AA0-AAF8-6491FFEA5632/PhotoPicker", UriKind.Absolute);

            base.Show();
            ChooserHelper.Invoke(appUri, buffer, this._genericChooser);
        }
Пример #4
0
        private static void DispatchBrowse(MarketplaceContent content)
        {
            string relative;

            switch (content)
            {
            case MarketplaceContent.Applications:
            {
                relative = "AppMarketplaceHub";
                break;
            }

            case MarketplaceContent.Music:
            {
                relative = "MusicMarketplaceHub";
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException("content");
            }
            }
            ChooserHelper.Navigate(MeuxHelper.MakeUri(relative), new ParameterPropertyBag());
        }
Пример #5
0
 /// <summary>Shows the Windows Phone Marketplace client application and displays the details page for the specified product.</summary>
 public void Show()
 {
     if (!ChooserHelper.NavigationInProgressGuard(delegate
     {
         this.Show();
     }
                                                  ))
     {
         return;
     }
     MarketplaceLauncher.Show((MarketplaceContent)this._marketPlaceContentType, MarketplaceOperation.ViewDetails, this._contentIdentifier);
 }
Пример #6
0
 public void Show()
 {
     if (!ChooserHelper.NavigationInProgressGuard(delegate
     {
         this.Show();
     }
                                                  ))
     {
         return;
     }
     ThreadPool.QueueUserWorkItem(new WaitCallback(PhoneCallTask.PhoneDial), this);
 }
Пример #7
0
 /// <summary>Shows the Windows Phone Marketplace client application and displays the search results from the specified search terms.</summary>
 public void Show()
 {
     if (!ChooserHelper.NavigationInProgressGuard(delegate
     {
         this.Show();
     }
                                                  ))
     {
         return;
     }
     MarketplaceLauncher.Show((MarketplaceContent)this._marketPlaceContentType, MarketplaceOperation.Search, this._searchTerms);
 }
Пример #8
0
 /// <summary>Shows the Windows Phone Marketplace client application and displays the review page for the specified product.</summary>
 public void Show()
 {
     if (!ChooserHelper.NavigationInProgressGuard(delegate
     {
         this.Show();
     }
                                                  ))
     {
         return;
     }
     MarketplaceLauncher.Show(MarketplaceContent.Applications, MarketplaceOperation.ReviewItem, null);
 }
Пример #9
0
        /// <summary>Shows the Web browser application.</summary>
        public void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            string appUri = "app://5B04B775-356B-4AA0-AAF8-6491FFEA5660/_default?StartURL=" + this.URL;

            ChooserHelper.LaunchSession(appUri);
        }
Пример #10
0
        /// <summary>Shows the Web Search application.</summary>
        public void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();
            ParameterProperty    parameterProperty    = parameterPropertyBag.CreateProperty("QueryString");

            parameterProperty.StringValue = this.SearchQuery;
            Uri appUri = new Uri("app://5B04B775-356B-4AA0-AAF8-6491FFEA5661/SearchResults", UriKind.Absolute);

            ChooserHelper.Navigate(appUri, parameterPropertyBag);
        }
Пример #11
0
        /// <summary>Shows the Contacts application.</summary>
        public override void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            ParameterPropertyBag ppb = new ParameterPropertyBag();

            byte[] buffer = ChooserHelper.Serialize(ppb);
            Uri    appUri = new Uri("app://5B04B775-356B-4AA0-AAF8-6491FFEA5615/ChoosePhonePropertyOfExistingPerson", UriKind.Absolute);

            base.Show();
            ChooserHelper.Invoke(appUri, buffer, this._genericChooser);
        }
Пример #12
0
        /// <summary>Shows the contacts application.</summary>
        public override void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();
            ParameterProperty    parameterProperty    = parameterPropertyBag.CreateProperty("PhoneNumberToSave");

            parameterProperty.StringValue = this.PhoneNumber;
            byte[] buffer = ChooserHelper.Serialize(parameterPropertyBag);
            Uri    appUri = new Uri("app://5B04B775-356B-4AA0-AAF8-6491FFEA5615/SaveANumberToAddressBook", UriKind.Absolute);

            base.Show();
            ChooserHelper.Invoke(appUri, buffer, this._genericChooser);
        }
Пример #13
0
        /// <summary>Shows the media player application.</summary>
        public void Show()
        {
            if (!ChooserHelper.NavigationInProgressGuard(delegate
            {
                this.Show();
            }
                                                         ))
            {
                return;
            }
            if (this.Media == null)
            {
                throw new InvalidOperationException();
            }
            ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag();

            parameterPropertyBag.CreateProperty("url").StringValue     = this.AdjustUri(this.Media);
            parameterPropertyBag.CreateProperty("controls").Int32Value = (int)this.Controls;
            ChooserHelper.Navigate(MeuxHelper.MakeUri("_PlayUrl"), parameterPropertyBag);
        }
Пример #14
0
        internal override void OnInvokeReturned(byte[] outputBuffer, Delegate fireThisHandlerOnly)
        {
            bool flag = false;

            if (outputBuffer.Length > 0)
            {
                ParameterPropertyBag parameterPropertyBag = new ParameterPropertyBag(outputBuffer, (uint)outputBuffer.Length);
                ParameterProperty    property             = parameterPropertyBag.GetProperty("SelectedFilePath");
                if (property.ValueType == ParameterPropertyValueType.ValueType_String && !string.IsNullOrEmpty(property.StringValue))
                {
                    flag = true;
                    PhotoResult photoResult = ChooserHelper.PathParameterToPhotoResult(property);
                    photoResult.TaskResult = TaskResult.OK;
                    base.FireCompleted(this, photoResult, fireThisHandlerOnly);
                }
            }
            if (!flag)
            {
                base.FireCompleted(this, new PhotoResult(TaskResult.Cancel), fireThisHandlerOnly);
            }
        }
Пример #15
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;
         }
     }
 }