public static Form GetForm(FormType i_FormType, Form i_OpenedBy) { Form toReturn = null; int formIndex = (int)i_FormType; switch (formIndex) { case 0: toReturn = new FriendsBirthdayForm(i_OpenedBy); break; case 1: toReturn = new SearchForm(i_OpenedBy); break; case 2: toReturn = new ImageGalleryForm(i_OpenedBy); break; case 3: toReturn = new UploadPostForm(i_OpenedBy); break; case 4: toReturn = new AboutMeForm(i_OpenedBy); break; } if (toReturn == null) { throw new ArgumentException("Invalid FormType given!!!"); } return(toReturn); }
private void initializeGalleryForm() { FormType formType = FormType.ImageGallery; ImageGalleryForm imageGallery = ReturnableFormFactory.GetForm(formType, this) as ImageGalleryForm; Hide(); imageGallery.ShowDialog(); }
private void initializeGalleryForm() { FormType formType = FormType.ImageGallery; ImageGalleryForm imageGallery = ReturnableFormFactory.GetForm(formType, this) as ImageGalleryForm; imageGallery.m_DoWhenFormIsClosed += () => { setFormUsageDetails(imageGallery); }; Hide(); imageGallery.ShowDialog(); }