private static void CloseAll(Reader exclude = null) { try { var tmp = new List<Reader>(sInstances); sInstances.ForEach(f => { if (exclude == null || exclude != f) { f.Close(); sInstances.Remove(f); } } ); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
public static void Open(MailNavigator navigator) { if (!ReadOut.Properties.Settings.Default.SeparateWindow) { CloseAll(); } var readerWindow = new Reader(navigator); readerWindow.Show(); sInstances.Add(readerWindow); }