private static void CreateProcessInstance(Type FormType) { object obj = FormType.InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null); ProcessForm = (frmProcess)obj; if (ProcessForm == null) { throw (new Exception("Waiting Form must inherit from System.Windows.Forms.Form")); } }
/// <summary> /// Colse the SplashForm /// </summary> public static void CloseProcess() { if (waitingThread == null || ProcessForm == null) return; try { ProcessForm.Invoke(new MethodInvoker(ProcessForm.Close)); } catch (Exception) { } waitingThread = null; ProcessForm = null; }
/// <summary> /// Colse the SplashForm /// </summary> public static void CloseProcess() { if (waitingThread == null || ProcessForm == null) { return; } try { ProcessForm.Invoke(new MethodInvoker(ProcessForm.Close)); } catch (Exception) { } waitingThread = null; ProcessForm = null; }