Example #1
0
        private void UpdateUI(object sender, InstallerProgressEvent e)
        {
            if (e.Message.Length > 0)
            {
                logTextBox.AppendText(e.Message + Environment.NewLine);

                logTextBox.SelectionStart  = logTextBox.Text.Length;
                logTextBox.SelectionLength = 0;
            }

            installProgressBar.Value = e.PercentDone;

            if (e.PercentDone == installProgressBar.Maximum)
            {
                cancelButton.Visible = false;
                closeButton.Visible  = true;
            }
        }
Example #2
0
        public void ShowProgress(string message, int percentDone)
        {
            if (InvokeRequired)
            {
                // Wrap the parameters in some EventArgs-derived custom class:
                System.EventArgs e     = new InstallerProgressEvent(message, percentDone);
                object[]         pList = { this, e };

                // Invoke the method. This class is derived
                // from Form, so we can just call BeginInvoke
                // to get to the UI thread.
                BeginInvoke(new MyProgressEventsHandler(UpdateUI), pList);
            }
            else
            {
                // We're already on the UI thread just
                // call straight through.
                UpdateUI(this, new InstallerProgressEvent(message,
                                                          percentDone));
            }
        }
Example #3
0
        public void ShowProgress(string message, int percentDone)
        {
            if (InvokeRequired)
            {
                // Wrap the parameters in some EventArgs-derived custom class:
                System.EventArgs e = new InstallerProgressEvent(message, percentDone);
                object[] pList = { this, e };

                // Invoke the method. This class is derived
                // from Form, so we can just call BeginInvoke
                // to get to the UI thread.
                BeginInvoke(new MyProgressEventsHandler(UpdateUI), pList);
            }
            else
            {
                // We're already on the UI thread just
                // call straight through.
                UpdateUI(this, new InstallerProgressEvent(message,
                    percentDone));
            }
        }
Example #4
0
        private void UpdateUI(object sender, InstallerProgressEvent e)
        {
            if (e.Message.Length > 0)
            {
                logTextBox.AppendText(e.Message + Environment.NewLine);

                logTextBox.SelectionStart = logTextBox.Text.Length;
                logTextBox.SelectionLength = 0;
            }

            installProgressBar.Value = e.PercentDone;

            if (e.PercentDone == installProgressBar.Maximum)
            {
                cancelButton.Visible = false;
                closeButton.Visible = true;
            }
        }