コード例 #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;
            }
        }