public SearchParentForm(PARENT_TYPE type) { InitializeComponent(); this.CenterToScreen(); ParentType = type; btnValidate.Enabled = false; Valid = false; this.Text = "Search " + type.ToString().ToLower(); }
public static SearchParentForm GetInstance(PARENT_TYPE type) { // We close the last form if the parent type we searched for is not the same if (s_Instance != null && !s_Instance.ParentType.Equals(type)) { s_Instance.Close(); } if (s_Instance == null) { s_Instance = new SearchParentForm(type); } return(s_Instance); }