Exemple #1
0
 /// <summary>
 /// Displays a popup with an OK button 
 /// </summary>
 /// 
 /// <param name="title">Title Text</param>
 /// <param name="text">Message text</param>
 /// <param name="okClickHandler">OK button click handler</param>
 private void ShowOKPopup(string title, string text, EventHandler okClickHandler)
 {
     MessageDialog popup = new MessageDialog(text, "OK", okClickHandler);
     popup.TitleBarText = title;
     m_openPopups.Add(popup);
     popup.Show();
 }
Exemple #2
0
 /// <summary>
 /// Displays a popup with an OK button
 /// </summary>
 ///
 /// <param name="title">Title Text</param>
 /// <param name="text">Message text</param>
 /// <param name="okClickHandler">OK button click handler</param>
 private void ShowOKPopup(string title, string text)
 {
     m_okPopup = new MessageDialog(text, "OK", OnPopupAcknowledged);
     m_okPopup.TitleBarText = title;
     m_okPopup.Show();
 }
        /// <summary>
        /// User pressed the SetSimulationSpeed button
        /// </summary>
        /// <param name="sender">Sender of the event</param>
        /// <param name="e">Event arguments</param>
        private void OnSetSimulationSpeedClicked(object sender, EventArgs e)
        {
            double speed;
            bool valid = false;

            if (Double.TryParse(txtSpeed.Text, out speed))
            {
                if (m_simulator.SetSimulationSpeed(speed)) //Set the simulation speed
                {
                    valid = true;
                }
            }

            if (!valid)
            {
                //Show invalid popup
                m_okPopup = new MessageDialog("Time is invalid", "OK", OnPopupAcknowledged);
                m_okPopup.TitleBarText = "Error";
                m_okPopup.Show();
            }
        }