private void PlayImg(int flag) { try { if (flag == 1) { var number = Application.OpenForms; if (!publics.EMGFlag) { foreach (Form f in number) { try { if (f.Name != "Form1") { Task.Factory.StartNew(() => { this.BeginInvoke(new Action(() => { f.Close(); f.Dispose(); })); }); } } catch (Exception ex) { publics.WriteLogs("ex on close open form", ex.ToString()); return; } } } publics.dispatcherflag = true; frmIMGshow frm = new frmIMGshow(lstJpg); frm.ShowDialog(); } else { frmIMGshow frm = new frmIMGshow(lstJpg); frm.ShowDialog(); } } catch (Exception ex) { publics.WriteLogs("playimg", ex.ToString()); //throw; } }
private void PlayImg() { try { frmIMGshow frm = new frmIMGshow(lstJpg); frm.ShowDialog(); //frm.ShowDialog(); } catch (Exception ex) { publics.WriteLogs("playimg", ex.ToString()); //throw; } }