public static void Run(string prComponentName) { FrmComponent lcComponentForm; if (string.IsNullOrEmpty(prComponentName) || !_ComponentFormList.TryGetValue(prComponentName, out lcComponentForm)) { lcComponentForm = new FrmComponent(); if (string.IsNullOrEmpty(prComponentName)) { lcComponentForm.SetDetails(new clsComponent()); } else { _ComponentFormList.Add(prComponentName, lcComponentForm); lcComponentForm.refreshFormFromDB(prComponentName); } } else { lcComponentForm.ShowDialog(); lcComponentForm.Activate(); } }
private void btnOpen_Click(object sender, EventArgs e) { FrmComponent.Run(lstCategorys.SelectedItem as string); // this.Hide(); }