Exemplo n.º 1
0
        /// ----------------------------------------------------------------------------------------
        /// <summary>
        /// Closes the splash screen
        /// </summary>
        /// ----------------------------------------------------------------------------------------
        public void Close()
        {
            if (m_splashScreen == null)
            {
                return;
            }

            lock (m_splashScreen.m_Synchronizer)
            {
                try
                {
                    m_splashScreen.Invoke(new MethodInvoker(m_splashScreen.RealClose));
                }
                catch
                {
                    // Something bad happened, but we are closing anyways :)
                }
            }
#if !__MonoCS__
            if (m_thread != null)
            {
                m_thread.Join();
            }
#endif
            lock (m_splashScreen.m_Synchronizer)
            {
                m_splashScreen.Dispose();
                m_splashScreen = null;
            }
#if !__MonoCS__
            m_thread = null;
#endif
        }
Exemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Starts the splash screen.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void StartSplashScreen()
        {
            m_splashScreen            = new RealSplashScreen(m_displayToUse);
            m_splashScreen.WaitHandle = m_waitHandle;
#if !__MonoCS__
            m_splashScreen.ShowDialog();
#else
            // Mono Winforms can't create Forms that are not on the Main thread.
            // REVIEW: Is this line actually needed?
            //m_splashScreen.CreateControl();
            m_splashScreen.Show();
#endif
        }
Exemplo n.º 3
0
 /// <summary/>
 protected virtual void Dispose(bool fDisposing)
 {
     Debug.WriteLineIf(!fDisposing, "****** Missing Dispose() call for " + GetType() + ". ****** ");
     if (fDisposing && !IsDisposed)
     {
         // dispose managed and unmanaged objects
         Close();
         if (m_waitHandle != null)
         {
             m_waitHandle.Close();
         }
         if (m_splashScreen != null)
         {
             m_splashScreen.Dispose();
         }
     }
     m_waitHandle   = null;
     m_splashScreen = null;
     IsDisposed     = true;
 }