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