Example #1
0
        private void DisplayDisclaimer()
        {
            if (!preferenceSettings.GetDisclaimerAgreement())
            {
                string msg = "The information provided in this application is not a substitute for professional healthcare advice." + Environment.NewLine + Environment.NewLine +
                             "Ed Devs is not responsible or liable for any mishaps, reliability issues, or accuracy issues from using this app." + Environment.NewLine + Environment.NewLine +
                             "Please familiarize and verify this app before using in an actual chest compression-only CPR situation.";

                string disagree = "Disagree and quit";
                string agree    = "Agree";

                var popup = new CustomYesNoBox("Terms and Conditions", msg)
                {
                    Buttons = new List <string> {
                        agree, disagree
                    }
                };

                popup.PopupClosed += (o, closedArgs) =>
                {
                    if (closedArgs.Button == agree)
                    {
                        preferenceSettings.SetDisclaimerAgreement(true);
                    }
                    else if (closedArgs.Button == disagree)
                    {
                        //System.Environment.Exit(0);

                        // If doesn't work, hang the app with Environment.Exit()
                        IQuitAppService quitAppService = DependencyService.Get <IQuitAppService>();
                        if (quitAppService != null)
                        {
                            quitAppService.Quit();
                        }
                        else
                        {
                            System.Environment.Exit(0);
                        }
                    }
                    else
                    {
                    }
                };

                popup.Show();
            }
        }