/// <summary>
        /// Modify custom phrase screen
        /// </summary>
        /// <param name="c">The conclusion to modify, or null if new conclusion</param>
        public CustomizationCustomize(CustomConclusion c)
        {
            originalConclusion = c;

            InitializeComponent();

            if (c != null)
            {
                if (c.GetSubject().ToLower().StartsWith('i'))
                {
                    subject.SelectedIndex = 1;
                }
                else
                {
                    subject.SelectedIndex = 0;
                }

                emotion.SelectedIndex = emotion.Items.IndexOf(c.GetEmotion().ToLower());

                conjunction.Text = c.GetConjunction();
                conclusion.Text  = c.GetConclusion();
            }
        }
示例#2
0
        /// <summary>
        /// When user presses a custom conclusion button
        /// Only call from XAML
        /// </summary>
        /// <param name="se"></param>
        /// <param name="ee"></param>
        void Handle_CustomConclusion(object se, EventArgs ee)
        {
            string str = (se as Button).Text;
            string tut = "";

            customConclusionHolder = Customization.GetItem(str);

            string sentence = subjectHolder.GetName() + " " + emotionHolder.GetName() + " " + customConclusionHolder.GetConjunction() + " " + customConclusionHolder.GetConclusion() + (subjectHolder.GetName().ToLower().StartsWith("i") ? "." : "?");

            text.FontSize = CalculateFontSize(sentence);
            text.Text     = sentence;

            if (keepTut)
            {
                tut = "Your full sentence is displayed here:\r\n";
                Tutorial.self.tutSetPageTwo(se, ee, tutFiveText, 0.1, 0.05);
                topFlex.IsEnabled    = false;
                BackButton.IsEnabled = true;
            }

            DisplayAlert("Sentence", tut + subjectHolder.GetName() + " " + emotionHolder.GetName() + " " + customConclusionHolder.GetConjunction() + " " + customConclusionHolder.GetConclusion() + (subjectHolder.GetName().ToLower().StartsWith("i") ? "." : "?"), "OK");
            canGoBack = true;
        }