Esempio n. 1
0
        private static void CreateInstance(Type FormType)
        {
            object obj = FormType.InvokeMember(null,
                                               BindingFlags.DeclaredOnly |
                                               BindingFlags.Public | BindingFlags.NonPublic |
                                               BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);

            m_frmSplash        = obj as frmSplash;
            m_pSplashInterface = obj as ISplashForm;
            if (m_frmSplash == null)
            {
                throw (new Exception("Splash Screen must inherit from System.Windows.Forms.Form"));
            }
            if (m_pSplashInterface == null)
            {
                throw (new Exception("must implement interface ISplashForm"));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Colse the SplashForm
        /// </summary>
        public static void Close()
        {
            if (m_pThread == null)
            {
                return;
            }

            try
            {
                if (m_frmSplash != null)
                {
                    m_frmSplash.Invoke(new MethodInvoker(m_frmSplash.Close));
                }
            }
            catch (Exception)
            {
            }
            m_pThread.Abort();
            m_pThread   = null;
            m_frmSplash = null;
        }
Esempio n. 3
0
        /// <summary>
        /// Colse the SplashForm
        /// </summary>
        public static void Close()
        {
            if (m_pThread == null) return;

            try
            {
                if (m_frmSplash != null)
                    m_frmSplash.Invoke(new MethodInvoker(m_frmSplash.Close));
            }
            catch (Exception)
            {
            }
            m_pThread.Abort();
            m_pThread = null;
            m_frmSplash = null;
        }
Esempio n. 4
0
 private static void CreateInstance(Type FormType)
 {
     object obj = FormType.InvokeMember(null,
                         BindingFlags.DeclaredOnly |
                         BindingFlags.Public | BindingFlags.NonPublic |
                         BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
     m_frmSplash = obj as frmSplash;
     m_pSplashInterface = obj as ISplashForm;
     if (m_frmSplash == null)
     {
         throw (new Exception("Splash Screen must inherit from System.Windows.Forms.Form"));
     }
     if (m_pSplashInterface == null)
     {
         throw (new Exception("must implement interface ISplashForm"));
     }
 }