public void SetNextForm(Type form) { if (!registeredForms.Contains(form)) { throw new InvalidOperationException("Form is not registered. Maybe a subform?"); } if (CurrentForm != null && (form == CurrentForm.GetType())) { return; } toOpenForm = form; ResumeThread(); }