/// <summary>
 /// Constructor.
 /// </summary>
 public DataUpdateNotifyForm(DataUpdateAvailableEventArgs args)
     : this()
 {
     m_args = args;
 }
Beispiel #2
0
        /// <summary>
        /// Occurs when new datafiles versions are available. Display the information form to the user.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnDataUpdateAvailable(object sender, DataUpdateAvailableEventArgs e)
        {
            // Ensure it is invoked on the proper thread
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => OnDataUpdateAvailable(sender, e)));
                return;
            }

            if (m_isShowingDataUpdateWindow)
                return;

            m_isShowingDataUpdateWindow = true;
            using (DataUpdateNotifyForm f = new DataUpdateNotifyForm(e))
            {
                if (f.ShowDialog() == DialogResult.OK)
                    RestartApplication();
            }
            m_isShowingDataUpdateWindow = false;
        }