Esempio n. 1
0
        private void BackgroundPokemonGeneratorCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show($"Error encountered while running generator:\n{e.Error.ToString()}\nPlease check your input and try again.");
            }

            PanelOuter.Enabled = true;
            PanelProgress.Hide();
        }
Esempio n. 2
0
        private void ButtonGenerateClick(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(GroupBoxPlayerOneOptions.OutLocation) || string.IsNullOrWhiteSpace(GroupBoxPlayerTwoOptions.OutLocation))
            {
                throw new ArgumentNullException("Out Files must be specified");
            }

            PanelOuter.Enabled = false;
            PanelProgress.Show();
            PanelProgress.BringToFront();

            BackgroundPokemonGenerator.RunWorkerAsync(_options.Value);
        }
        public void PlaybackTick(int elapsedUS)
        {
            if (InvokeRequired)
            {
                Invoke(new ReplayTickHandler(PlaybackTick), elapsedUS);
            }
            else
            {   //invoke safe
                using (Graphics g = PanelProgress.CreateGraphics())
                {
                    PlaybackIndicatorInvert(g, lastElapsedUS); //first invert (ie. un-invert) the last indicator line
                    PlaybackIndicatorInvert(g, elapsedUS);     //hten invert the new indicator line
                }

                lastElapsedUS = elapsedUS;
            }
        }