예제 #1
0
파일: Form1.cs 프로젝트: mjd166/Inst
        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;
            }
        }
예제 #2
0
        private void PlayImg()
        {
            try
            {
                frmIMGshow frm = new frmIMGshow(lstJpg);

                frm.ShowDialog();



                //frm.ShowDialog();
            }
            catch (Exception ex)
            {
                publics.WriteLogs("playimg", ex.ToString());
                //throw;
            }
        }