Пример #1
0
        //***********************************************************************************************************************

        //***********************************************************************************************************************
        /// <summary>
        /// Affiche la fenêtre d'évaluation.
        /// </summary>
        //-----------------------------------------------------------------------------------------------------------------------
        public static void Show()
        {
            //-------------------------------------------------------------------------------------------------------------------
            try
            {
                //---------------------------------------------------------------------------------------------------------------
                ApplicationReview.RegisterReview(true);

                (new MarketplaceReviewTask()).Show();
                //---------------------------------------------------------------------------------------------------------------
            }
            //-------------------------------------------------------------------------------------------------------------------
            catch {}
            //-------------------------------------------------------------------------------------------------------------------
        }
Пример #2
0
        //***********************************************************************************************************************

        //***********************************************************************************************************************
        /// <summary>
        /// Propose à l'utilisateur de mettre à jour son app.
        /// </summary>
        /// <param name="AppGuid">Identifiant de l'application.</param>
        /// <param name="Title">Titre de l'app.</param>
        //-----------------------------------------------------------------------------------------------------------------------
        public static void SuggestReview(Guid AppGuid, string Title)
        {
            //-------------------------------------------------------------------------------------------------------------------
            string Caption = "Votre avis sur {0}";
            string Message = "Vous appréciez utiliser {0} ?" +
                             "\n" +
                             "Prenez une seconde pour l'évaluer. Merci :)";
            string LeftButtonText  = "oui";
            string RightButtonText = "non";

            //-------------------------------------------------------------------------------------------------------------------

            //-------------------------------------------------------------------------------------------------------------------
            if (DeviceInfos.ApplicationCulture.TwoLetterISOLanguageName.EqualsIgnoreCase("en"))
            {
                //---------------------------------------------------------------------------------------------------------------
                Caption = "Review on {0}";
                Message = "You appreciate use {0} ?" +
                          "\n" +
                          "Take a second to evaluate it. Thanks :)";
                LeftButtonText  = "yes";
                RightButtonText = "no";
                //---------------------------------------------------------------------------------------------------------------
            }
            //-------------------------------------------------------------------------------------------------------------------

            //-------------------------------------------------------------------------------------------------------------------
            Caption = string.Format(Caption, Title);
            Message = string.Format(Message, Title);
            //-------------------------------------------------------------------------------------------------------------------

            //-------------------------------------------------------------------------------------------------------------------
            CustomMessageBox MessageBox = new CustomMessageBox()
            {
                Caption            = Caption,
                Message            = Message,
                LeftButtonContent  = LeftButtonText,
                RightButtonContent = RightButtonText,
            };

            //-------------------------------------------------------------------------------------------------------------------

            //-------------------------------------------------------------------------------------------------------------------
            MessageBox.Dismissed += (S, A) =>
            {
                //---------------------------------------------------------------------------------------------------------------
                try
                {
                    //-----------------------------------------------------------------------------------------------------------
                    if (A.Result == CustomMessageBoxResult.LeftButton)
                    {
                        ApplicationReview.RegisterReview(true);

                        (new MarketplaceReviewTask()).Show();
                    }
                    //-----------------------------------------------------------------------------------------------------------
                    else
                    {
                        ApplicationReview.RegisterReview(false);
                    }
                    //-----------------------------------------------------------------------------------------------------------
                }
                //---------------------------------------------------------------------------------------------------------------
                catch {}
                //---------------------------------------------------------------------------------------------------------------
            };
            //-------------------------------------------------------------------------------------------------------------------

            //-------------------------------------------------------------------------------------------------------------------
            MessageBox.Show();
            //-------------------------------------------------------------------------------------------------------------------
        }