private void playText() { try { TextViewer viewer = new TextViewer(lsttxt); viewer.ShowDialog(); } catch (Exception ex) { publics.WriteLogs("ex on play text", ex.ToString()); } }
private void playText(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; TextViewer viewer = new TextViewer(lsttxt); viewer.ShowDialog(); } else { TextViewer viewer = new TextViewer(lsttxt); viewer.ShowDialog(); } } catch (Exception ex) { publics.WriteLogs("ex on play text", ex.ToString()); } }